diff --git a/cmd/gf/internal/cmd/cmd_build.go b/cmd/gf/internal/cmd/cmd_build.go index 182ee370b..2454da574 100644 --- a/cmd/gf/internal/cmd/cmd_build.go +++ b/cmd/gf/internal/cmd/cmd_build.go @@ -138,11 +138,6 @@ type cBuildInput struct { type cBuildOutput struct{} func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, err error) { - // print used go env - if in.DumpENV { - _, _ = Env.Index(ctx, cEnvInput{}) - } - mlog.SetHeaderPrint(true) mlog.Debugf(`build command input: %+v`, in) @@ -241,6 +236,10 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e } else { genv.MustSet("CGO_ENABLED", "0") } + // print used go env + if in.DumpENV { + _, _ = Env.Index(ctx, cEnvInput{}) + } for system, item := range platformMap { if len(customSystems) > 0 && customSystems[0] != "all" && !gstr.InArray(customSystems, system) { continue