fix: enable go1.17 github ci/cd (#12997)

This commit is contained in:
Harshavardhana 2021-08-18 18:35:22 -07:00 committed by GitHub
parent c25816eabc
commit 202d0b64eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 82 additions and 29 deletions

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
/*

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build freebsd || openbsd || netbsd
// +build freebsd openbsd netbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build (linux || darwin) && !appengine
// +build linux darwin
// +build !appengine

View File

@ -1,3 +1,4 @@
//go:build darwin || freebsd || openbsd || netbsd
// +build darwin freebsd openbsd netbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux && !appengine
// +build linux,!appengine
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build plan9 || solaris
// +build plan9 solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build (linux && !appengine) || darwin || freebsd || netbsd || openbsd
// +build linux,!appengine darwin freebsd netbsd openbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build fips
// +build fips
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !fips
// +build !fips
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows || darwin || freebsd
// +build windows darwin freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !windows && !darwin && !freebsd
// +build !windows,!darwin,!freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd
// +build linux darwin dragonfly freebsd netbsd openbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -18,10 +18,8 @@
package config
import (
"fmt"
"io/ioutil"
"os"
"runtime"
"testing"
)
@ -155,39 +153,27 @@ M9ofSEt/bdRD
}
defer os.Remove(tempFile5)
nonexistentErr := fmt.Errorf("open nonexistent-file: no such file or directory")
if runtime.GOOS == "windows" {
// Below concatenation is done to get rid of goline error
// "error strings should not be capitalized or end with punctuation or a newline"
nonexistentErr = fmt.Errorf("open nonexistent-file:" + " The system cannot find the file specified.")
}
testCases := []struct {
certFile string
expectedResultLen int
expectedErr error
expectedErr bool
}{
{"nonexistent-file", 0, nonexistentErr},
{tempFile1, 0, fmt.Errorf("Empty public certificate file %s", tempFile1)},
{tempFile2, 0, fmt.Errorf("Could not read PEM block from file %s", tempFile2)},
{tempFile3, 0, fmt.Errorf("asn1: structure error: sequence tag mismatch")},
{tempFile4, 1, nil},
{tempFile5, 2, nil},
{"nonexistent-file", 0, true},
{tempFile1, 0, true},
{tempFile2, 0, true},
{tempFile3, 0, true},
{tempFile4, 1, false},
{tempFile5, 2, false},
}
for _, testCase := range testCases {
certs, err := ParsePublicCertFile(testCase.certFile)
if testCase.expectedErr == nil {
if err != nil {
t.Fatalf("error: expected = <nil>, got = %v", err)
}
} else if err == nil {
t.Fatalf("error: expected = %v, got = <nil>", testCase.expectedErr)
} else if testCase.expectedErr.Error() != err.Error() {
t.Fatalf("error: expected = %v, got = %v", testCase.expectedErr, err)
if !testCase.expectedErr && err != nil {
t.Fatalf("error: expected = <nil>, got = %v", err)
}
if testCase.expectedErr && err == nil {
t.Fatal("error: expected err, got = <nil>")
}
if len(certs) != testCase.expectedResultLen {
t.Fatalf("certs: expected = %v, got = %v", testCase.expectedResultLen, len(certs))
}

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !fips
// +build !fips
package openid

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !fips
// +build !fips
package openid

View File

@ -1,3 +1,4 @@
//go:build linux || netbsd || freebsd
// +build linux netbsd freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !linux && !netbsd && !freebsd && !darwin
// +build !linux,!netbsd,!freebsd,!darwin
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !netbsd && !solaris
// +build !netbsd,!solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build freebsd || netbsd || openbsd || darwin
// +build freebsd netbsd openbsd darwin
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !linux && !netbsd && !freebsd && !darwin && !openbsd
// +build !linux,!netbsd,!freebsd,!darwin,!openbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build darwin || dragonfly
// +build darwin dragonfly
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build freebsd
// +build freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux && !s390x && !arm && !386
// +build linux,!s390x,!arm,!386
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build (linux && arm) || (linux && 386)
// +build linux,arm linux,386
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux && s390x
// +build linux,s390x
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build netbsd
// +build netbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build openbsd
// +build openbsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build solaris
// +build solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build darwin || freebsd || dragonfly || openbsd || solaris
// +build darwin freebsd dragonfly openbsd solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux && !s390x && !arm && !386
// +build linux,!s390x,!arm,!386
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build fips && linux && amd64
// +build fips,linux,amd64
package fips

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build !fips
// +build !fips
package fips

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build fips
// +build fips
package hash

View File

@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build !fips
// +build !fips
package hash

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !linux
// +build !linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || rumprun
// +build linux darwin dragonfly freebsd netbsd openbsd rumprun
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows || plan9 || solaris
// +build windows plan9 solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows || darwin || freebsd
// +build windows darwin freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !windows && !darwin && !freebsd
// +build !windows,!darwin,!freebsd
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !windows && !plan9 && !solaris
// +build !windows,!plan9,!solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build solaris
// +build solaris
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.

View File

@ -1,3 +1,4 @@
//go:build testrunmain
// +build testrunmain
/*