Skip to content

Commit

Permalink
Update vendoring and tooling
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
  • Loading branch information
mjtrangoni committed Oct 15, 2020
1 parent c2f87c6 commit cf15ef0
Show file tree
Hide file tree
Showing 9 changed files with 357 additions and 30 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ linters:
- goimports
- goerr113
- unparam
- nlreturn

run:
skip-dirs:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ os: linux
language: go

go:
- 1.13.x
- 1.14.x
- 1.15.x
- tip

before_install:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GO ?= GO111MODULE=on go
GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
PROMU ?= $(GOPATH)/bin/promu
GOLINTER ?= $(GOPATH)/bin/golangci-lint
GO_VERSION ?= 1.14.2
GO_VERSION ?= 1.15.3
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
TARGET ?= flexlm_exporter
DOCKER_IMAGE_NAME ?= mjtrangoni/flexlm_exporter
Expand Down Expand Up @@ -84,4 +84,4 @@ crossbuild: promu
$(GOPATH)/bin/golangci-lint lint:
@GOOS=$(shell uname -s | tr A-Z a-z) \
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
$(GO) get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.29.0
$(GO) get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0
3 changes: 1 addition & 2 deletions collector/lmstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ package collector
import (
"fmt"

"github.com/prometheus/client_golang/prometheus"

"github.com/mjtrangoni/flexlm_exporter/config"
"github.com/prometheus/client_golang/prometheus"
)

type lmstatCollector struct {
Expand Down
1 change: 1 addition & 0 deletions collector/lmstat_feature_exp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func (c *lmstatFeatureExpCollector) collect(licenses *config.License, ch chan<-
if licenses.FeaturesToExclude != "" && licenses.FeaturesToInclude != "" {
log.Fatalln("%v: can not define `features_to_include` and "+
"`features_to_exclude` at the same time", licenses.Name)

return nil
} else if licenses.FeaturesToExclude != "" {
featuresToExclude = strings.Split(licenses.FeaturesToExclude, ",")
Expand Down
4 changes: 2 additions & 2 deletions collector/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ var (
lmutilLicenseFeatureGroupReservRegex = regexp.MustCompile(
`^(\s+|)(?P<reservation>\d+)\s+\w+\s+for\s+(HOST_GROUP|GROUP)\s+` +
`(?P<group>\w+).*$`)
// lmutil lmstat -c port@hostname -i
// lmutil lmstat -c port@hostname -i.
lmutilLicenseFeatureExpRegex = regexp.MustCompile(
`^(?P<feature>[[:graph:]]+)\s+(?P<version>[\d\.]+)\s+` +
`(?P<licenses>\d+)\s+(?P<expires>[\w\-]+)\s+(?P<vendor>\w+)$`)
// lmutil lmstat -c port@hostname -i case with columns expired and vendors
// switched #28
// switched #28.
lmutilLicenseFeatureExpRegex2 = regexp.MustCompile(
`^(?P<feature>[[:graph:]]+)\s+(?P<version>[\d\.]+)\s+` +
`(?P<licenses>\d+)\s+(?P<vendor>\w+)\s+(?P<expires>[\w\-\s\(\)]+)$`)
Expand Down
5 changes: 2 additions & 3 deletions flexlm_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ import (
"fmt"
"net/http"

"github.com/mjtrangoni/flexlm_exporter/collector"
"github.com/mjtrangoni/flexlm_exporter/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"
"gopkg.in/alecthomas/kingpin.v2"

"github.com/mjtrangoni/flexlm_exporter/collector"
"github.com/mjtrangoni/flexlm_exporter/config"
)

func init() {
Expand Down
13 changes: 5 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ module github.com/mjtrangoni/flexlm_exporter
go 1.13

require (
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/golang/protobuf v1.3.4 // indirect
github.com/google/go-cmp v0.5.0 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/prometheus/client_golang v1.5.0
github.com/prometheus/common v0.9.1
github.com/prometheus/procfs v0.0.10 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/common v0.14.0
github.com/stretchr/testify v1.6.1 // indirect
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
Expand Down
354 changes: 342 additions & 12 deletions go.sum

Large diffs are not rendered by default.

0 comments on commit cf15ef0

Please sign in to comment.