Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GoReportCard metrics, both gofmt and golint #90

Merged
merged 2 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions source/cpuid/cpuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion source/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ 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{}

// Adding three fake features.
features = append(features, "fakefeature1", "fakefeature2", "fakefeature3")

return features, nil
}
}
5 changes: 3 additions & 2 deletions source/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions source/panic_fake/fake_panic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
1 change: 1 addition & 0 deletions source/pstate/pstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion source/rdt/rdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down