967967// @param paths: Absolute paths to add into PATH.
968968// @param config_file: The path of a shell's configuration file.
969969func 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// }
12611261func 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// }
12801280func 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