tests: add sample

This commit is contained in:
Fernandez Ludovic 2025-11-21 03:31:08 +01:00
parent 161a55b8c4
commit 50132d86ac
8 changed files with 116 additions and 0 deletions

3
sample-monorepo/a/go.mod Normal file
View file

@ -0,0 +1,3 @@
module github.com/golangci/actiona
go 1.24.0

View 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")
}

View file

@ -0,0 +1,3 @@
module github.com/golangci/actiona/suba
go 1.24.0

View 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
View file

@ -0,0 +1,3 @@
module github.com/golangci/actionb
go 1.24.0

View 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
View file

@ -0,0 +1,3 @@
module github.com/golangci/actionc
go 1.24.0

View 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")
}