-
-
Notifications
You must be signed in to change notification settings - Fork 3
Add CI workflow to lint and check formatting of Go code #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
An environment variable was used instead of the intended dynamic variable.
On every push and pull request that affects relevant files, and periodically, lint and check formatting of the repository's Go module.
As mandated by golint.
As mandated by golint.
There is the remaining
If I'm to guess, it would be this: diff --git a/libraries/db/db.go b/libraries/db/db.go
index d02bee9..d313367 100644
--- a/libraries/db/db.go
+++ b/libraries/db/db.go
@@ -210,7 +210,7 @@ func (db *DB) Save(r io.Writer) error {
}
func (db *DB) save(r io.Writer) error {
- buff, err := json.MarshalIndent(*db, "", " ")
+ buff, err := json.MarshalIndent(db, "", " ")
if err != nil {
return err
} |
@per1234 I think this should be the fix, much like in other diff --git a/libraries/db/db.go b/libraries/db/db.go
index d02bee9..d313367 100644
--- a/libraries/db/db.go
+++ b/libraries/db/db.go
@@ -210,7 +210,7 @@ func (db *DB) Save(r io.Writer) error {
}
func (db *DB) save(r io.Writer) error {
+ db.mutex.Lock()
+ defer db.mutex.Unlock()
buff, err := json.MarshalIndent(*db, "", " ")
if err != nil {
return err
} I didn't test it though. |
Thanks @silvanocerza! Since the UPDATE: fixed in #46 |
On every push and pull request that affects relevant files, and periodically, lint and check formatting of the
repository's Go module.