mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-10-21 13:25:07 +02:00
StartsWith -> HasPrefix
This commit is contained in:
committed by
Thomas Gruber
parent
99e066ff5f
commit
ed2378f794
@@ -117,7 +117,7 @@ func (m *GpfsCollector) Init(config json.RawMessage) error {
|
|||||||
|
|
||||||
// when using sudo, the full path of mmpmon must be specified because
|
// when using sudo, the full path of mmpmon must be specified because
|
||||||
// exec.LookPath will not work as mmpmon is not executable as user
|
// exec.LookPath will not work as mmpmon is not executable as user
|
||||||
if m.config.Sudo && !strings.StartsWith(m.config.Mmpmon, "/") {
|
if m.config.Sudo && !strings.HasPrefix(m.config.Mmpmon, "/") {
|
||||||
return fmt.Errorf("when using sudo, mmpmon_path must be provided and an absolute path: %s", m.config.Mmpmon)
|
return fmt.Errorf("when using sudo, mmpmon_path must be provided and an absolute path: %s", m.config.Mmpmon)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user