"Fossies" - the Fresh Open Source Software Archive

Member "buildah-1.27.2/tests/tools/vendor/github.com/butuzov/ireturn/config/allow.go" (20 Sep 2022, 461 Bytes) of package /linux/misc/buildah-1.27.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Go source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package config
    2 
    3 import "github.com/butuzov/ireturn/types"
    4 
    5 // allowConfig specifies a list of interfaces (keywords, patters and regular expressions)
    6 // that are allowed by ireturn as valid to return, any non listed interface are rejected.
    7 type allowConfig struct {
    8     *defaultConfig
    9 }
   10 
   11 func allowAll(patterns []string) *allowConfig {
   12     return &allowConfig{&defaultConfig{List: patterns}}
   13 }
   14 
   15 func (ac *allowConfig) IsValid(i types.IFace) bool {
   16     return ac.Has(i)
   17 }