1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Update github.com/blevesearch/bleve v1.0.13 -> v1.0.14 (#13947)

This commit is contained in:
6543
2020-12-12 00:16:53 +00:00
committed by GitHub
parent e46a638e8f
commit 3285babcae
101 changed files with 861 additions and 925 deletions

View File

@@ -39,7 +39,12 @@ func GetSizes(ctx context.Context, buildFlags, env []string, gocmdRunner *gocomm
}
if tool == "off" {
return GetSizesGolist(ctx, buildFlags, env, gocmdRunner, dir)
inv := gocommand.Invocation{
BuildFlags: buildFlags,
Env: env,
WorkingDir: dir,
}
return GetSizesGolist(ctx, inv, gocmdRunner)
}
req, err := json.Marshal(struct {
@@ -75,26 +80,17 @@ func GetSizes(ctx context.Context, buildFlags, env []string, gocmdRunner *gocomm
return response.Sizes, nil
}
func GetSizesGolist(ctx context.Context, buildFlags, env []string, gocmdRunner *gocommand.Runner, dir string) (types.Sizes, error) {
inv := gocommand.Invocation{
Verb: "list",
Args: []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"},
Env: env,
BuildFlags: buildFlags,
WorkingDir: dir,
}
func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) {
inv.Verb = "list"
inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}
stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv)
var goarch, compiler string
if rawErr != nil {
if strings.Contains(rawErr.Error(), "cannot find main module") {
// User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc.
// TODO(matloob): Is this a problem in practice?
inv := gocommand.Invocation{
Verb: "env",
Args: []string{"GOARCH"},
Env: env,
WorkingDir: dir,
}
inv.Verb = "env"
inv.Args = []string{"GOARCH"}
envout, enverr := gocmdRunner.Run(ctx, inv)
if enverr != nil {
return nil, enverr