diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index fc43cfece..0528aa889 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.17.x] + go-version: [1.17.x, 1.18.x] os: [ubuntu-latest] steps: - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 4c9da0ce0..22629a5b2 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.17.x] + go-version: [1.17.x, 1.18.x] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3aa0158bc..65fc52493 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.17.x] + go-version: [1.17.x, 1.18.x] os: [ubuntu-latest] steps: - uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index ad7171699..ad3c8b493 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ help: ## print this help getdeps: ## fetch necessary dependencies @mkdir -p ${GOPATH}/bin - @echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.43.0 + @echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.45.2 @echo "Installing msgp" && go install -v github.com/tinylib/msgp@v1.1.7-0.20211026165309-e818a1881b0e @echo "Installing stringer" && go install -v golang.org/x/tools/cmd/stringer@latest diff --git a/cmd/bucket-lifecycle.go b/cmd/bucket-lifecycle.go index 580c948c7..4a8ec93cd 100644 --- a/cmd/bucket-lifecycle.go +++ b/cmd/bucket-lifecycle.go @@ -247,11 +247,11 @@ func (t *transitionState) addLastDayStats(tier string, ts tierStats) { t.lastDayStats[tier].addStats(ts) } -func (t *transitionState) getDailyAllTierStats() dailyAllTierStats { +func (t *transitionState) getDailyAllTierStats() DailyAllTierStats { t.lastDayMu.RLock() defer t.lastDayMu.RUnlock() - res := make(dailyAllTierStats, len(t.lastDayStats)) + res := make(DailyAllTierStats, len(t.lastDayStats)) for tier, st := range t.lastDayStats { res[tier] = st.clone() } diff --git a/cmd/notification.go b/cmd/notification.go index 13a2e9618..5f1ba6e51 100644 --- a/cmd/notification.go +++ b/cmd/notification.go @@ -1719,9 +1719,9 @@ func (sys *NotificationSys) ReloadSiteReplicationConfig(ctx context.Context) []e } // GetLastDayTierStats fetches per-tier stats of the last 24hrs from all peers -func (sys *NotificationSys) GetLastDayTierStats(ctx context.Context) dailyAllTierStats { +func (sys *NotificationSys) GetLastDayTierStats(ctx context.Context) DailyAllTierStats { errs := make([]error, len(sys.allPeerClients)) - lastDayStats := make([]dailyAllTierStats, len(sys.allPeerClients)) + lastDayStats := make([]DailyAllTierStats, len(sys.allPeerClients)) var wg sync.WaitGroup for index := range sys.peerClients { if sys.peerClients[index] == nil { diff --git a/cmd/peer-rest-client.go b/cmd/peer-rest-client.go index 89b395b9c..75d77b0b7 100644 --- a/cmd/peer-rest-client.go +++ b/cmd/peer-rest-client.go @@ -1106,7 +1106,7 @@ func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) e return nil } -func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAllTierStats, error) { +func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (DailyAllTierStats, error) { var result map[string]lastDayTierStats respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1) if err != nil { @@ -1116,9 +1116,9 @@ func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAll err = gob.NewDecoder(respBody).Decode(&result) if err != nil { - return dailyAllTierStats{}, err + return DailyAllTierStats{}, err } - return dailyAllTierStats(result), nil + return DailyAllTierStats(result), nil } // DevNull - Used by netperf to pump data to peer diff --git a/cmd/tier-last-day-stats.go b/cmd/tier-last-day-stats.go index 186d27dc4..cc8b1cbb4 100644 --- a/cmd/tier-last-day-stats.go +++ b/cmd/tier-last-day-stats.go @@ -84,16 +84,16 @@ func (l lastDayTierStats) merge(m lastDayTierStats) (merged lastDayTierStats) { return merged } -// dailyAllTierStats is used to aggregate last day tier stats across MinIO servers -type dailyAllTierStats map[string]lastDayTierStats +// DailyAllTierStats is used to aggregate last day tier stats across MinIO servers +type DailyAllTierStats map[string]lastDayTierStats -func (l dailyAllTierStats) merge(m dailyAllTierStats) { +func (l DailyAllTierStats) merge(m DailyAllTierStats) { for tier, st := range m { l[tier] = l[tier].merge(st) } } -func (l dailyAllTierStats) addToTierInfo(tierInfos []madmin.TierInfo) []madmin.TierInfo { +func (l DailyAllTierStats) addToTierInfo(tierInfos []madmin.TierInfo) []madmin.TierInfo { for i := range tierInfos { var lst lastDayTierStats var ok bool