Skip to content

Commit

Permalink
feat: add String() method on Region and Zone [APIGW-1521] (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
loicbourgois authored Nov 25, 2019
1 parent f49f929 commit 166cf67
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scw/locality.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func (zone *Zone) Exists() bool {
return false
}

// String returns a Zone as a string
func (zone *Zone) String() string {
return string(*zone)
}

// Region is a geographical location
type Region string

Expand Down Expand Up @@ -172,3 +177,8 @@ func (region *Region) UnmarshalJSON(input []byte) error {
}
return nil
}

// String returns a Region as a string
func (region *Region) String() string {
return string(*region)
}

0 comments on commit 166cf67

Please sign in to comment.