Skip to content

Commit

Permalink
go-fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Dec 12, 2024
1 parent 970c040 commit 2de7961
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ fmt-prettier:
prettier --write '**/**.{ts,js,md,yaml,yml,sass,css,scss,html}'

fmt-go:
golines --max-len=88 --base-formatter=gofumpt -w $(GO_SOURCES)
# TODO(kradalby): Reeval if we want to use 88 in the future.
# golines --max-len=88 --base-formatter=gofumpt -w $(GO_SOURCES)
gofumpt -l -w .
golangci-lint run --fix

fmt-proto:
clang-format -i $(PROTO_SOURCES)
Expand Down
1 change: 0 additions & 1 deletion hscontrol/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ func (h *Headscale) handleAuthKey(
http.Error(writer, "Internal server error", http.StatusInternalServerError)
return
}

}

err = h.db.Write(func(tx *gorm.DB) error {
Expand Down
1 change: 0 additions & 1 deletion hscontrol/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,5 @@ func TestConstraints(t *testing.T) {

tt.run(t, db.DB.Debug())
})

}
}
4 changes: 2 additions & 2 deletions hscontrol/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func (a *AuthProviderOIDC) createOrUpdateUserFromClaim(

// This check is for legacy, if the user cannot be found by the OIDC identifier
// look it up by username. This should only be needed once.
// This branch will presist for a number of versions after the OIDC migration and
// This branch will persist for a number of versions after the OIDC migration and
// then be removed following a deprecation.
// TODO(kradalby): Remove when strip_email_domain and migration is removed
// after #2170 is cleaned up.
Expand Down Expand Up @@ -536,7 +536,7 @@ func renderOIDCCallbackTemplate(

// TODO(kradalby): Reintroduce when strip_email_domain is removed
// after #2170 is cleaned up
// DEPRECATED: DO NOT USE
// DEPRECATED: DO NOT USE.
func getUserName(
claims *types.OIDCClaims,
stripEmaildomain bool,
Expand Down
1 change: 0 additions & 1 deletion hscontrol/util/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func GenerateIPv6DNSRootDomain(ipPrefix netip.Prefix) []dnsname.FQDN {
// NormalizeToFQDNRules will replace forbidden chars in user
// it can also return an error if the user doesn't respect RFC 952 and 1123.
func NormalizeToFQDNRules(name string, stripEmailDomain bool) (string, error) {

name = strings.ToLower(name)
name = strings.ReplaceAll(name, "'", "")
atIdx := strings.Index(name, "@")
Expand Down
4 changes: 2 additions & 2 deletions integration/auth_oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestOIDCAuthenticationPingAll(t *testing.T) {
}

sort.Slice(listUsers, func(i, j int) bool {
return listUsers[i].Id < listUsers[j].Id
return listUsers[i].GetId() < listUsers[j].GetId()
})

if diff := cmp.Diff(want, listUsers, cmpopts.IgnoreUnexported(v1.User{}), cmpopts.IgnoreFields(v1.User{}, "CreatedAt")); diff != "" {
Expand Down Expand Up @@ -514,7 +514,7 @@ func TestOIDC024UserCreation(t *testing.T) {
assertNoErr(t, err)

sort.Slice(listUsers, func(i, j int) bool {
return listUsers[i].Id < listUsers[j].Id
return listUsers[i].GetId() < listUsers[j].GetId()
})

if diff := cmp.Diff(want, listUsers, cmpopts.IgnoreUnexported(v1.User{}), cmpopts.IgnoreFields(v1.User{}, "CreatedAt")); diff != "" {
Expand Down

0 comments on commit 2de7961

Please sign in to comment.