Skip to content

Commit

Permalink
Remove deprecated -d flag in 'go get' (go 1.23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Sep 10, 2024
1 parent cca523f commit ef41586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (env environment) runCommand(ctx context.Context, cmd *exec.Cmd) error {
}
}

// execGoGet runs "go get -d -v" with the given module/version as an argument.
// execGoGet runs "go get -v" with the given module/version as an argument.
// Also allows passing in a second module/version pair, meant to be the main
// Caddy module/version we're building against; this will prevent the
// plugin module from causing the Caddy version to upgrade, if the plugin
Expand All @@ -336,7 +336,7 @@ func (env environment) execGoGet(ctx context.Context, modulePath, moduleVersion,
caddy += "@" + caddyVersion
}

cmd := env.newGoBuildCommand(ctx, "get", "-d", "-v")
cmd := env.newGoBuildCommand(ctx, "get", "-v")
// using an empty string as an additional argument to "go get"
// breaks the command since it treats the empty string as a
// distinct argument, so we're using an if statement to avoid it.
Expand Down

5 comments on commit ef41586

@ta2013
Copy link

@ta2013 ta2013 commented on ef41586 Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this.

but how can i get it working?
I did go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
❯ xcaddy version
v0.4.2 h1:N+W2glljYrfHO4mTnpDhUnNzobeQE46OfPXfiPbO3dY=

i got this warning while building custom caddy:
2024/09/11 06:33:03 [INFO] exec (timeout=0s): /usr/bin/go get -d -v github.com/caddyserver/caddy/v2
go: -d flag is deprecated. -d=true is a no-op

@mholt
Copy link
Member Author

@mholt mholt commented on ef41586 Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ta2013 Until a release is tagged, you'll want to use @master which refers to the latest commit, instead of @latest which refers to the latest release.

@ta2013
Copy link

@ta2013 ta2013 commented on ef41586 Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i just noticed this another behavior on @latest vs @master:

with same cmd:
xcaddy build --output ./caddy/caddy --with github.com/caddyserver/caddy/v2=./caddy

On @latest: its building OK with those info about using local caddy folder:
go: to add module requirements and sums:
go mod tidy
2024/09/11 08:15:08 [INFO] Replace github.com/caddyserver/caddy/v2 => /home/dev/caddy
2024/09/11 08:15:08 [INFO] exec (timeout=0s): /usr/bin/go mod edit -replace github.com/caddyserver/caddy/v2=/home/dev/caddy
2024/09/11 08:15:08 [INFO] Pinning versions

On @master: it has no above infor about replacing local caddy folder, and finally binary has no modify

Do i using wrong or some issues?

Thanks!

@mholt
Copy link
Member Author

@mholt mholt commented on ef41586 Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open an issue just in case. Thanks!

@ta2013
Copy link

@ta2013 ta2013 commented on ef41586 Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i just opened an issue

Please sign in to comment.