Skip to content

Commit a5fb125

Browse files
authored
fix(human): skip capitalize on uuid (#2510)
1 parent 364a689 commit a5fb125

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

β€Žinternal/human/utils.goβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@ package human
22

33
import (
44
"reflect"
5+
"strings"
56
"unicode"
67
)
78

89
// Capitalize returns the given string with a first character in uppercase.
910
func Capitalize(s string) string {
11+
words := strings.Fields(s)
12+
if len(words) > 0 && strings.Contains(words[0], "-") {
13+
// First word is probably an id, don't capitalize
14+
return s
15+
}
16+
1017
for i, c := range s {
1118
return string(unicode.ToUpper(c)) + s[i+1:]
1219
}

β€Žinternal/namespaces/config/testdata/test-config-destroy-command-check-config-file.goldenβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
3-
Scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory
3+
scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory
44
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
55
{
66
"error": "scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory"

β€Žinternal/namespaces/instance/v1/testdata/test-create-server-errors-error-invalid-image-label.goldenβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
3-
Scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)
3+
scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)
44
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
55
{
66
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)"

β€Žinternal/namespaces/instance/v1/testdata/test-create-server-errors-error-invalid-instance-type.goldenβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
3-
Scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)
3+
scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)
44
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
55
{
66
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)"

0 commit comments

Comments
Β (0)