mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-22 16:48:40 +02:00
all: fix golangci-lint issues (#3064)
This commit is contained in:
@@ -86,14 +86,13 @@ func TestResolveMagicDNSExtraRecordsPath(t *testing.T) {
|
||||
|
||||
const erPath = "/tmp/extra_records.json"
|
||||
|
||||
extraRecords := []tailcfg.DNSRecord{
|
||||
{
|
||||
Name: "test.myvpn.example.com",
|
||||
Type: "A",
|
||||
Value: "6.6.6.6",
|
||||
},
|
||||
}
|
||||
b, _ := json.Marshal(extraRecords)
|
||||
extraRecords := make([]tailcfg.DNSRecord, 0, 2)
|
||||
extraRecords = append(extraRecords, tailcfg.DNSRecord{
|
||||
Name: "test.myvpn.example.com",
|
||||
Type: "A",
|
||||
Value: "6.6.6.6",
|
||||
})
|
||||
b, _ := json.Marshal(extraRecords) //nolint:errchkjson
|
||||
|
||||
err = scenario.CreateHeadscaleEnv([]tsic.Option{
|
||||
tsic.WithPackages("python3", "curl", "bind-tools"),
|
||||
@@ -133,7 +132,7 @@ func TestResolveMagicDNSExtraRecordsPath(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Write the file directly into place from the docker API.
|
||||
b0, _ := json.Marshal([]tailcfg.DNSRecord{
|
||||
b0, _ := json.Marshal([]tailcfg.DNSRecord{ //nolint:errchkjson
|
||||
{
|
||||
Name: "docker.myvpn.example.com",
|
||||
Type: "A",
|
||||
@@ -155,7 +154,7 @@ func TestResolveMagicDNSExtraRecordsPath(t *testing.T) {
|
||||
Type: "A",
|
||||
Value: "7.7.7.7",
|
||||
})
|
||||
b2, _ := json.Marshal(extraRecords)
|
||||
b2, _ := json.Marshal(extraRecords) //nolint:errchkjson
|
||||
|
||||
err = hs.WriteFile(erPath+"2", b2)
|
||||
require.NoError(t, err)
|
||||
@@ -169,7 +168,7 @@ func TestResolveMagicDNSExtraRecordsPath(t *testing.T) {
|
||||
|
||||
// Write a new file and copy it to the path to ensure the reload
|
||||
// works when a file is copied into place.
|
||||
b3, _ := json.Marshal([]tailcfg.DNSRecord{
|
||||
b3, _ := json.Marshal([]tailcfg.DNSRecord{ //nolint:errchkjson
|
||||
{
|
||||
Name: "copy.myvpn.example.com",
|
||||
Type: "A",
|
||||
@@ -187,7 +186,7 @@ func TestResolveMagicDNSExtraRecordsPath(t *testing.T) {
|
||||
}
|
||||
|
||||
// Write in place to ensure pipe like behaviour works
|
||||
b4, _ := json.Marshal([]tailcfg.DNSRecord{
|
||||
b4, _ := json.Marshal([]tailcfg.DNSRecord{ //nolint:errchkjson
|
||||
{
|
||||
Name: "docker.myvpn.example.com",
|
||||
Type: "A",
|
||||
|
||||
Reference in New Issue
Block a user