Go 1.16 release notes announced the deprecation of io/ioutil [1]. It's easy
for us to move to use what is was recommended so just do it.
[1] https://golang.org/doc/go1.16#ioutil
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Doing strings.Split with a non-empty separator against a potentially
empty string (hint.NUMAs) may return an empty string in a slice of
size one, which then doesn't parse nicely with ParseInt and results
in a repeating warning.
It is better to check for hint.NUMAs emptiness before trying to
split it.
Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
Moved part of the code from NewTopologyHints to getTopologyHint to
decrease cyclomatic complexity.
This should fix this failure:
$ make checks
Complexity is over 15 in
20 topology NewTopologyHints pkg/topology/topology.go:83:1
Makefile:23: recipe for target 'cyclomatic-check' failed
make: *** [cyclomatic-check] Error 1
Fixed the following golint warnings:
$ make checks
./pkg/topology/topology.go:44:6: type name will be used as topology.TopologyHint by other packages, and that stutters; consider calling this Hint
./pkg/topology/topology.go:52:6: type name will be used as topology.TopologyHints by other packages, and that stutters; consider calling this Hints
Found 2 lint suggestions; failing.
Makefile:47: recipe for target 'lint' failed