Переглянути джерело

pkg/homedir: deprecate GetShortcutString() utility

This function was last used in the pkg/mflag package, which was removed
in 14712f9ff0d20a3b64a60103608b8cc998909242, and is no longer used in
libnetwork code since https://github.com/moby/libnetwork/commit/e6de8aec2fc3cea888f620de490fc6ab83700878

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 роки тому
батько
коміт
ddd9665289
2 змінених файлів з 3 додано та 1 видалено
  1. 2 0
      pkg/homedir/homedir.go
  2. 1 1
      pkg/homedir/homedir_test.go

+ 2 - 0
pkg/homedir/homedir.go

@@ -35,6 +35,8 @@ func Get() string {
 
 
 // GetShortcutString returns the string that is shortcut to user's home directory
 // GetShortcutString returns the string that is shortcut to user's home directory
 // in the native shell of the platform running on.
 // in the native shell of the platform running on.
+//
+// Deprecated: this function is no longer used, and will be removed in the next release.
 func GetShortcutString() string {
 func GetShortcutString() string {
 	return homeShortCut
 	return homeShortCut
 }
 }

+ 1 - 1
pkg/homedir/homedir_test.go

@@ -17,7 +17,7 @@ func TestGet(t *testing.T) {
 }
 }
 
 
 func TestGetShortcutString(t *testing.T) {
 func TestGetShortcutString(t *testing.T) {
-	shortcut := GetShortcutString()
+	shortcut := GetShortcutString() //nolint:staticcheck // ignore SA1019 (GetShortcutString is deprecated)
 	if shortcut == "" {
 	if shortcut == "" {
 		t.Fatal("returned shortcut string is empty")
 		t.Fatal("returned shortcut string is empty")
 	}
 	}