From c133ef184d9129ec3faa575342299a66ed9cccec Mon Sep 17 00:00:00 2001
From: Wolfgang Welz <welzwo@gmail.com>
Date: Fri, 26 Jun 2020 12:13:36 +0200
Subject: [PATCH] Fix simple linter warnings (#562)

---
 dapps/faucet/dapp.go                                 |  2 +-
 dapps/networkdelay/dapp.go                           |  6 +++---
 .../valuetransfers/packages/transaction/outputid.go  |  5 ++---
 dapps/valuetransfers/packages/transaction/outputs.go |  5 ++---
 packages/gossip/events.go                            |  4 ----
 plugins/analysis/client/plugin.go                    |  9 ++++-----
 plugins/analysis/packet/fpc_heartbeat.go             |  3 ++-
 plugins/analysis/packet/heartbeat.go                 |  6 +++---
 plugins/autopeering/plugin.go                        |  4 ++--
 plugins/banner/plugin.go                             |  4 ++--
 plugins/bootstrap/plugin.go                          |  4 ++--
 plugins/cli/plugin.go                                |  5 ++---
 plugins/config/plugin.go                             |  3 +--
 plugins/dashboard/plugin.go                          |  2 +-
 plugins/drng/plugin.go                               |  9 ++++-----
 plugins/gossip/plugin.go                             |  6 +++---
 plugins/gracefulshutdown/plugin.go                   | 12 +++++++-----
 plugins/issuer/plugin.go                             |  3 +--
 plugins/logger/plugin.go                             |  6 +++---
 plugins/portcheck/plugin.go                          |  2 +-
 plugins/profiling/plugin.go                          |  2 +-
 plugins/remotelog/plugin.go                          |  2 +-
 plugins/sync/plugin.go                               | 10 +++++-----
 plugins/webapi/autopeering/plugin.go                 |  2 +-
 plugins/webapi/data/plugin.go                        |  2 +-
 plugins/webapi/drng/info/committee/handler.go        |  2 +-
 plugins/webapi/drng/plugin.go                        |  5 +++--
 plugins/webapi/healthz/plugin.go                     |  3 ++-
 plugins/webapi/info/plugin.go                        |  2 +-
 plugins/webapi/plugin.go                             |  2 +-
 plugins/webapi/spammer/plugin.go                     |  7 ++++---
 plugins/webapi/value/plugin.go                       |  5 +++--
 plugins/webauth/webauth.go                           |  2 +-
 33 files changed, 71 insertions(+), 75 deletions(-)

diff --git a/dapps/faucet/dapp.go b/dapps/faucet/dapp.go
index a1d376c2..a4f73655 100644
--- a/dapps/faucet/dapp.go
+++ b/dapps/faucet/dapp.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	faucet "github.com/iotaledger/goshimmer/dapps/faucet/packages"
-	"github.com/iotaledger/goshimmer/dapps/faucet/packages/payload"
+	faucetpayload "github.com/iotaledger/goshimmer/dapps/faucet/packages/payload"
 	"github.com/iotaledger/goshimmer/packages/binary/messagelayer/message"
 	"github.com/iotaledger/goshimmer/packages/binary/messagelayer/tangle"
 	"github.com/iotaledger/goshimmer/packages/shutdown"
diff --git a/dapps/networkdelay/dapp.go b/dapps/networkdelay/dapp.go
index 5912befe..426f5da4 100644
--- a/dapps/networkdelay/dapp.go
+++ b/dapps/networkdelay/dapp.go
@@ -29,7 +29,7 @@ const (
 
 var (
 	// App is the "plugin" instance of the network delay application.
-	app *node.Plugin
+	app  *node.Plugin
 	once sync.Once
 
 	// log holds a reference to the logger used by this app.
@@ -44,8 +44,8 @@ var (
 
 // App gets the plugin instance.
 func App() *node.Plugin {
-	once.Do(func () {
-		app =  node.NewPlugin(PluginName, node.Disabled, configure)
+	once.Do(func() {
+		app = node.NewPlugin(PluginName, node.Disabled, configure)
 	})
 	return app
 }
diff --git a/dapps/valuetransfers/packages/transaction/outputid.go b/dapps/valuetransfers/packages/transaction/outputid.go
index b8386d60..4d6aff44 100644
--- a/dapps/valuetransfers/packages/transaction/outputid.go
+++ b/dapps/valuetransfers/packages/transaction/outputid.go
@@ -2,11 +2,10 @@ package transaction
 
 import (
 	"fmt"
-	"github.com/mr-tron/base58"
-
-	"github.com/iotaledger/hive.go/marshalutil"
 
 	"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/address"
+	"github.com/iotaledger/hive.go/marshalutil"
+	"github.com/mr-tron/base58"
 )
 
 // OutputID is the data type that represents the identifier for a Output.
diff --git a/dapps/valuetransfers/packages/transaction/outputs.go b/dapps/valuetransfers/packages/transaction/outputs.go
index 4cd77a3f..f287b183 100644
--- a/dapps/valuetransfers/packages/transaction/outputs.go
+++ b/dapps/valuetransfers/packages/transaction/outputs.go
@@ -2,13 +2,12 @@ package transaction
 
 import (
 	"bytes"
-	"github.com/iotaledger/hive.go/marshalutil"
 	"sort"
 
 	"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/address"
-	"github.com/iotaledger/goshimmer/packages/binary/datastructure/orderedmap"
-
 	"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/balance"
+	"github.com/iotaledger/goshimmer/packages/binary/datastructure/orderedmap"
+	"github.com/iotaledger/hive.go/marshalutil"
 )
 
 // Outputs represents a list of Outputs that are part of a transaction.
diff --git a/packages/gossip/events.go b/packages/gossip/events.go
index 93875d68..96f303c6 100644
--- a/packages/gossip/events.go
+++ b/packages/gossip/events.go
@@ -29,10 +29,6 @@ func peerAndErrorCaller(handler interface{}, params ...interface{}) {
 	handler.(func(*peer.Peer, error))(params[0].(*peer.Peer), params[1].(error))
 }
 
-func peerCaller(handler interface{}, params ...interface{}) {
-	handler.(func(*peer.Peer))(params[0].(*peer.Peer))
-}
-
 func neighborCaller(handler interface{}, params ...interface{}) {
 	handler.(func(*Neighbor))(params[0].(*Neighbor))
 }
diff --git a/plugins/analysis/client/plugin.go b/plugins/analysis/client/plugin.go
index 734e3507..0761a9a9 100644
--- a/plugins/analysis/client/plugin.go
+++ b/plugins/analysis/client/plugin.go
@@ -32,11 +32,10 @@ func init() {
 
 var (
 	// plugin is the plugin instance of the analysis client plugin.
-	plugin   *node.Plugin
-	once     sync.Once
-	log      *logger.Logger
-	conn     *Connector
-	connLock sync.Mutex
+	plugin *node.Plugin
+	once   sync.Once
+	log    *logger.Logger
+	conn   *Connector
 )
 
 // Plugin gets the plugin instance
diff --git a/plugins/analysis/packet/fpc_heartbeat.go b/plugins/analysis/packet/fpc_heartbeat.go
index 3c64aafc..a02f5084 100644
--- a/plugins/analysis/packet/fpc_heartbeat.go
+++ b/plugins/analysis/packet/fpc_heartbeat.go
@@ -5,6 +5,7 @@ import (
 	"encoding/binary"
 	"encoding/gob"
 	"errors"
+
 	"github.com/iotaledger/goshimmer/packages/vote"
 	"github.com/iotaledger/hive.go/protocol/message"
 	"github.com/iotaledger/hive.go/protocol/tlv"
@@ -30,7 +31,7 @@ type FPCHeartbeat struct {
 func FPCHeartbeatMessageDefinition() *message.Definition {
 	// fpcHeartbeatMessageDefinition defines a heartbeat message's format.
 	var fpcHeartbeatMessageDefinition *message.Definition
-	fpcHeartBeatOnce.Do(func(){
+	fpcHeartBeatOnce.Do(func() {
 		fpcHeartbeatMessageDefinition = &message.Definition{
 			ID:             MessageTypeFPCHeartbeat,
 			MaxBytesLength: 65535,
diff --git a/plugins/analysis/packet/heartbeat.go b/plugins/analysis/packet/heartbeat.go
index 65f75e56..49fe1c06 100644
--- a/plugins/analysis/packet/heartbeat.go
+++ b/plugins/analysis/packet/heartbeat.go
@@ -6,6 +6,7 @@ import (
 	"encoding/binary"
 	"errors"
 	"fmt"
+
 	"github.com/iotaledger/hive.go/protocol/message"
 	"github.com/iotaledger/hive.go/protocol/tlv"
 )
@@ -31,7 +32,6 @@ const (
 		HeartbeatMaxOutboundPeersCount*sha256.Size + HeartbeatMaxInboundPeersCount*sha256.Size
 )
 
-
 // Heartbeat represents a heartbeat packet.
 type Heartbeat struct {
 	// The ID of the node who sent the heartbeat.
@@ -46,10 +46,10 @@ type Heartbeat struct {
 }
 
 // HeartBeatMessageDefinition gets the heartbeatMessageDefinition.
-func HeartBeatMessageDefinition() *message.Definition{
+func HeartBeatMessageDefinition() *message.Definition {
 	// heartbeatMessageDefinition defines a heartbeat message's format.
 	var heartbeatMessageDefinition *message.Definition
-	heartBeatOnce.Do(func(){
+	heartBeatOnce.Do(func() {
 		heartbeatMessageDefinition = &message.Definition{
 			ID:             MessageTypeHeartbeat,
 			MaxBytesLength: uint16(HeartbeatPacketMaxSize),
diff --git a/plugins/autopeering/plugin.go b/plugins/autopeering/plugin.go
index c100b976..40c31a2b 100644
--- a/plugins/autopeering/plugin.go
+++ b/plugins/autopeering/plugin.go
@@ -19,7 +19,7 @@ const PluginName = "Autopeering"
 var (
 	// plugin is the plugin instance of the autopeering plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 
 	log *logger.Logger
 )
@@ -27,7 +27,7 @@ var (
 // Plugin gets the plugin instance.
 func Plugin() *node.Plugin {
 	once.Do(func() {
-		plugin =  node.NewPlugin(PluginName, node.Enabled, configure, run)
+		plugin = node.NewPlugin(PluginName, node.Enabled, configure, run)
 	})
 	return plugin
 }
diff --git a/plugins/banner/plugin.go b/plugins/banner/plugin.go
index f71fab08..5603df69 100644
--- a/plugins/banner/plugin.go
+++ b/plugins/banner/plugin.go
@@ -13,7 +13,7 @@ const PluginName = "Banner"
 var (
 	// plugin is the plugin instance of the banner plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 )
 
 const (
@@ -27,7 +27,7 @@ const (
 // Plugin gets the plugin instance.
 func Plugin() *node.Plugin {
 	once.Do(func() {
-		plugin =  node.NewPlugin(PluginName, node.Disabled, configure, run)
+		plugin = node.NewPlugin(PluginName, node.Disabled, configure, run)
 	})
 	return plugin
 }
diff --git a/plugins/bootstrap/plugin.go b/plugins/bootstrap/plugin.go
index c1aab9dd..c16ffe22 100644
--- a/plugins/bootstrap/plugin.go
+++ b/plugins/bootstrap/plugin.go
@@ -35,14 +35,14 @@ func init() {
 var (
 	// plugin is the plugin instance of the bootstrap plugin.
 	plugin *node.Plugin
-	once goSync.Once
+	once   goSync.Once
 	log    *logger.Logger
 )
 
 // Plugin gets the plugin instance.
 func Plugin() *node.Plugin {
 	once.Do(func() {
-		plugin =  node.NewPlugin(PluginName, node.Disabled, configure, run)
+		plugin = node.NewPlugin(PluginName, node.Disabled, configure, run)
 	})
 	return plugin
 }
diff --git a/plugins/cli/plugin.go b/plugins/cli/plugin.go
index 8946d22b..168aa3d3 100644
--- a/plugins/cli/plugin.go
+++ b/plugins/cli/plugin.go
@@ -5,11 +5,10 @@ import (
 	"os"
 	"sync"
 
+	"github.com/iotaledger/goshimmer/plugins/banner"
 	"github.com/iotaledger/hive.go/events"
 	"github.com/iotaledger/hive.go/node"
 	flag "github.com/spf13/pflag"
-
-	"github.com/iotaledger/goshimmer/plugins/banner"
 )
 
 // PluginName is the name of the CLI plugin.
@@ -18,7 +17,7 @@ const PluginName = "CLI"
 var (
 	// plugin is the plugin instance of the CLI plugin.
 	plugin  *node.Plugin
-	once sync.Once
+	once    sync.Once
 	version = flag.BoolP("version", "v", false, "Prints the GoShimmer version")
 )
 
diff --git a/plugins/config/plugin.go b/plugins/config/plugin.go
index 151ed747..76b2cf7e 100644
--- a/plugins/config/plugin.go
+++ b/plugins/config/plugin.go
@@ -27,7 +27,7 @@ var (
 	skipConfigAvailable = flag.Bool("skip-config", false, "Skip config file availability check")
 
 	// Node is viper
-	_node *viper.Viper
+	_node    *viper.Viper
 	nodeOnce sync.Once
 )
 
@@ -57,7 +57,6 @@ func init() {
 	_node = Node()
 	plugin = Plugin()
 
-
 	plugin.Events.Init.Attach(events.NewClosure(func(*node.Plugin) {
 		if err := fetch(false); err != nil {
 			if !*skipConfigAvailable {
diff --git a/plugins/dashboard/plugin.go b/plugins/dashboard/plugin.go
index b19aaf9a..64553804 100644
--- a/plugins/dashboard/plugin.go
+++ b/plugins/dashboard/plugin.go
@@ -33,7 +33,7 @@ const PluginName = "Dashboard"
 var (
 	// plugin is the plugin instance of the dashboard plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 
 	log    *logger.Logger
 	server *echo.Echo
diff --git a/plugins/drng/plugin.go b/plugins/drng/plugin.go
index 041c1d5d..55deeafb 100644
--- a/plugins/drng/plugin.go
+++ b/plugins/drng/plugin.go
@@ -20,11 +20,11 @@ const PluginName = "DRNG"
 
 var (
 	// plugin is the plugin instance of the DRNG plugin.
-	plugin   *node.Plugin
+	plugin     *node.Plugin
 	pluginOnce sync.Once
-	instance *drng.DRNG
-	once     sync.Once
-	log      *logger.Logger
+	instance   *drng.DRNG
+	once       sync.Once
+	log        *logger.Logger
 )
 
 // Plugin gets the plugin instance.
@@ -35,7 +35,6 @@ func Plugin() *node.Plugin {
 	return plugin
 }
 
-
 func configure(_ *node.Plugin) {
 	configureEvents()
 }
diff --git a/plugins/gossip/plugin.go b/plugins/gossip/plugin.go
index 4e62dc9a..d32ad253 100644
--- a/plugins/gossip/plugin.go
+++ b/plugins/gossip/plugin.go
@@ -1,6 +1,8 @@
 package gossip
 
 import (
+	"sync"
+
 	"github.com/iotaledger/goshimmer/packages/binary/messagelayer/message"
 	"github.com/iotaledger/goshimmer/packages/binary/messagelayer/tangle"
 	"github.com/iotaledger/goshimmer/packages/gossip"
@@ -13,7 +15,6 @@ import (
 	"github.com/iotaledger/hive.go/events"
 	"github.com/iotaledger/hive.go/logger"
 	"github.com/iotaledger/hive.go/node"
-	"sync"
 )
 
 // PluginName is the name of the gossip plugin.
@@ -22,7 +23,7 @@ const PluginName = "Gossip"
 var (
 	// plugin is the plugin instance of the gossip plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 
 	log *logger.Logger
 )
@@ -35,7 +36,6 @@ func Plugin() *node.Plugin {
 	return plugin
 }
 
-
 func configure(*node.Plugin) {
 	log = logger.NewLogger(PluginName)
 
diff --git a/plugins/gracefulshutdown/plugin.go b/plugins/gracefulshutdown/plugin.go
index efa54649..efc50f74 100644
--- a/plugins/gracefulshutdown/plugin.go
+++ b/plugins/gracefulshutdown/plugin.go
@@ -23,9 +23,9 @@ const WaitToKillTimeInSeconds = 60
 
 var (
 	// plugin is the plugin instance of the graceful shutdown plugin.
- 	plugin *node.Plugin
-	once sync.Once
-	log *logger.Logger
+	plugin       *node.Plugin
+	once         sync.Once
+	log          *logger.Logger
 	gracefulStop chan os.Signal
 )
 
@@ -45,8 +45,11 @@ func Plugin() *node.Plugin {
 				log.Warnf("Received shutdown request - waiting (max %d) to finish processing ...", WaitToKillTimeInSeconds)
 
 				go func() {
+					ticker := time.NewTicker(1 * time.Second)
+					defer ticker.Stop()
+
 					start := time.Now()
-					for x := range time.Tick(1 * time.Second) {
+					for x := range ticker.C {
 						secondsSinceStart := x.Sub(start).Seconds()
 
 						if secondsSinceStart <= WaitToKillTimeInSeconds {
@@ -71,7 +74,6 @@ func Plugin() *node.Plugin {
 	return plugin
 }
 
-
 // ShutdownWithError prints out an error message and shuts down the default daemon instance.
 func ShutdownWithError(err error) {
 	log.Error(err)
diff --git a/plugins/issuer/plugin.go b/plugins/issuer/plugin.go
index 8bc87008..85a997f9 100644
--- a/plugins/issuer/plugin.go
+++ b/plugins/issuer/plugin.go
@@ -17,8 +17,7 @@ const PluginName = "Issuer"
 var (
 	// plugin is the plugin instance of the issuer plugin.
 	plugin *node.Plugin
-	once goSync.Once
-
+	once   goSync.Once
 )
 
 // Plugin gets the plugin instance.
diff --git a/plugins/logger/plugin.go b/plugins/logger/plugin.go
index 5ab85c84..f05107bf 100644
--- a/plugins/logger/plugin.go
+++ b/plugins/logger/plugin.go
@@ -1,11 +1,12 @@
 package logger
 
 import (
+	"sync"
+
 	"github.com/iotaledger/goshimmer/plugins/config"
 	"github.com/iotaledger/hive.go/events"
 	"github.com/iotaledger/hive.go/logger"
 	"github.com/iotaledger/hive.go/node"
-	"sync"
 )
 
 // PluginName is the name of the logger plugin.
@@ -14,7 +15,7 @@ const PluginName = "Logger"
 var (
 	// plugin is the plugin instance of the logger plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 )
 
 // Plugin gets the plugin instance.
@@ -25,7 +26,6 @@ func Plugin() *node.Plugin {
 	return plugin
 }
 
-
 // Init triggers the Init event.
 func Init() {
 	plugin.Events.Init.Trigger(plugin)
diff --git a/plugins/portcheck/plugin.go b/plugins/portcheck/plugin.go
index e1b6845b..ebfe045b 100644
--- a/plugins/portcheck/plugin.go
+++ b/plugins/portcheck/plugin.go
@@ -20,7 +20,7 @@ const PluginName = "PortCheck"
 var (
 	// plugin is the plugin instance of the port check plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 	log    *logger.Logger
 )
 
diff --git a/plugins/profiling/plugin.go b/plugins/profiling/plugin.go
index 4ab416d6..4035e2df 100644
--- a/plugins/profiling/plugin.go
+++ b/plugins/profiling/plugin.go
@@ -20,7 +20,7 @@ const PluginName = "Profiling"
 var (
 	// plugin is the profiling plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 	log    *logger.Logger
 )
 
diff --git a/plugins/remotelog/plugin.go b/plugins/remotelog/plugin.go
index fee33233..35e8e8fc 100644
--- a/plugins/remotelog/plugin.go
+++ b/plugins/remotelog/plugin.go
@@ -38,7 +38,7 @@ const (
 var (
 	// plugin is the plugin instance of the remote plugin instance.
 	plugin      *node.Plugin
-	pluginOnce	sync.Once
+	pluginOnce  sync.Once
 	log         *logger.Logger
 	myID        string
 	myGitHead   string
diff --git a/plugins/sync/plugin.go b/plugins/sync/plugin.go
index 738285a9..b44f9d21 100644
--- a/plugins/sync/plugin.go
+++ b/plugins/sync/plugin.go
@@ -51,7 +51,7 @@ func init() {
 var (
 	// plugin is the plugin instance of the sync plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 	// ErrNodeNotSynchronized is returned when an operation can't be executed because
 	// the node is not synchronized.
 	ErrNodeNotSynchronized = errors.New("node is not synchronized")
@@ -145,8 +145,8 @@ func monitorForDesynchronization() {
 		messagelayer.Tangle().Events.MessageAttached.Attach(monitorMessageInflowClosure)
 		defer messagelayer.Tangle().Events.MessageAttached.Detach(monitorMessageInflowClosure)
 
-		desyncedIfNoMessageInSec := config.Node().GetDuration(CfgSyncDesyncedIfNoMessageAfterSec) * time.Second
-		timer := time.NewTimer(desyncedIfNoMessageInSec)
+		timeForDesync := config.Node().GetDuration(CfgSyncDesyncedIfNoMessageAfterSec) * time.Second
+		timer := time.NewTimer(timeForDesync)
 		for {
 			select {
 
@@ -156,10 +156,10 @@ func monitorForDesynchronization() {
 					<-timer.C
 				}
 				// TODO: perhaps find a better way instead of constantly resetting the timer
-				timer.Reset(desyncedIfNoMessageInSec)
+				timer.Reset(timeForDesync)
 
 			case <-timer.C:
-				log.Infof("no message received in %d seconds, marking node as desynced", int(desyncedIfNoMessageInSec.Seconds()))
+				log.Infof("no message received in %d seconds, marking node as desynced", int(timeForDesync.Seconds()))
 				markDesynced()
 				return
 
diff --git a/plugins/webapi/autopeering/plugin.go b/plugins/webapi/autopeering/plugin.go
index 9b046602..512a5c25 100644
--- a/plugins/webapi/autopeering/plugin.go
+++ b/plugins/webapi/autopeering/plugin.go
@@ -20,7 +20,7 @@ const PluginName = "WebAPI autopeering Endpoint"
 var (
 	// plugin is the plugin instance of the web API autopeering endpoint plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 )
 
 func configure(plugin *node.Plugin) {
diff --git a/plugins/webapi/data/plugin.go b/plugins/webapi/data/plugin.go
index 91f683f5..a13ecce6 100644
--- a/plugins/webapi/data/plugin.go
+++ b/plugins/webapi/data/plugin.go
@@ -18,7 +18,7 @@ const PluginName = "WebAPI data Endpoint"
 var (
 	// plugin is the plugin instance of the web API data endpoint plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 	log    *logger.Logger
 )
 
diff --git a/plugins/webapi/drng/info/committee/handler.go b/plugins/webapi/drng/info/committee/handler.go
index 6462e8a6..cc466992 100644
--- a/plugins/webapi/drng/info/committee/handler.go
+++ b/plugins/webapi/drng/info/committee/handler.go
@@ -23,7 +23,7 @@ func Handler(c echo.Context) error {
 type Response struct {
 	InstanceID    uint32              `json:"instanceID,omitempty"`
 	Threshold     uint8               `json:"threshold,omitempty"`
-	Identities    []ed25519.PublicKey `json:"identitites,omitempty"`
+	Identities    []ed25519.PublicKey `json:"identities,omitempty"`
 	DistributedPK []byte              `json:"distributedPK,omitempty"`
 	Error         string              `json:"error,omitempty"`
 }
diff --git a/plugins/webapi/drng/plugin.go b/plugins/webapi/drng/plugin.go
index d2a89ec6..ccbcc152 100644
--- a/plugins/webapi/drng/plugin.go
+++ b/plugins/webapi/drng/plugin.go
@@ -1,12 +1,13 @@
 package drng
 
 import (
+	"sync"
+
 	"github.com/iotaledger/goshimmer/plugins/webapi"
 	"github.com/iotaledger/goshimmer/plugins/webapi/drng/collectivebeacon"
 	"github.com/iotaledger/goshimmer/plugins/webapi/drng/info/committee"
 	"github.com/iotaledger/goshimmer/plugins/webapi/drng/info/randomness"
 	"github.com/iotaledger/hive.go/node"
-	"sync"
 )
 
 // PluginName is the name of the web API DRNG endpoint plugin.
@@ -15,7 +16,7 @@ const PluginName = "WebAPI DRNG Endpoint"
 var (
 	// plugin is the plugin instance of the web API DRNG endpoint plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 )
 
 // Plugin gets the plugin instance.
diff --git a/plugins/webapi/healthz/plugin.go b/plugins/webapi/healthz/plugin.go
index d0c859d4..d81d90ed 100644
--- a/plugins/webapi/healthz/plugin.go
+++ b/plugins/webapi/healthz/plugin.go
@@ -17,8 +17,9 @@ const PluginName = "WebAPI healthz Endpoint"
 var (
 	// plugin is the plugin instance of the web API info endpoint plugin.
 	plugin *node.Plugin
-	once goSync.Once
+	once   goSync.Once
 )
+
 // Plugin gets the plugin instance.
 func Plugin() *node.Plugin {
 	once.Do(func() {
diff --git a/plugins/webapi/info/plugin.go b/plugins/webapi/info/plugin.go
index 8c2053d0..a64f121b 100644
--- a/plugins/webapi/info/plugin.go
+++ b/plugins/webapi/info/plugin.go
@@ -19,7 +19,7 @@ const PluginName = "WebAPI info Endpoint"
 var (
 	// plugin is the plugin instance of the web API info endpoint plugin.
 	plugin *node.Plugin
-	once goSync.Once
+	once   goSync.Once
 )
 
 // Plugin gets the plugin instance.
diff --git a/plugins/webapi/plugin.go b/plugins/webapi/plugin.go
index 73482f88..24074bf6 100644
--- a/plugins/webapi/plugin.go
+++ b/plugins/webapi/plugin.go
@@ -23,7 +23,7 @@ var (
 	plugin     *node.Plugin
 	pluginOnce sync.Once
 	// server is the web API server.
-	server *echo.Echo
+	server     *echo.Echo
 	serverOnce sync.Once
 
 	log *logger.Logger
diff --git a/plugins/webapi/spammer/plugin.go b/plugins/webapi/spammer/plugin.go
index 248338f6..80a540d1 100644
--- a/plugins/webapi/spammer/plugin.go
+++ b/plugins/webapi/spammer/plugin.go
@@ -1,6 +1,8 @@
 package spammer
 
 import (
+	"sync"
+
 	"github.com/iotaledger/goshimmer/packages/binary/spammer"
 	"github.com/iotaledger/goshimmer/packages/shutdown"
 	"github.com/iotaledger/goshimmer/plugins/issuer"
@@ -8,7 +10,6 @@ import (
 	"github.com/iotaledger/hive.go/daemon"
 	"github.com/iotaledger/hive.go/logger"
 	"github.com/iotaledger/hive.go/node"
-	"sync"
 )
 
 var messageSpammer *spammer.Spammer
@@ -19,8 +20,8 @@ const PluginName = "Spammer"
 var (
 	// plugin is the plugin instance of the spammer plugin.
 	plugin *node.Plugin
-	once sync.Once
-	log *logger.Logger
+	once   sync.Once
+	log    *logger.Logger
 )
 
 // Plugin gets the plugin instance.
diff --git a/plugins/webapi/value/plugin.go b/plugins/webapi/value/plugin.go
index 4fcdf40e..f9f4cb9b 100644
--- a/plugins/webapi/value/plugin.go
+++ b/plugins/webapi/value/plugin.go
@@ -1,6 +1,8 @@
 package value
 
 import (
+	"sync"
+
 	"github.com/iotaledger/goshimmer/plugins/webapi"
 	"github.com/iotaledger/goshimmer/plugins/webapi/value/attachments"
 	"github.com/iotaledger/goshimmer/plugins/webapi/value/gettransactionbyid"
@@ -8,7 +10,6 @@ import (
 	"github.com/iotaledger/goshimmer/plugins/webapi/value/testsendtxn"
 	"github.com/iotaledger/goshimmer/plugins/webapi/value/unspentoutputs"
 	"github.com/iotaledger/hive.go/node"
-	"sync"
 )
 
 // PluginName is the name of the web API DRNG endpoint plugin.
@@ -17,7 +18,7 @@ const PluginName = "WebAPI Value Endpoint"
 var (
 	// plugin is the plugin instance of the web API DRNG endpoint plugin.
 	plugin *node.Plugin
-	once sync.Once
+	once   sync.Once
 )
 
 // Plugin gets the plugin instance.
diff --git a/plugins/webauth/webauth.go b/plugins/webauth/webauth.go
index a337d7ba..25321d29 100644
--- a/plugins/webauth/webauth.go
+++ b/plugins/webauth/webauth.go
@@ -21,7 +21,7 @@ const PluginName = "WebAPI Auth"
 var (
 	// plugin is the plugin instance of the web API auth plugin.
 	plugin     *node.Plugin
-	once 	   sync.Once
+	once       sync.Once
 	log        *logger.Logger
 	privateKey string
 )
-- 
GitLab