diff options
author | borman <borman@yandex-team.com> | 2023-12-06 20:43:18 +0300 |
---|---|---|
committer | borman <borman@yandex-team.com> | 2023-12-06 23:34:56 +0300 |
commit | b2c749509aee1b26713f88e93aa7c7f7059e31e0 (patch) | |
tree | 4d4f282facc7edf966875d5aaa2b1f5e13d45469 /vendor/golang.org/x/text/internal/gen/gen.go | |
parent | 3e3eea42c85e3088ac4032e9056f7bd838a50ab4 (diff) | |
download | ydb-b2c749509aee1b26713f88e93aa7c7f7059e31e0.tar.gz |
Update golang.org/x/* deps for import
Diffstat (limited to 'vendor/golang.org/x/text/internal/gen/gen.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/gen/gen.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vendor/golang.org/x/text/internal/gen/gen.go b/vendor/golang.org/x/text/internal/gen/gen.go index faa7092723..78bfef6216 100644 --- a/vendor/golang.org/x/text/internal/gen/gen.go +++ b/vendor/golang.org/x/text/internal/gen/gen.go @@ -277,11 +277,9 @@ func fileToPattern(filename string) string { return fmt.Sprint(prefix, "%s", suffix) } -// tagLines returns the //go:build and // +build lines to add to the file. +// tagLines returns the //go:build lines to add to the file. func tagLines(tags string) string { - newTags := strings.ReplaceAll(tags, ",", " && ") - return "//go:build " + newTags + "\n" + - "// +build " + tags + "\n" + return "//go:build " + strings.ReplaceAll(tags, ",", " && ") + "\n" } func updateBuildTags(pattern string) { @@ -291,7 +289,7 @@ func updateBuildTags(pattern string) { if err != nil { continue } - b = regexp.MustCompile(`((//go:build|// \+build).*\n)+`).ReplaceAll(b, []byte(tagLines(t.buildTags))) + b = regexp.MustCompile(`//go:build.*\n`).ReplaceAll(b, []byte(tagLines(t.buildTags))) err = os.WriteFile(oldFile, b, 0644) if err != nil { log.Fatal(err) |