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 8
8
"io/ioutil"
9
9
"os"
10
10
"os/user"
11
+ "path/filepath"
11
12
"time"
12
13
)
13
14
@@ -45,7 +46,7 @@ func checkDMITable() bool {
45
46
continue
46
47
}
47
48
48
- dmiContent , err := ioutil .ReadFile (dmiPath + dmiEntry .Name ())
49
+ dmiContent , err := ioutil .ReadFile (filepath . Join ( dmiPath , dmiEntry .Name () ))
49
50
50
51
if err != nil {
51
52
PrintError (err )
@@ -128,11 +129,11 @@ Some virtualization technologies can be detected using /proc/device-tree
128
129
func checkDeviceTree () bool {
129
130
deviceTreeBase := "/proc/device-tree"
130
131
131
- if DoesFileExist (deviceTreeBase + "/hypervisor/compatible" ) {
132
+ if DoesFileExist (filepath . Join ( deviceTreeBase , "/hypervisor/compatible" ) ) {
132
133
return true
133
134
}
134
135
135
- if DoesFileExist (deviceTreeBase + "/fw-cfg" ) {
136
+ if DoesFileExist (filepath . Join ( deviceTreeBase , "/fw-cfg" ) ) {
136
137
return true
137
138
}
138
139
You can’t perform that action at this time.
0 commit comments