headscale icon indicating copy to clipboard operation
headscale copied to clipboard

Use result of fmt.Errorf call

Open clfs opened this issue 2 years ago • 0 comments

  • [x] read the CONTRIBUTING guidelines
  • [ ] raised a GitHub issue or discussed it on the projects chat beforehand
  • [ ] added unit tests
  • [ ] added integration tests
  • [ ] updated documentation if needed
  • [ ] updated CHANGELOG.md

Headscale is open to code contributions for bug fixes without discussion.

An error value in the hscontrol package is unused:

// hscontrol/tailsql.go
certDomains := tsNode.CertDomains()
if len(certDomains) == 0 {
	fmt.Errorf("no cert domains available for HTTPS")
}
base := "https://" + certDomains[0]

I spotted it with go vet:

$ go vet ./...
# github.com/juanfont/headscale/hscontrol
hscontrol/tailsql.go:73:14: result of fmt.Errorf call not used

This PR adds the missing return statement.

clfs avatar Jan 01 '24 06:01 clfs