enable go1.18.x builds (#14746)

This commit is contained in:
Harshavardhana 2022-04-13 14:21:55 -07:00 committed by GitHub
parent eda34423d7
commit 2a6a40e93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 15 deletions

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
go-version: [1.17.x] go-version: [1.17.x, 1.18.x]
os: [ubuntu-latest] os: [ubuntu-latest]
steps: steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2 - uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
go-version: [1.17.x] go-version: [1.17.x, 1.18.x]
os: [ubuntu-latest, windows-latest] os: [ubuntu-latest, windows-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
go-version: [1.17.x] go-version: [1.17.x, 1.18.x]
os: [ubuntu-latest] os: [ubuntu-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -19,7 +19,7 @@ help: ## print this help
getdeps: ## fetch necessary dependencies getdeps: ## fetch necessary dependencies
@mkdir -p ${GOPATH}/bin @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 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 @echo "Installing stringer" && go install -v golang.org/x/tools/cmd/stringer@latest

View File

@ -247,11 +247,11 @@ func (t *transitionState) addLastDayStats(tier string, ts tierStats) {
t.lastDayStats[tier].addStats(ts) t.lastDayStats[tier].addStats(ts)
} }
func (t *transitionState) getDailyAllTierStats() dailyAllTierStats { func (t *transitionState) getDailyAllTierStats() DailyAllTierStats {
t.lastDayMu.RLock() t.lastDayMu.RLock()
defer t.lastDayMu.RUnlock() defer t.lastDayMu.RUnlock()
res := make(dailyAllTierStats, len(t.lastDayStats)) res := make(DailyAllTierStats, len(t.lastDayStats))
for tier, st := range t.lastDayStats { for tier, st := range t.lastDayStats {
res[tier] = st.clone() res[tier] = st.clone()
} }

View File

@ -1719,9 +1719,9 @@ func (sys *NotificationSys) ReloadSiteReplicationConfig(ctx context.Context) []e
} }
// GetLastDayTierStats fetches per-tier stats of the last 24hrs from all peers // 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)) errs := make([]error, len(sys.allPeerClients))
lastDayStats := make([]dailyAllTierStats, len(sys.allPeerClients)) lastDayStats := make([]DailyAllTierStats, len(sys.allPeerClients))
var wg sync.WaitGroup var wg sync.WaitGroup
for index := range sys.peerClients { for index := range sys.peerClients {
if sys.peerClients[index] == nil { if sys.peerClients[index] == nil {

View File

@ -1106,7 +1106,7 @@ func (client *peerRESTClient) ReloadSiteReplicationConfig(ctx context.Context) e
return nil 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 var result map[string]lastDayTierStats
respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1) respBody, err := client.callWithContext(context.Background(), peerRESTMethodGetLastDayTierStats, nil, nil, -1)
if err != nil { if err != nil {
@ -1116,9 +1116,9 @@ func (client *peerRESTClient) GetLastDayTierStats(ctx context.Context) (dailyAll
err = gob.NewDecoder(respBody).Decode(&result) err = gob.NewDecoder(respBody).Decode(&result)
if err != nil { 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 // DevNull - Used by netperf to pump data to peer

View File

@ -84,16 +84,16 @@ func (l lastDayTierStats) merge(m lastDayTierStats) (merged lastDayTierStats) {
return merged return merged
} }
// dailyAllTierStats is used to aggregate last day tier stats across MinIO servers // DailyAllTierStats is used to aggregate last day tier stats across MinIO servers
type dailyAllTierStats map[string]lastDayTierStats type DailyAllTierStats map[string]lastDayTierStats
func (l dailyAllTierStats) merge(m dailyAllTierStats) { func (l DailyAllTierStats) merge(m DailyAllTierStats) {
for tier, st := range m { for tier, st := range m {
l[tier] = l[tier].merge(st) 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 { for i := range tierInfos {
var lst lastDayTierStats var lst lastDayTierStats
var ok bool var ok bool