diff --git a/source/cpuid/cpuid.go b/source/cpuid/cpuid.go index c0ef8e9f54..6f290192aa 100644 --- a/source/cpuid/cpuid.go +++ b/source/cpuid/cpuid.go @@ -21,6 +21,7 @@ import "github.com/klauspost/cpuid" // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "cpuid" } // Discover returns feature names for all the supported CPU features. diff --git a/source/fake/fake.go b/source/fake/fake.go index c3d5fa3ccb..ee6056dbbd 100644 --- a/source/fake/fake.go +++ b/source/fake/fake.go @@ -19,8 +19,10 @@ package fake // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "fake" } +// Discover returns feature names for some fake features. func (s Source) Discover() ([]string, error) { features := []string{} @@ -28,4 +30,4 @@ func (s Source) Discover() ([]string, error) { features = append(features, "fakefeature1", "fakefeature2", "fakefeature3") return features, nil -} \ No newline at end of file +} diff --git a/source/network/network.go b/source/network/network.go index 3f1a42cd0c..ad7166774f 100644 --- a/source/network/network.go +++ b/source/network/network.go @@ -19,19 +19,20 @@ package network import ( "bytes" "fmt" + "github.com/golang/glog" "io/ioutil" "net" "strconv" "strings" - "github.com/golang/glog" ) // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "network" } -// returns feature names sriov-configured and sriov if SR-IOV capable NICs are present and/or SR-IOV virtual functions are configured on the node +// Discover returns feature names sriov-configured and sriov if SR-IOV capable NICs are present and/or SR-IOV virtual functions are configured on the node func (s Source) Discover() ([]string, error) { features := []string{} netInterfaces, err := net.Interfaces() diff --git a/source/panic_fake/fake_panic.go b/source/panic_fake/fake_panic.go index 02e4a756dc..d410cc9e73 100644 --- a/source/panic_fake/fake_panic.go +++ b/source/panic_fake/fake_panic.go @@ -19,8 +19,10 @@ package panic_fake // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "panic_fake" } +// Discover calls panic(). func (s Source) Discover() ([]string, error) { panic("fake panic error") } diff --git a/source/pstate/pstate.go b/source/pstate/pstate.go index 969de1951c..5e7de7095b 100644 --- a/source/pstate/pstate.go +++ b/source/pstate/pstate.go @@ -24,6 +24,7 @@ import ( // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "pstate" } // Discover returns feature names for p-state related features such as turbo boost. diff --git a/source/rdt/rdt.go b/source/rdt/rdt.go index a2a0c2078a..4609e6b5cc 100644 --- a/source/rdt/rdt.go +++ b/source/rdt/rdt.go @@ -31,9 +31,10 @@ const ( // Source implements FeatureSource. type Source struct{} +// Name returns an identifier string for this feature source. func (s Source) Name() string { return "rdt" } -// Returns feature names for CMT and CAT if suppported. +// Discover returns feature names for CMT and CAT if suppported. func (s Source) Discover() ([]string, error) { features := []string{}