aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2020-07-11 21:55:46 -0700
committerAndrew G. Morgan <morgan@kernel.org>2020-07-11 21:55:46 -0700
commitae095f0130a0c9780ad8ff560a9106a206179412 (patch)
treedd3554a6a89ca12ff9c89f68dfb7d9425b748f5a /go
parent7434c4e7ef45823df4907d03ad0965db8d058486 (diff)
downloadlibcap-ae095f0130a0c9780ad8ff560a9106a206179412.tar.gz
Use an older Go API for replacing strings
strings.ReplaceAll() needlessly limits the vintage of Go compiler we can support. Use strings.Replace(..., -1) instead. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go')
-rw-r--r--go/mknames.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/go/mknames.go b/go/mknames.go
index 5ae8b3b..b048e10 100644
--- a/go/mknames.go
+++ b/go/mknames.go
@@ -15,7 +15,7 @@ import (
var (
header = flag.String("header", "", "name of header file")
- text = flag.String("textdir", "", "directory name for value txt files")
+ text = flag.String("textdir", "", "directory name for value txt files")
)
func main() {
@@ -68,7 +68,7 @@ const (
if err != nil {
log.Fatalf("filed to read %q: %v", doc, err)
}
- detail := strings.Split(strings.ReplaceAll(string(content), "CAP_", "cap."), "\n")
+ detail := strings.Split(strings.Replace(string(content), "CAP_", "cap.", -1), "\n")
if i != 0 {
fmt.Println()
}