Skip to content

Commit f836184

Browse files
committed
pkg/uuid: remove ToString
The function was added with the introduction of pkg/uuid back in 2021, but it has never done anything useful; it takes a string and returns the same string, entirely unchanged and without any side effect. A search on github.com for `uuid tostring language:cue` returns zero results, even though there are >100 hits for CUE files importing "uuid", which makes sense given that the function does nothing useful. One possible answer could have been symmetry with ToInt, however there's also FromInt and yet no FromString. Another possibility would have been as a parser or validator of UUIDs, but that's what Parse and Valid already do. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Iaf671c1a5054962fb584295196de4a2797613200 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213297 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent d9da212 commit f836184

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

Diff for: pkg/uuid/pkg.go

-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pkg/uuid/uuid.go

-7
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ func Parse(s string) (string, error) {
3838
return x.String(), err
3939
}
4040

41-
// TODO(mvdan): what is ToString meant to do? it appears like a no-op?
42-
43-
// String represents a 128-bit UUID value as a string.
44-
func ToString(x string) string {
45-
return x
46-
}
47-
4841
// URN reports the canonical URN of a UUID.
4942
func URN(x string) (string, error) {
5043
u, err := uuid.Parse(x)

0 commit comments

Comments
 (0)