Skip to content

Commit

Permalink
Enable staticcheck linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Aug 11, 2022
1 parent 496cd3e commit 5f64cb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ linters:
- gosimple
- govet
# - ineffassign
# - staticcheck
- staticcheck
- unconvert
- unused
# - varcheck
Expand Down
5 changes: 5 additions & 0 deletions internal/build/imgsrc/nixpacks_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ func ensureNixpacksBinary(ctx context.Context, streams *iostreams.IOStreams) err

err = func() error {
out, err := os.Create(installPath)
if err != nil {
return err
}
defer out.Close()

req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://raw.githubusercontent.com/railwayapp/nixpacks/master/install.sh", nil)
if err != nil {
return err
Expand All @@ -56,6 +60,7 @@ func ensureNixpacksBinary(ctx context.Context, streams *iostreams.IOStreams) err
return err
}
defer resp.Body.Close()

n, err := io.Copy(out, resp.Body)
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions internal/command/dig/dig.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func ResolverForOrg(ctx context.Context, c *agent.Client, orgSlug string) (*net.
return nil, err
}

network = "tcp"
server := net.JoinHostPort(ts.TunnelConfig.DNS.String(), "53")

// the connections we get from the agent are over a unix domain socket proxy,
Expand All @@ -255,7 +254,7 @@ func ResolverForOrg(ctx context.Context, c *agent.Client, orgSlug string) (*net.
net.Conn
}

c, err := d.DialContext(ctx, network, server)
c, err := d.DialContext(ctx, "tcp", server)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 5f64cb3

Please sign in to comment.