瀏覽代碼

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
 // 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 {
 	return homeShortCut
 }

+ 1 - 1
pkg/homedir/homedir_test.go

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