mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-12 14:01:14 +00:00
tests: add sample
This commit is contained in:
parent
161a55b8c4
commit
50132d86ac
8 changed files with 116 additions and 0 deletions
3
sample-monorepo/a/go.mod
Normal file
3
sample-monorepo/a/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/golangci/actiona
|
||||
|
||||
go 1.24.0
|
||||
26
sample-monorepo/a/sample.go
Normal file
26
sample-monorepo/a/sample.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Package sample is used as test input for golangci action.
|
||||
package sample
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Hash~
|
||||
func Hash(data string) string {
|
||||
retError()
|
||||
retError2()
|
||||
|
||||
h := md5.New()
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
func retError() error {
|
||||
return errors.New("err")
|
||||
}
|
||||
|
||||
func retError2() error {
|
||||
return errors.New("err2")
|
||||
}
|
||||
3
sample-monorepo/a/suba/go.mod
Normal file
3
sample-monorepo/a/suba/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/golangci/actiona/suba
|
||||
|
||||
go 1.24.0
|
||||
26
sample-monorepo/a/suba/sample.go
Normal file
26
sample-monorepo/a/suba/sample.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Package sample is used as test input for golangci action.
|
||||
package sample
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Hash~
|
||||
func Hash(data string) string {
|
||||
retError()
|
||||
retError2()
|
||||
|
||||
h := md5.New()
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
func retError() error {
|
||||
return errors.New("err")
|
||||
}
|
||||
|
||||
func retError2() error {
|
||||
return errors.New("err2")
|
||||
}
|
||||
3
sample-monorepo/b/go.mod
Normal file
3
sample-monorepo/b/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/golangci/actionb
|
||||
|
||||
go 1.24.0
|
||||
26
sample-monorepo/b/sample.go
Normal file
26
sample-monorepo/b/sample.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Package sample is used as test input for golangci action.
|
||||
package sample
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Hash~
|
||||
func Hash(data string) string {
|
||||
retError()
|
||||
retError2()
|
||||
|
||||
h := md5.New()
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
func retError() error {
|
||||
return errors.New("err")
|
||||
}
|
||||
|
||||
func retError2() error {
|
||||
return errors.New("err2")
|
||||
}
|
||||
3
sample-monorepo/c/go.mod
Normal file
3
sample-monorepo/c/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module github.com/golangci/actionc
|
||||
|
||||
go 1.24.0
|
||||
26
sample-monorepo/c/sample.go
Normal file
26
sample-monorepo/c/sample.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Package sample is used as test input for golangci action.
|
||||
package sample
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Hash~
|
||||
func Hash(data string) string {
|
||||
retError()
|
||||
retError2()
|
||||
|
||||
h := md5.New()
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
func retError() error {
|
||||
return errors.New("err")
|
||||
}
|
||||
|
||||
func retError2() error {
|
||||
return errors.New("err2")
|
||||
}
|
||||
Loading…
Reference in a new issue