chore: move var to after type definitions
This commit is contained in:
parent
b3efc0043f
commit
b0910cb027
6
main.go
6
main.go
@ -14,15 +14,15 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Global counter
|
|
||||||
var C counter
|
|
||||||
|
|
||||||
// Counter mutex for counter
|
// Counter mutex for counter
|
||||||
type counter struct {
|
type counter struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
n int
|
n int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Global counter
|
||||||
|
var C counter
|
||||||
|
|
||||||
// Add value to counter
|
// Add value to counter
|
||||||
func (c *counter) Add() {
|
func (c *counter) Add() {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user