From 52b7131d20eb51a89af0f41e0f16af6a7ce09309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Thu, 5 Sep 2024 14:59:18 +0200 Subject: [PATCH 1/4] utils/osdns: rename to dnshack and move Config to forwarder.DNSConfig Do not call osdns directly - use forwarder.DNSConfig::Apply() instead. Refactor osdns::Configure() signature to avoid dependency loop. Hide Apply() implementation by dnshack build tag. Require tag to run dnshack tests. --- .golangci.yml | 2 +- bind/flag.go | 3 +- command/pac/eval/eval.go | 7 ++- command/pac/server/server.go | 7 ++- command/run/run.go | 7 ++- dns.go | 24 ++++++++++ dns_dnshack.go | 17 +++++++ dns_others.go | 13 +++++ utils/{osdns => dnshack}/ast_test.go | 10 +++- utils/{osdns => dnshack}/dnsconf.go | 17 ++----- utils/{osdns => dnshack}/dnsconf_test.go | 10 +++- utils/dnshack/dnshack.go | 53 +++++++++++++++++++++ utils/{osdns => dnshack}/resolvconf.go | 4 +- utils/{osdns => dnshack}/resolvconf_test.go | 10 +++- utils/osdns/configure.go | 44 ----------------- 15 files changed, 151 insertions(+), 77 deletions(-) create mode 100644 dns.go create mode 100644 dns_dnshack.go create mode 100644 dns_others.go rename utils/{osdns => dnshack}/ast_test.go (76%) rename utils/{osdns => dnshack}/dnsconf.go (88%) rename utils/{osdns => dnshack}/dnsconf_test.go (68%) create mode 100644 utils/dnshack/dnshack.go rename utils/{osdns => dnshack}/resolvconf.go (97%) rename utils/{osdns => dnshack}/resolvconf_test.go (69%) delete mode 100644 utils/osdns/configure.go diff --git a/.golangci.yml b/.golangci.yml index 30861620..8f17b51e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -151,6 +151,6 @@ issues: - nosnakecase source: "func Example" - - path: utils/osdns/ + - path: utils/dnshack/ linters: - goheader diff --git a/bind/flag.go b/bind/flag.go index 352d539a..b5a5e582 100644 --- a/bind/flag.go +++ b/bind/flag.go @@ -20,7 +20,6 @@ import ( "github.com/saucelabs/forwarder/httplog" "github.com/saucelabs/forwarder/log" "github.com/saucelabs/forwarder/ruleset" - "github.com/saucelabs/forwarder/utils/osdns" "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/exp/slices" @@ -35,7 +34,7 @@ func ConfigFile(fs *pflag.FlagSet, configFile *string) { "The following precedence order of configuration sources is used: command flags, environment variables, config file, default values. ") } -func DNSConfig(fs *pflag.FlagSet, cfg *osdns.Config) { +func DNSConfig(fs *pflag.FlagSet, cfg *forwarder.DNSConfig) { fs.VarP(anyflag.NewSliceValue[netip.AddrPort](nil, &cfg.Servers, forwarder.ParseDNSAddress), "dns-server", "n", "[:]"+ "DNS server(s) to use instead of system default. "+ diff --git a/command/pac/eval/eval.go b/command/pac/eval/eval.go index 720522fa..1aed0b2d 100644 --- a/command/pac/eval/eval.go +++ b/command/pac/eval/eval.go @@ -14,19 +14,18 @@ import ( "github.com/saucelabs/forwarder" "github.com/saucelabs/forwarder/bind" "github.com/saucelabs/forwarder/pac" - "github.com/saucelabs/forwarder/utils/osdns" "github.com/spf13/cobra" ) type command struct { pac *url.URL - dnsConfig *osdns.Config + dnsConfig *forwarder.DNSConfig httpTransportConfig *forwarder.HTTPTransportConfig } func (c *command) runE(cmd *cobra.Command, args []string) error { if len(c.dnsConfig.Servers) > 0 { - if err := osdns.Configure(c.dnsConfig); err != nil { + if err := c.dnsConfig.Apply(); err != nil { return fmt.Errorf("configure DNS: %w", err) } } @@ -68,7 +67,7 @@ func (c *command) runE(cmd *cobra.Command, args []string) error { func Command() *cobra.Command { c := command{ pac: &url.URL{Scheme: "file", Path: "pac.js"}, - dnsConfig: osdns.DefaultConfig(), + dnsConfig: forwarder.DefaultDNSConfig(), httpTransportConfig: forwarder.DefaultHTTPTransportConfig(), } diff --git a/command/pac/server/server.go b/command/pac/server/server.go index 320211e2..00b237af 100644 --- a/command/pac/server/server.go +++ b/command/pac/server/server.go @@ -20,13 +20,12 @@ import ( "github.com/saucelabs/forwarder/pac" "github.com/saucelabs/forwarder/runctx" "github.com/saucelabs/forwarder/utils/cobrautil" - "github.com/saucelabs/forwarder/utils/osdns" "github.com/spf13/cobra" ) type command struct { pac *url.URL - dnsConfig *osdns.Config + dnsConfig *forwarder.DNSConfig httpTransportConfig *forwarder.HTTPTransportConfig httpServerConfig *forwarder.HTTPServerConfig logConfig *log.Config @@ -81,7 +80,7 @@ func (c *command) runE(cmd *cobra.Command, _ []string) (cmdErr error) { if len(c.dnsConfig.Servers) > 0 { s := strings.ReplaceAll(fmt.Sprintf("%s", c.dnsConfig.Servers), " ", ", ") logger.Named("dns").Infof("using DNS servers %v", s) - if err := osdns.Configure(c.dnsConfig); err != nil { + if err := c.dnsConfig.Apply(); err != nil { return fmt.Errorf("configure DNS: %w", err) } } @@ -127,7 +126,7 @@ func servePAC(script string) http.Handler { func Command() *cobra.Command { c := command{ pac: &url.URL{Scheme: "file", Path: "pac.js"}, - dnsConfig: osdns.DefaultConfig(), + dnsConfig: forwarder.DefaultDNSConfig(), httpTransportConfig: forwarder.DefaultHTTPTransportConfig(), httpServerConfig: forwarder.DefaultHTTPServerConfig(), logConfig: log.DefaultConfig(), diff --git a/command/run/run.go b/command/run/run.go index 612bc5ae..3f74357b 100644 --- a/command/run/run.go +++ b/command/run/run.go @@ -32,7 +32,6 @@ import ( "github.com/saucelabs/forwarder/utils/cobrautil" "github.com/saucelabs/forwarder/utils/httphandler" "github.com/saucelabs/forwarder/utils/httpx" - "github.com/saucelabs/forwarder/utils/osdns" "github.com/spf13/cobra" "go.uber.org/goleak" "go.uber.org/multierr" @@ -40,7 +39,7 @@ import ( type command struct { promReg *prometheus.Registry - dnsConfig *osdns.Config + dnsConfig *forwarder.DNSConfig httpTransportConfig *forwarder.HTTPTransportConfig pac *url.URL credentials []*forwarder.HostPortUser @@ -129,7 +128,7 @@ func (c *command) runE(cmd *cobra.Command, _ []string) (cmdErr error) { if len(c.dnsConfig.Servers) > 0 { s := strings.ReplaceAll(fmt.Sprintf("%s", c.dnsConfig.Servers), " ", ", ") logger.Named("dns").Infof("using DNS servers %v", s) - if err := osdns.Configure(c.dnsConfig); err != nil { + if err := c.dnsConfig.Apply(); err != nil { return fmt.Errorf("configure dns: %w", err) } } @@ -467,7 +466,7 @@ func Metrics() (*prometheus.Registry, error) { func makeCommand() command { c := command{ promReg: prometheus.NewRegistry(), - dnsConfig: osdns.DefaultConfig(), + dnsConfig: forwarder.DefaultDNSConfig(), httpTransportConfig: forwarder.DefaultHTTPTransportConfig(), httpProxyConfig: forwarder.DefaultHTTPProxyConfig(), mitmConfig: forwarder.DefaultMITMConfig(), diff --git a/dns.go b/dns.go new file mode 100644 index 00000000..244280a7 --- /dev/null +++ b/dns.go @@ -0,0 +1,24 @@ +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +package forwarder + +import ( + "net/netip" + "time" +) + +type DNSConfig struct { + Servers []netip.AddrPort + Timeout time.Duration + RoundRobin bool +} + +func DefaultDNSConfig() *DNSConfig { + return &DNSConfig{ + Timeout: 5 * time.Second, + } +} diff --git a/dns_dnshack.go b/dns_dnshack.go new file mode 100644 index 00000000..f6efcd46 --- /dev/null +++ b/dns_dnshack.go @@ -0,0 +1,17 @@ +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//go:build dnshack + +package forwarder + +import ( + "github.com/saucelabs/forwarder/utils/dnshack" +) + +func (c *DNSConfig) Apply() error { + return dnshack.Configure(c.Servers, c.Timeout, c.RoundRobin) +} diff --git a/dns_others.go b/dns_others.go new file mode 100644 index 00000000..954f9d61 --- /dev/null +++ b/dns_others.go @@ -0,0 +1,13 @@ +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//go:build !dnshack + +package forwarder + +func (c *DNSConfig) Apply() error { + return nil +} diff --git a/utils/osdns/ast_test.go b/utils/dnshack/ast_test.go similarity index 76% rename from utils/osdns/ast_test.go rename to utils/dnshack/ast_test.go index 7be554ca..6b614823 100644 --- a/utils/osdns/ast_test.go +++ b/utils/dnshack/ast_test.go @@ -1,4 +1,12 @@ -package osdns +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//go:build dnshack + +package dnshack import ( "bytes" diff --git a/utils/osdns/dnsconf.go b/utils/dnshack/dnsconf.go similarity index 88% rename from utils/osdns/dnsconf.go rename to utils/dnshack/dnsconf.go index d862ff3e..0e10a609 100644 --- a/utils/osdns/dnsconf.go +++ b/utils/dnshack/dnsconf.go @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found at https://github.com/golang/go/blob/-/LICENSE. -package osdns +//go:build dnshack + +package dnshack import ( _ "net" // for go:linkname - "net/netip" "time" _ "unsafe" // for go:linkname ) @@ -33,15 +34,3 @@ type dnsConfig struct { trustAD bool // add AD flag to queries noReload bool // do not check for config file updates } - -type Config struct { - Servers []netip.AddrPort - Timeout time.Duration - RoundRobin bool -} - -func DefaultConfig() *Config { - return &Config{ - Timeout: 5 * time.Second, - } -} diff --git a/utils/osdns/dnsconf_test.go b/utils/dnshack/dnsconf_test.go similarity index 68% rename from utils/osdns/dnsconf_test.go rename to utils/dnshack/dnsconf_test.go index 07434743..3352ec8d 100644 --- a/utils/osdns/dnsconf_test.go +++ b/utils/dnshack/dnsconf_test.go @@ -1,4 +1,12 @@ -package osdns +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//go:build dnshack + +package dnshack import ( "go/build" diff --git a/utils/dnshack/dnshack.go b/utils/dnshack/dnshack.go new file mode 100644 index 00000000..5ffdb7b2 --- /dev/null +++ b/utils/dnshack/dnshack.go @@ -0,0 +1,53 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found at https://github.com/golang/go/blob/-/LICENSE. + +//go:build dnshack + +package dnshack + +import ( + "errors" + "fmt" + "net/netip" + "sync" + "time" +) + +var preConfigure sync.Once + +// Configure changes the Go standard library DNS resolver to use the specified +// servers with the specified timeout. If roundRobin is true, the resolver will +// rotate the order of the servers on each request. +// +// Since Go 1.23 it requires the -checklinkname=0 linker flag to work. +func Configure(servers []netip.AddrPort, timeout time.Duration, roundRobin bool) error { + preConfigure.Do(func() { + getSystemDNSConfig() + }) + + resolvConf.acquireSema() + defer resolvConf.releaseSema() + + procDNSCfg := resolvConf.dnsConfig.Load() + if procDNSCfg == nil { + return errors.New("failed to get system DNS config") + } + if procDNSCfg.err != nil { + return fmt.Errorf("failed to get system DNS config: %w", procDNSCfg.err) + } + + procDNSCfg.servers = make([]string, len(servers)) + for i := range servers { + procDNSCfg.servers[i] = servers[i].String() + } + procDNSCfg.timeout = timeout + procDNSCfg.rotate = roundRobin + + // Disable config reload from system dns config file (/etc/resolv.conf). + procDNSCfg.noReload = true + + resolvConf.dnsConfig.Store(procDNSCfg) + + return nil +} diff --git a/utils/osdns/resolvconf.go b/utils/dnshack/resolvconf.go similarity index 97% rename from utils/osdns/resolvconf.go rename to utils/dnshack/resolvconf.go index 0791bec8..24a0abeb 100644 --- a/utils/osdns/resolvconf.go +++ b/utils/dnshack/resolvconf.go @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found at https://github.com/golang/go/blob/-/LICENSE. -package osdns +//go:build dnshack + +package dnshack import ( _ "net" // for go:linkname diff --git a/utils/osdns/resolvconf_test.go b/utils/dnshack/resolvconf_test.go similarity index 69% rename from utils/osdns/resolvconf_test.go rename to utils/dnshack/resolvconf_test.go index a72c8292..d734ffaf 100644 --- a/utils/osdns/resolvconf_test.go +++ b/utils/dnshack/resolvconf_test.go @@ -1,4 +1,12 @@ -package osdns +// Copyright 2022-2024 Sauce Labs Inc., all rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//go:build dnshack + +package dnshack import ( "go/build" diff --git a/utils/osdns/configure.go b/utils/osdns/configure.go deleted file mode 100644 index 9cc5e884..00000000 --- a/utils/osdns/configure.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found at https://github.com/golang/go/blob/-/LICENSE. - -package osdns - -import ( - "errors" - "fmt" -) - -func Configure(cfg *Config) error { - // Initialize the resolverConfig. - getSystemDNSConfig() - - return configure(cfg) -} - -func configure(cfg *Config) error { - resolvConf.acquireSema() - defer resolvConf.releaseSema() - - procDNSCfg := resolvConf.dnsConfig.Load() - if procDNSCfg == nil { - return errors.New("failed to get system DNS config") - } - if procDNSCfg.err != nil { - return fmt.Errorf("failed to get system DNS config: %w", procDNSCfg.err) - } - - procDNSCfg.servers = make([]string, len(cfg.Servers)) - for i := range cfg.Servers { - procDNSCfg.servers[i] = cfg.Servers[i].String() - } - procDNSCfg.timeout = cfg.Timeout - procDNSCfg.rotate = cfg.RoundRobin - - // Disable config reload from system dns config file (/etc/resolv.conf). - procDNSCfg.noReload = true - - resolvConf.dnsConfig.Store(procDNSCfg) - - return nil -} From 520bb82529cdca939af718ef48730581fe640792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Mon, 9 Sep 2024 13:39:29 +0200 Subject: [PATCH 2/4] Revert "chore: force adding -checklinkname=0 linter flag" This reverts commit 382ab5b437df187e8e2250e548da461bbed00309. --- .goreleaser.yml | 1 - Makefile | 12 +++++------- packaging/completions.sh | 2 +- packaging/config.sh | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 94fe909c..abedcda6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -20,7 +20,6 @@ builds: flags: - -trimpath ldflags: - - -checklinkname=0 - -extldflags '-static' - -X 'github.com/saucelabs/forwarder/internal/version.Version={{ .Version }}' - -X 'github.com/saucelabs/forwarder/internal/version.Time={{ .Date }}' diff --git a/Makefile b/Makefile index bf68a440..d464bf98 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ export GOBIN ?= $(CURDIR)/bin export PATH := $(GOBIN):$(PATH) -GOLD = -ldflags "-checklinkname=0" - include .version ifneq ($(shell expr $(MAKE_VERSION) \>= 4), 1) @@ -60,7 +58,7 @@ lint: .PHONY: test test: - @go test $(GOLD) -timeout 120s -short -race -cover -coverprofile=coverage.out ./... + @go test -timeout 120s -short -race -cover -coverprofile=coverage.out ./... .PHONY: coverage coverage: @@ -75,10 +73,10 @@ update-devel-image: TMPDIR:=$(shell mktemp -d) update-devel-image: @ln Containerfile LICENSE LICENSE.3RD_PARTY $(TMPDIR) ifeq ($(shell uname),Linux) - @CGO_ENABLED=1 GOOS=linux go build $(GOLD) -race -o $(TMPDIR)/forwarder ./cmd/forwarder + @CGO_ENABLED=1 GOOS=linux go build -race -o $(TMPDIR)/forwarder ./cmd/forwarder @$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile --build-arg BASE_IMAGE=ubuntu:latest -t saucelabs/forwarder:$(TAG) $(TMPDIR) else - @CGO_ENABLED=0 GOOS=linux go build $(GOLD) -o $(TMPDIR)/forwarder ./cmd/forwarder + @CGO_ENABLED=0 GOOS=linux go build -o $(TMPDIR)/forwarder ./cmd/forwarder @$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile -t saucelabs/forwarder:$(TAG) $(TMPDIR) endif @rm -rf $(TMPDIR) @@ -92,9 +90,9 @@ LICENSE.3RD_PARTY: LICENSE.3RD_PARTY.tpl go.mod go.sum .PHONY: run run: .forwarder.yaml run: - @GOMAXPROCS=1 go run $(GOLD) ./cmd/forwarder run --config-file .forwarder.yaml + @GOMAXPROCS=1 go run ./cmd/forwarder run --config-file .forwarder.yaml .PHONY: run-race run-race: .forwarder.yaml run-race: - @go run $(GOLD) --race ./cmd/forwarder run --config-file .forwarder.yaml + @go run --race ./cmd/forwarder run --config-file .forwarder.yaml diff --git a/packaging/completions.sh b/packaging/completions.sh index 693b565e..3e5cf547 100755 --- a/packaging/completions.sh +++ b/packaging/completions.sh @@ -6,7 +6,7 @@ rm -rf completions mkdir completions for sh in bash zsh powershell fish; do - go run -ldflags "-checklinkname=0" ./cmd/forwarder completion "$sh" >"completions/forwarder.$sh" + go run ./cmd/forwarder completion "$sh" >"completions/forwarder.$sh" done # Set powershell extension to ps1. diff --git a/packaging/config.sh b/packaging/config.sh index 00343fa3..d6b065bc 100755 --- a/packaging/config.sh +++ b/packaging/config.sh @@ -2,4 +2,4 @@ set -e -go run -ldflags "-checklinkname=0" ./cmd/forwarder run config-file > "forwarder.yaml" +go run ./cmd/forwarder run config-file > "forwarder.yaml" From d79853b506f66be9cd2a8cc3e689ba5c3ac03d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Mon, 9 Sep 2024 14:10:30 +0200 Subject: [PATCH 3/4] goreleaser: force adding -checklinkname=0 linter flag Restore elements of previous commit. --- .goreleaser.yml | 3 +++ Makefile | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index abedcda6..40451bd9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,9 +17,12 @@ builds: - main: ./cmd/forwarder env: - CGO_ENABLED=0 + tags: + - dnshack flags: - -trimpath ldflags: + - -checklinkname=0 - -extldflags '-static' - -X 'github.com/saucelabs/forwarder/internal/version.Version={{ .Version }}' - -X 'github.com/saucelabs/forwarder/internal/version.Time={{ .Date }}' diff --git a/Makefile b/Makefile index d464bf98..524ac5f3 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,8 @@ coverage: export BUILDAH_FORMAT=docker +GOBUILD = go build -tags dnshack -ldflags "-checklinkname=0" + .PHONY: update-devel-image update-devel-image: CONTAINER_RUNTIME ?= docker update-devel-image: TAG=devel @@ -73,10 +75,10 @@ update-devel-image: TMPDIR:=$(shell mktemp -d) update-devel-image: @ln Containerfile LICENSE LICENSE.3RD_PARTY $(TMPDIR) ifeq ($(shell uname),Linux) - @CGO_ENABLED=1 GOOS=linux go build -race -o $(TMPDIR)/forwarder ./cmd/forwarder + @CGO_ENABLED=1 GOOS=linux $(GOBUILD) -race -o $(TMPDIR)/forwarder ./cmd/forwarder @$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile --build-arg BASE_IMAGE=ubuntu:latest -t saucelabs/forwarder:$(TAG) $(TMPDIR) else - @CGO_ENABLED=0 GOOS=linux go build -o $(TMPDIR)/forwarder ./cmd/forwarder + @CGO_ENABLED=0 GOOS=linux $(GOBUILD) -o $(TMPDIR)/forwarder ./cmd/forwarder @$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile -t saucelabs/forwarder:$(TAG) $(TMPDIR) endif @rm -rf $(TMPDIR) From 770e09d1b4d28e45219bd03290b46ff470ff1711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Mon, 9 Sep 2024 14:12:35 +0200 Subject: [PATCH 4/4] gh: run test to check if dnshack works --- .github/workflows/go.yml | 3 +++ utils/dnshack/Makefile | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 utils/dnshack/Makefile diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0f9d3b9a..bce0468f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -41,6 +41,9 @@ jobs: - name: Run martian unit test run: make -C internal/martian test + - name: Run dnshack test + run: make -C utils/dnshack test + - name: Run unit test run: make test coverage diff --git a/utils/dnshack/Makefile b/utils/dnshack/Makefile new file mode 100644 index 00000000..04b6adbb --- /dev/null +++ b/utils/dnshack/Makefile @@ -0,0 +1,2 @@ +test: + go test -tags dnshack -ldflags "-checklinkname=0"