Skip to content

Commit 3a0bc3f

Browse files
authored
Merge pull request #150 from legendu-net/symlink
Symlink
2 parents bb9ddc7 + 54bb801 commit 3a0bc3f

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ linters:
136136
disabled: true
137137
- name: unused-parameter
138138
- name: unused-receiver
139+
staticcheck:
140+
checks:
141+
- "all"
142+
- "-SA9003"
143+
139144

140145
exclusions:
141146
presets:

cmd/ai/pytorch.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ func pytorch(cmd *cobra.Command, _ []string) {
2222
utils.RunCmd(command)
2323
}
2424
if utils.GetBoolFlag(cmd, "config") {
25-
// nothing to configure
2625
}
2726
if utils.GetBoolFlag(cmd, "uninstall") {
28-
// TODO
2927
}
3028
}
3129

utils/utils.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ fi
967967
// @param paths: Absolute paths to add into PATH.
968968
// @param config_file: The path of a shell's configuration file.
969969
func ConfigShellPath(config_file string) {
970-
if GetLinuxDistId() == "idx" {
970+
if GetLinuxDistID() == "idx" {
971971
return
972972
}
973973
text := ReadFileAsString(config_file)
@@ -1234,11 +1234,11 @@ func IsLinux() bool {
12341234
// if distId == "ubuntu" {
12351235
// fmt.Println("Running on Ubuntu")
12361236
// }
1237-
func GetLinuxDistId() string {
1237+
func GetLinuxDistID() string {
12381238
m := distro.OSRelease()
1239-
distId, found := m["ID"]
1239+
distID, found := m["ID"]
12401240
if found {
1241-
return distId
1241+
return distID
12421242
}
12431243
return ""
12441244
}
@@ -1259,7 +1259,7 @@ func GetLinuxDistId() string {
12591259
// fmt.Println("Not running on Ubuntu")
12601260
// }
12611261
func IsUbuntu() bool {
1262-
return GetLinuxDistId() == "ubuntu"
1262+
return GetLinuxDistID() == "ubuntu"
12631263
}
12641264

12651265
// IsDebian checks if the current Linux distribution is Debian.
@@ -1278,7 +1278,7 @@ func IsUbuntu() bool {
12781278
// fmt.Println("Not running on Debian")
12791279
// }
12801280
func IsDebian() bool {
1281-
return GetLinuxDistId() == "debian"
1281+
return GetLinuxDistID() == "debian"
12821282
}
12831283

12841284
// IsDebianSeries checks if the current Linux distribution belongs to the Debian series.
@@ -1303,9 +1303,9 @@ func IsDebianSeries() bool {
13031303
"antix",
13041304
"lmde",
13051305
}
1306-
distId := GetLinuxDistId()
1306+
distID := GetLinuxDistID()
13071307
for _, id := range ids {
1308-
if distId == id {
1308+
if distID == id {
13091309
return true
13101310
}
13111311
}
@@ -1339,9 +1339,9 @@ func IsDebianUbuntuSeries() bool {
13391339
"lmde",
13401340
"ubuntu", "linuxmint", "pop",
13411341
}
1342-
distId := GetLinuxDistId()
1342+
distID := GetLinuxDistID()
13431343
for _, id := range ids {
1344-
if distId == id {
1344+
if distID == id {
13451345
return true
13461346
}
13471347
}
@@ -1372,7 +1372,7 @@ func IsUbuntuSeries() bool {
13721372
ids := []string{
13731373
"ubuntu", "linuxmint", "pop",
13741374
}
1375-
distId := GetLinuxDistId()
1375+
distId := GetLinuxDistID()
13761376
for _, id := range ids {
13771377
if distId == id {
13781378
return true
@@ -1405,7 +1405,7 @@ func IsFedoraSeries() bool {
14051405
ids := []string{
14061406
"fedora", "centos", "rhel",
14071407
}
1408-
distId := GetLinuxDistId()
1408+
distId := GetLinuxDistID()
14091409
for _, id := range ids {
14101410
if distId == id {
14111411
return true
@@ -1561,11 +1561,11 @@ func UpdateMap(map1 orderedmap.OrderedMap[string, any], map2 orderedmap.OrderedM
15611561
map1.Set(key2, val2)
15621562
continue
15631563
}
1564-
switch val2.(type) {
1564+
switch t2 := val2.(type) {
15651565
case orderedmap.OrderedMap[string, any]:
1566-
switch val1.(type) {
1566+
switch t1 := val1.(type) {
15671567
case orderedmap.OrderedMap[string, any]:
1568-
UpdateMap(val1.(orderedmap.OrderedMap[string, any]), val2.(orderedmap.OrderedMap[string, any]))
1568+
UpdateMap(t1, t2)
15691569
default:
15701570
map1.Set(key2, val2)
15711571
}

0 commit comments

Comments
 (0)