Skip to content

Commit

Permalink
Use HasPrefix instead of Index
Browse files Browse the repository at this point in the history
  • Loading branch information
metal3d committed Jun 22, 2021
1 parent aa8002d commit 7529e92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/command/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func goBuild(ctx Context) error {
if len(ldflags) > 0 {
flags := make([]string, len(ldflags))
for i, flag := range ldflags {
if strings.Index(flag, "-X") == 0 {
if strings.HasPrefix(flag, "-X") {
// We must rebuild cases
// if the user pass "-ldflags "-X A.B=C" so we need to set it to "-X=A.B=C"
// if the user pass "-ldflags "-X=A.B=C" so we should not change it
Expand Down

0 comments on commit 7529e92

Please sign in to comment.