-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👔 update: update some goutil package import, replace pkg name
- Loading branch information
Showing
10 changed files
with
116 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package comdef | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
) | ||
|
||
// ByteStringWriter interface | ||
type ByteStringWriter interface { | ||
io.Writer | ||
io.ByteWriter | ||
io.StringWriter | ||
fmt.Stringer | ||
} | ||
|
||
// StringWriteStringer interface | ||
type StringWriteStringer interface { | ||
io.StringWriter | ||
fmt.Stringer | ||
} | ||
|
||
// Int64able interface | ||
type Int64able interface { | ||
Int64() (int64, error) | ||
} | ||
|
||
// | ||
// | ||
// Matcher type | ||
// | ||
// | ||
|
||
// Matcher interface | ||
type Matcher[T any] interface { | ||
Match(s T) bool | ||
} | ||
|
||
// MatchFunc definition. implements Matcher interface | ||
type MatchFunc[T any] func(v T) bool | ||
|
||
// Match satisfies the Matcher interface | ||
func (fn MatchFunc[T]) Match(v T) bool { | ||
return fn(v) | ||
} | ||
|
||
// StringMatcher interface | ||
type StringMatcher interface { | ||
Match(s string) bool | ||
} | ||
|
||
// StringMatchFunc definition | ||
type StringMatchFunc func(s string) bool | ||
|
||
// Match satisfies the StringMatcher interface | ||
func (fn StringMatchFunc) Match(s string) bool { | ||
return fn(s) | ||
} | ||
|
||
// StringHandler interface | ||
type StringHandler interface { | ||
Handle(s string) string | ||
} | ||
|
||
// StringHandleFunc definition | ||
type StringHandleFunc func(s string) string | ||
|
||
// Handle satisfies the StringHandler interface | ||
func (fn StringHandleFunc) Handle(s string) string { | ||
return fn(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters