Add and fix forcetypeassert

This commit is contained in:
Kristoffer Dalby 2021-11-15 18:42:44 +00:00
parent db8be91d8b
commit 25b790d025
No known key found for this signature in database
GPG Key ID: 09F62DC067465735
2 changed files with 4 additions and 3 deletions

View File

@ -31,16 +31,15 @@ linters:
# We should strive to enable these:
- wrapcheck
- goerr113
- forcetypeassert
- dupl
- makezero
- paralleltest
# We might want to enable this, but it might be a lot of work
- cyclop
- nestif
- wsl # might be incompatible with gofumpt
- testpackage
- paralleltest
linters-settings:
varnamelen:

View File

@ -350,7 +350,9 @@ func (h *Headscale) isOutdated(machine *Machine) bool {
namespaces := make([]string, namespaceSet.Size())
for index, namespace := range namespaceSet.List() {
namespaces[index] = namespace.(string)
if name, ok := namespace.(string); ok {
namespaces[index] = name
}
}
lastChange := h.getLastStateChange(namespaces...)