瀏覽代碼

Fix linting errors and pin linter version in release action

max furman 4 年之前
父節點
當前提交
62690ab52e
共有 4 個文件被更改,包括 7 次插入 和 7 次删除
  1. 1 1
      .github/workflows/release.yml
  2. 1 1
      .github/workflows/test.yml
  3. 4 4
      authority/ssh_test.go
  4. 1 1
      errs/error.go

+ 1 - 1
.github/workflows/release.yml

@@ -33,7 +33,7 @@ jobs:
         uses: golangci/golangci-lint-action@v2
         with:
           # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
-          version: 'latest'
+          version: 'v1.44.0'
 
           # Optional: working directory, useful for monorepos
           # working-directory: somedir

+ 1 - 1
.github/workflows/test.yml

@@ -33,7 +33,7 @@ jobs:
         uses: golangci/golangci-lint-action@v2
         with:
           # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
-          version: 'v1.43.0'
+          version: 'v1.44.0'
 
           # Optional: working directory, useful for monorepos
           # working-directory: somedir

+ 4 - 4
authority/ssh_test.go

@@ -57,7 +57,7 @@ func (m sshTestCertModifier) Modify(cert *ssh.Certificate, opts provisioner.Sign
 	if m == "" {
 		return nil
 	}
-	return fmt.Errorf(string(m))
+	return errors.New(string(m))
 }
 
 type sshTestCertValidator string
@@ -66,7 +66,7 @@ func (v sshTestCertValidator) Valid(crt *ssh.Certificate, opts provisioner.SignS
 	if v == "" {
 		return nil
 	}
-	return fmt.Errorf(string(v))
+	return errors.New(string(v))
 }
 
 type sshTestOptionsValidator string
@@ -75,7 +75,7 @@ func (v sshTestOptionsValidator) Valid(opts provisioner.SignSSHOptions) error {
 	if v == "" {
 		return nil
 	}
-	return fmt.Errorf(string(v))
+	return errors.New(string(v))
 }
 
 type sshTestOptionsModifier string
@@ -84,7 +84,7 @@ func (m sshTestOptionsModifier) Modify(cert *ssh.Certificate, opts provisioner.S
 	if m == "" {
 		return nil
 	}
-	return fmt.Errorf(string(m))
+	return errors.New(string(m))
 }
 
 func TestAuthority_initHostOnly(t *testing.T) {

+ 1 - 1
errs/error.go

@@ -142,7 +142,7 @@ func (e *Error) UnmarshalJSON(data []byte) error {
 		return err
 	}
 	e.Status = er.Status
-	e.Err = fmt.Errorf(er.Message)
+	e.Err = errors.New(er.Message)
 	return nil
 }