mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-03 18:30:20 +00:00
auto adjust code
This commit is contained in:
@@ -3,16 +3,16 @@ package workflowpattern
|
||||
import "fmt"
|
||||
|
||||
type TraceWriter interface {
|
||||
Info(string, ...interface{})
|
||||
Info(string, ...any)
|
||||
}
|
||||
|
||||
type EmptyTraceWriter struct{}
|
||||
|
||||
func (*EmptyTraceWriter) Info(string, ...interface{}) {
|
||||
func (*EmptyTraceWriter) Info(string, ...any) {
|
||||
}
|
||||
|
||||
type StdOutTraceWriter struct{}
|
||||
|
||||
func (*StdOutTraceWriter) Info(format string, args ...interface{}) {
|
||||
func (*StdOutTraceWriter) Info(format string, args ...any) {
|
||||
fmt.Printf(format+"\n", args...)
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ func PatternToRegex(pattern string) (string, error) {
|
||||
if errorMessage.Len() > 0 {
|
||||
errorMessage.WriteString(", ")
|
||||
}
|
||||
errorMessage.WriteString(fmt.Sprintf("Position: %d Error: %s", position, err))
|
||||
fmt.Fprintf(&errorMessage, "Position: %d Error: %s", position, err)
|
||||
}
|
||||
return "", fmt.Errorf("invalid Pattern '%s': %s", pattern, errorMessage.String())
|
||||
}
|
||||
|
||||
@@ -407,8 +407,8 @@ func TestMatchPattern(t *testing.T) {
|
||||
patterns, err := CompilePatterns(kase.patterns...)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, kase.skipResult, Skip(patterns, kase.inputs, &StdOutTraceWriter{}), "skipResult")
|
||||
assert.EqualValues(t, kase.filterResult, Filter(patterns, kase.inputs, &StdOutTraceWriter{}), "filterResult")
|
||||
assert.Equal(t, kase.skipResult, Skip(patterns, kase.inputs, &StdOutTraceWriter{}), "skipResult")
|
||||
assert.Equal(t, kase.filterResult, Filter(patterns, kase.inputs, &StdOutTraceWriter{}), "filterResult")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user