Skip to content

Commit 166cf67

Browse files
authored
feat: add String() method on Region and Zone [APIGW-1521] (#251)
1 parent f49f929 commit 166cf67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scw/locality.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func (zone *Zone) Exists() bool {
4040
return false
4141
}
4242

43+
// String returns a Zone as a string
44+
func (zone *Zone) String() string {
45+
return string(*zone)
46+
}
47+
4348
// Region is a geographical location
4449
type Region string
4550

@@ -172,3 +177,8 @@ func (region *Region) UnmarshalJSON(input []byte) error {
172177
}
173178
return nil
174179
}
180+
181+
// String returns a Region as a string
182+
func (region *Region) String() string {
183+
return string(*region)
184+
}

0 commit comments

Comments
 (0)