-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempt to do a better job passing plugin-specific override information
- Loading branch information
1 parent
9c7d17d
commit bcbe477
Showing
8 changed files
with
373 additions
and
309 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1 @@ | ||
package config | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
type GoType struct { | ||
Path string `json:"import" yaml:"import"` | ||
Package string `json:"package" yaml:"package"` | ||
Name string `json:"type" yaml:"type"` | ||
Pointer bool `json:"pointer" yaml:"pointer"` | ||
Slice bool `json:"slice" yaml:"slice"` | ||
Spec string | ||
BuiltIn bool | ||
} | ||
|
||
func (o *GoType) UnmarshalJSON(data []byte) error { | ||
var spec string | ||
if err := json.Unmarshal(data, &spec); err == nil { | ||
*o = GoType{Spec: spec} | ||
return nil | ||
} | ||
type alias GoType | ||
var a alias | ||
if err := json.Unmarshal(data, &a); err != nil { | ||
return err | ||
} | ||
*o = GoType(a) | ||
return nil | ||
} | ||
|
||
func (o *GoType) UnmarshalYAML(unmarshal func(interface{}) error) error { | ||
var spec string | ||
if err := unmarshal(&spec); err == nil { | ||
*o = GoType{Spec: spec} | ||
return nil | ||
} | ||
type alias GoType | ||
var a alias | ||
if err := unmarshal(&a); err != nil { | ||
return err | ||
} | ||
*o = GoType(a) | ||
return nil | ||
} |
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
Oops, something went wrong.