Replies: 2 comments
-
I was able to get it working by using importing "io/ioutil" During this incremental process, I had to change a couple of files. For example here's how my go/src/github.com/prometheus/snmp_exporter/config/config.go change looks package config
import (
"fmt"
"regexp"
"time"
"io/ioutil"
"github.com/gosnmp/gosnmp"
"gopkg.in/yaml.v2"
)
func LoadFile(filename string) (*Config, error) {
content, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
cfg := &Config{}
err = yaml.UnmarshalStrict(content, cfg)
if err != nil {
return nil, err
}
return cfg, nil
} Before taking this route, I would suggest checking the installed This discussion may also help go-critic/go-critic#1019 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
can some one help on the below error
root@prometheus:~# go get github.com/prometheus/snmp_exporter/generator
github.com/prometheus/snmp_exporter/config
go/src/github.com/prometheus/snmp_exporter/config/config.go:27:18: undefined: os.ReadFile
root@prometheus:~#
Beta Was this translation helpful? Give feedback.
All reactions