[PR #1668] [MERGED] Use result of fmt.Errorf call #2241

Closed
opened 2025-12-29 03:20:21 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1668
Author: @clfs
Created: 1/1/2024
Status: Merged
Merged: 2/15/2024
Merged by: @kradalby

Base: mainHead: patch-1


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 hscontrol/tailsql.go (+1 -1)

📄 Description

  • 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/1668 **Author:** [@clfs](https://github.com/clfs) **Created:** 1/1/2024 **Status:** ✅ Merged **Merged:** 2/15/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`178efd7`](https://github.com/juanfont/headscale/commit/178efd7c19f1fef10767e1093b0e2c964052ceeb) Update tailsql.go ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/tailsql.go` (+1 -1) </details> ### 📄 Description <!-- Headscale is "Open Source, acknowledged contribution", this means that any contribution will have to be discussed with the Maintainers before being submitted. This model has been chosen to reduce the risk of burnout by limiting the maintenance overhead of reviewing and validating third-party code. Headscale is open to code contributions for bug fixes without discussion. If you find mistakes in the documentation, please submit a fix to the documentation. --> <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#contributing) - [ ] 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 <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> >Headscale is open to code contributions for bug fixes without discussion. An error value in the `hscontrol` package is unused: ```go // 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`: ```text $ 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:20:21 +01:00
adam closed this issue 2025-12-29 03:20:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2241