mirror of
https://github.com/safing/portbase
synced 2025-09-03 19:20:20 +00:00
Fix linter errors
This commit is contained in:
parent
5accaad794
commit
3c697abd5b
9 changed files with 95 additions and 98 deletions
|
@ -23,5 +23,4 @@
|
|||
// }
|
||||
//
|
||||
// run it here: https://play.golang.org/p/xu1BXT3QYeE
|
||||
//
|
||||
package container
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
Package database provides a universal interface for interacting with the database.
|
||||
|
||||
A Lazy Database
|
||||
# A Lazy Database
|
||||
|
||||
The database system can handle Go structs as well as serialized data by the dsd package.
|
||||
While data is in transit within the system, it does not know which form it currently has. Only when it reaches its destination, it must ensure that it is either of a certain type or dump it.
|
||||
|
||||
Record Interface
|
||||
# Record Interface
|
||||
|
||||
The database system uses the Record interface to transparently handle all types of structs that get saved in the database. Structs include the Base struct to fulfill most parts of the Record interface.
|
||||
|
||||
|
@ -58,6 +58,5 @@ Boilerplate Code:
|
|||
e.SetKey(key)
|
||||
return db.PutNew(e)
|
||||
}
|
||||
|
||||
*/
|
||||
package database
|
||||
|
|
|
@ -14,6 +14,7 @@ type snippet struct {
|
|||
}
|
||||
|
||||
// ParseQuery parses a plaintext query. Special characters (that must be escaped with a '\') are: `\()` and any whitespaces.
|
||||
//
|
||||
//nolint:gocognit
|
||||
func ParseQuery(query string) (*Query, error) {
|
||||
snippets, err := extractSnippets(query)
|
||||
|
|
|
@ -62,7 +62,6 @@ func (m *Module) EnabledAsDependency() bool {
|
|||
// // Run the built-in module management
|
||||
// modules.ManageModules()
|
||||
// })
|
||||
//
|
||||
func EnableModuleManagement(changeNotifyFn func(*Module)) bool {
|
||||
if moduleMgmtEnabled.SetToIf(false, true) {
|
||||
modulesChangeNotifyFn = changeNotifyFn
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Package notifications provides a notification system.
|
||||
|
||||
Notification Lifecycle
|
||||
# Notification Lifecycle
|
||||
|
||||
1. Create Notification with an ID and Message.
|
||||
2. Set possible actions and save it.
|
||||
|
@ -22,6 +22,5 @@ Example
|
|||
case "restart":
|
||||
log.Infof("user wants to restart now.")
|
||||
}
|
||||
|
||||
*/
|
||||
package notifications
|
||||
|
|
|
@ -25,7 +25,6 @@ type singleRecordReader struct {
|
|||
// r.Value = "foobar"
|
||||
// pushUpdate(r)
|
||||
// r.Unlock()
|
||||
//
|
||||
func ProvideRecord(r record.Record) ValueProvider {
|
||||
return &singleRecordReader{r}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,9 @@ type OnceAgain struct {
|
|||
|
||||
// Do calls the function f if and only if Do is being called for the
|
||||
// first time for this instance of Once. In other words, given
|
||||
//
|
||||
// var once Once
|
||||
//
|
||||
// if once.Do(f) is called multiple times, only the first call will invoke f,
|
||||
// even if f has a different value in each invocation. A new instance of
|
||||
// Once is required for each function to execute.
|
||||
|
@ -32,6 +34,7 @@ type OnceAgain struct {
|
|||
// Do is intended for initialization that must be run exactly once. Since f
|
||||
// is niladic, it may be necessary to use a function literal to capture the
|
||||
// arguments to a function to be invoked by Do:
|
||||
//
|
||||
// config.once.Do(func() { config.init(filename) })
|
||||
//
|
||||
// Because no call to Do returns until the one call to f returns, if f causes
|
||||
|
@ -39,7 +42,6 @@ type OnceAgain struct {
|
|||
//
|
||||
// If f panics, Do considers it to have returned; future calls of Do return
|
||||
// without calling f.
|
||||
//
|
||||
func (o *OnceAgain) Do(f func()) {
|
||||
// Note: Here is an incorrect implementation of Do:
|
||||
//
|
||||
|
|
|
@ -9,7 +9,6 @@ import "sync"
|
|||
// A StablePool is a set of temporary objects that may be individually saved and
|
||||
// retrieved.
|
||||
//
|
||||
//
|
||||
// In contrast to sync.Pool, items are not removed automatically. Every item
|
||||
// will be returned at some point. Items are returned in a FIFO manner in order
|
||||
// to evenly distribute usage of a set of items.
|
||||
|
|
Loading…
Add table
Reference in a new issue