Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/module-updater/main.go6
-rw-r--r--tools/protoc-gen-gitaly-lint/main.go4
-rw-r--r--tools/protoc-gen-gitaly-protolist/main.go16
3 files changed, 13 insertions, 13 deletions
diff --git a/tools/module-updater/main.go b/tools/module-updater/main.go
index d8cfbda1e..608980d4c 100644
--- a/tools/module-updater/main.go
+++ b/tools/module-updater/main.go
@@ -65,15 +65,15 @@ func changeModuleVersion() error {
}
if err := rewriteImports(moduleAbsRootPath, prev, next); err != nil {
- return fmt.Errorf("re-write go imports: %s", err)
+ return fmt.Errorf("re-write go imports: %w", err)
}
if err := rewriteProto(moduleAbsRootPath, prev, next); err != nil {
- return fmt.Errorf("re-write .proto files: %s", err)
+ return fmt.Errorf("re-write .proto files: %w", err)
}
if err := rewriteGoMod(moduleAbsRootPath, next); err != nil {
- return fmt.Errorf("re-write go.mod file: %s", err)
+ return fmt.Errorf("re-write go.mod file: %w", err)
}
return nil
diff --git a/tools/protoc-gen-gitaly-lint/main.go b/tools/protoc-gen-gitaly-lint/main.go
index 9a1a610c8..25e63527b 100644
--- a/tools/protoc-gen-gitaly-lint/main.go
+++ b/tools/protoc-gen-gitaly-lint/main.go
@@ -96,12 +96,12 @@ func lintProtos(req *pluginpb.CodeGeneratorRequest) error {
// Send back the results.
data, err := proto.Marshal(resp)
if err != nil {
- return fmt.Errorf("failed to marshal output proto: %s", err)
+ return fmt.Errorf("failed to marshal output proto: %w", err)
}
_, err = os.Stdout.Write(data)
if err != nil {
- return fmt.Errorf("failed to write output proto: %s", err)
+ return fmt.Errorf("failed to write output proto: %w", err)
}
return nil
}
diff --git a/tools/protoc-gen-gitaly-protolist/main.go b/tools/protoc-gen-gitaly-protolist/main.go
index 223e555cd..d85c74acd 100644
--- a/tools/protoc-gen-gitaly-protolist/main.go
+++ b/tools/protoc-gen-gitaly-protolist/main.go
@@ -77,12 +77,12 @@ func generateProtolistGo(req *pluginpb.CodeGeneratorRequest) error {
var protoNames []string
if gitalyProtoDir, err = filepath.Abs(gitalyProtoDir); err != nil {
- return fmt.Errorf("failed to get absolute path for %s: %v", gitalyProtoDir, err)
+ return fmt.Errorf("failed to get absolute path for %s: %w", gitalyProtoDir, err)
}
files, err := os.ReadDir(gitalyProtoDir)
if err != nil {
- return fmt.Errorf("failed to read %s: %v", gitalyProtoDir, err)
+ return fmt.Errorf("failed to read %s: %w", gitalyProtoDir, err)
}
for _, fi := range files {
@@ -93,12 +93,12 @@ func generateProtolistGo(req *pluginpb.CodeGeneratorRequest) error {
f, err := os.Create(filepath.Join(gitalypbDir, "protolist.go"))
if err != nil {
- return fmt.Errorf("could not create protolist.go: %v", err)
+ return fmt.Errorf("could not create protolist.go: %w", err)
}
defer f.Close()
if err = renderProtoList(f, protoNames); err != nil {
- return fmt.Errorf("could not render go code: %v", err)
+ return fmt.Errorf("could not render go code: %w", err)
}
return nil
@@ -117,22 +117,22 @@ func renderProtoList(dest io.WriteCloser, protoNames []string) error {
`
protoListTempl, err := template.New("protoList").Funcs(joinFunc).Parse(protoList)
if err != nil {
- return fmt.Errorf("could not create go code template: %v", err)
+ return fmt.Errorf("could not create go code template: %w", err)
}
var rawGo bytes.Buffer
if err := protoListTempl.Execute(&rawGo, protoNames); err != nil {
- return fmt.Errorf("could not execute go code template: %v", err)
+ return fmt.Errorf("could not execute go code template: %w", err)
}
formattedGo, err := format.Source(rawGo.Bytes())
if err != nil {
- return fmt.Errorf("could not format go code: %v", err)
+ return fmt.Errorf("could not format go code: %w", err)
}
if _, err = io.Copy(dest, bytes.NewBuffer(formattedGo)); err != nil {
- return fmt.Errorf("failed to write protolist.go file: %v", err)
+ return fmt.Errorf("failed to write protolist.go file: %w", err)
}
return nil