mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-22 17:40:46 +00:00
Removed unused code and linting fixes
Another bunch of gosec/golint related fixes Remove method no longer used
This commit is contained in:

committed by
Kristoffer Dalby

parent
a506d0fcc8
commit
8170f5e693
4
db.go
4
db.go
@@ -106,6 +106,7 @@ func (h *Headscale) initDB() error {
|
||||
Err(err).
|
||||
Str("enabled_route", prefix.String()).
|
||||
Msg("Error parsing enabled_route")
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -114,6 +115,7 @@ func (h *Headscale) initDB() error {
|
||||
log.Info().
|
||||
Str("enabled_route", prefix.String()).
|
||||
Msg("Route already migrated to new table, skipping")
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -335,6 +337,7 @@ func (i *IPPrefix) Scan(destination interface{}) error {
|
||||
return err
|
||||
}
|
||||
*i = IPPrefix(prefix)
|
||||
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("%w: unexpected data type %T", ErrCannotParsePrefix, destination)
|
||||
@@ -344,6 +347,7 @@ func (i *IPPrefix) Scan(destination interface{}) error {
|
||||
// Value return json value, implement driver.Valuer interface.
|
||||
func (i IPPrefix) Value() (driver.Value, error) {
|
||||
prefixStr := netip.Prefix(i).String()
|
||||
|
||||
return prefixStr, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user