Chore: support MarshalYAML to some config filed (#581)

This commit is contained in:
Kaming Chan
2020-03-15 19:40:39 +08:00
committed by GitHub
parent 9471d80785
commit 082847b403
3 changed files with 12 additions and 3 deletions

View File

@ -51,6 +51,11 @@ func (m TunnelMode) MarshalJSON() ([]byte, error) {
return json.Marshal(m.String())
}
// MarshalYAML serialize TunnelMode with yaml
func (m TunnelMode) MarshalYAML() (interface{}, error) {
return m.String(), nil
}
func (m TunnelMode) String() string {
switch m {
case Global: