File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 88 "io/ioutil"
99 "os"
1010 "os/user"
11+ "path/filepath"
1112 "time"
1213)
1314
@@ -45,7 +46,7 @@ func checkDMITable() bool {
4546 continue
4647 }
4748
48- dmiContent , err := ioutil .ReadFile (dmiPath + dmiEntry .Name ())
49+ dmiContent , err := ioutil .ReadFile (filepath . Join ( dmiPath , dmiEntry .Name () ))
4950
5051 if err != nil {
5152 PrintError (err )
@@ -128,11 +129,11 @@ Some virtualization technologies can be detected using /proc/device-tree
128129func checkDeviceTree () bool {
129130 deviceTreeBase := "/proc/device-tree"
130131
131- if DoesFileExist (deviceTreeBase + "/hypervisor/compatible" ) {
132+ if DoesFileExist (filepath . Join ( deviceTreeBase , "/hypervisor/compatible" ) ) {
132133 return true
133134 }
134135
135- if DoesFileExist (deviceTreeBase + "/fw-cfg" ) {
136+ if DoesFileExist (filepath . Join ( deviceTreeBase , "/fw-cfg" ) ) {
136137 return true
137138 }
138139
You can’t perform that action at this time.
0 commit comments