Skip to content

Commit

Permalink
Updates SDK for Go 1.17 (aws#1381)
Browse files Browse the repository at this point in the history
* Updates SDK's `build` tags to use go 1.17's formatting style of `// go:build ...`.
* Updates Makefile's sandbox test statements to use common pattern instead of individually defined.
* Updates CI for Go 1.17.
  • Loading branch information
jasdel authored and jrichardpfs committed Feb 14, 2022
1 parent 8dcf870 commit 6134785
Show file tree
Hide file tree
Showing 120 changed files with 153 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os: [ubuntu-latest]
java-version: ['11', '8']
go-version: [1.16]
go-version: [1.17]
env:
JAVA_TOOL_OPTIONS: "-Xmx2g"
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: [1.16, 1.15]
go-version: [1.17, 1.16, 1.15]
steps:
- uses: actions/checkout@v2

Expand All @@ -34,7 +34,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
go-version: [1.16, 1.15]
go-version: [1.17, 1.16, 1.15]
env:
EACHMODULE_SKIP: "internal\\repotools\\changes"
steps:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/golangci-lint.yml
Expand Up @@ -11,16 +11,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.17.x]
os: [ubuntu-latest] # other options: macos-latest, windows-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version
# Required: the version of golangci-lint is required and must be
# specified without patch version
version: latest
# the following causes golangci-init to do nothing, so all it does is install golang and golangci
# the following causes golangci-init to do nothing, so all it does is
# install golang and golangci
args: --version
# Show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
Expand Down
44 changes: 18 additions & 26 deletions Makefile
Expand Up @@ -442,32 +442,24 @@ sdkv1check:
###################
# Sandbox Testing #
###################
.PHONY: sandbox-tests sandbox-build-go1.15 sandbox-go1.15 sandbox-test-go1.15 sandbox-build-go1.16 \
sandbox-go1.16 sandbox-test-go1.16 sandbox-build-gotip sandbox-gotip sandbox-test-gotip update-aws-golang-tip

sandbox-tests: sandbox-test-go1.15 sandbox-test-go1.16 sandbox-test-gotip

sandbox-build-go1.15:
docker build -f ./internal/awstesting/sandbox/Dockerfile.test.go1.15 -t "aws-sdk-go-v2-1.15" .
sandbox-go1.15: sandbox-build-go1.15
docker run -i -t aws-sdk-go-v2-1.15 bash
sandbox-test-go1.15: sandbox-build-go1.15
docker run -t aws-sdk-go-v2-1.15

sandbox-build-go1.16:
docker build -f ./internal/awstesting/sandbox/Dockerfile.test.go1.16 -t "aws-sdk-go-v2-1.16" .
sandbox-go1.16: sandbox-build-go1.16
docker run -i -t aws-sdk-go-v2-1.16 bash
sandbox-test-go1.16: sandbox-build-go1.16
docker run -t aws-sdk-go-v2-1.16

sandbox-build-gotip:
@echo "Run make update-aws-golang-tip, if this test fails because missing aws-golang:tip container"
docker build -f ./internal/awstesting/sandbox/Dockerfile.test.gotip -t "aws-sdk-go-v2-tip" .
sandbox-gotip: sandbox-build-gotip
docker run -i -t aws-sdk-go-v2-tip bash
sandbox-test-gotip: sandbox-build-gotip
docker run -t aws-sdk-go-v2-tip
.PHONY: sandbox-tests sandbox-build-% sandbox-run-% sandbox-test-% update-aws-golang-tip

sandbox-tests: sandbox-test-go1.15 sandbox-test-go1.16 sandbox-test-go1.17 sandbox-test-gotip

sandbox-build-%:
@# sandbox-build-go1.17
@# sandbox-build-gotip
docker build \
-f ./internal/awstesting/sandbox/Dockerfile.test.$(subst sandbox-build-,,$@) \
-t "aws-sdk-go-$(subst sandbox-build-,,$@)" .
sandbox-run-%: sandbox-build-%
@# sandbox-run-go1.17
@# sandbox-run-gotip
docker run -i -t "aws-sdk-go-$(subst sandbox-run-,,$@)" bash
sandbox-test-%: sandbox-build-%
@# sandbox-test-go1.17
@# sandbox-test-gotip
docker run -t "aws-sdk-go-$(subst sandbox-test-,,$@)"

update-aws-golang-tip:
docker build --no-cache=true -f ./internal/awstesting/sandbox/Dockerfile.golang-tip -t "aws-golang:tip" .
1 change: 1 addition & 0 deletions aws/generate.go
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions aws/logging_generate.go
@@ -1,3 +1,4 @@
//go:build clientlogmode
// +build clientlogmode

package main
Expand Down
1 change: 1 addition & 0 deletions aws/middleware/osname.go
@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16

package middleware
Expand Down
1 change: 1 addition & 0 deletions aws/middleware/osname_go115.go
@@ -1,3 +1,4 @@
//go:build !go1.16
// +build !go1.16

package middleware
Expand Down
1 change: 1 addition & 0 deletions config/codegen/main.go
@@ -1,3 +1,4 @@
//go:build codegen
// +build codegen

package main
Expand Down
1 change: 1 addition & 0 deletions config/shared_config_other_test.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package config
Expand Down
1 change: 1 addition & 0 deletions config/shared_config_windows_test.go
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package config
Expand Down
1 change: 1 addition & 0 deletions credentials/ec2rolecreds/integration_test.go
@@ -1,3 +1,4 @@
//go:build integration && ec2env
// +build integration,ec2env

package ec2rolecreds
Expand Down
1 change: 1 addition & 0 deletions credentials/ssocreds/os.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package ssocreds
Expand Down
1 change: 1 addition & 0 deletions feature/dynamodb/expression/error_test.go
@@ -1,3 +1,4 @@
//go:build go1.7
// +build go1.7

package expression
Expand Down
1 change: 1 addition & 0 deletions feature/ec2/imds/integration_test.go
@@ -1,3 +1,4 @@
//go:build integration && ec2env
// +build integration,ec2env

package imds
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/default_read_seeker_write_to.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package manager
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/default_writer_read_from.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package manager
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/integ_bucket_region_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package manager_test
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/integ_shared_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package manager_test
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/integ_upload_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package manager_test
Expand Down
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package downloader
Expand Down
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package downloader
Expand Down
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package downloader
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/internal/integration/uploader/client.go
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package uploader
Expand Down
1 change: 1 addition & 0 deletions feature/s3/manager/internal/integration/uploader/config.go
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package uploader
Expand Down
@@ -1,3 +1,4 @@
//go:build integration && perftest
// +build integration,perftest

package uploader
Expand Down
12 changes: 12 additions & 0 deletions internal/awstesting/sandbox/Dockerfile.test.go1.17
@@ -0,0 +1,12 @@
FROM golang:1.17

ENV GOPROXY=direct

ADD . /go/src/github.com/aws/aws-sdk-go-v2

RUN apt-get update && apt-get install -y --no-install-recommends \
vim \
&& rm -rf /var/list/apt/lists/*

WORKDIR /go/src/github.com/aws/aws-sdk-go-v2
CMD ["make", "unit"]
1 change: 1 addition & 0 deletions internal/ini/fuzz.go
@@ -1,3 +1,4 @@
//go:build gofuzz
// +build gofuzz

package ini
Expand Down
1 change: 1 addition & 0 deletions internal/ini/fuzz_test.go
@@ -1,3 +1,4 @@
//go:build fuzz
// +build fuzz

// fuzz test data is stored in Amazon S3.
Expand Down
1 change: 1 addition & 0 deletions internal/shareddefaults/shared_config_other_test.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package shareddefaults_test
Expand Down
1 change: 1 addition & 0 deletions internal/shareddefaults/shared_config_windows_test.go
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package shareddefaults_test
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/acm/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package acm
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/apigateway/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package apigateway
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package applicationautoscaling
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package applicationdiscoveryservice
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/appstream/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package appstream
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/athena/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package athena
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/autoscaling/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package autoscaling
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/batch/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package batch
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudformation
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/cloudfront/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudfront
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/cloudhsmv2/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudhsmv2
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/cloudsearch/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudsearch
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/cloudtrail/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudtrail
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/cloudwatch/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cloudwatch
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/codebuild/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package codebuild
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/codecommit/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package codecommit
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/codedeploy/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package codedeploy
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package codepipeline
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/codestar/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package codestar
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package cognitoidentityprovider
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package configservice
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package costandusagereportservice
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package databasemigrationservice
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/devicefarm/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package devicefarm
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package directconnect
Expand Down
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package directoryservice
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/docdb/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package docdb
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/dynamodb/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package dynamodb
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/ec2/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package ec2
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/ecr/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package ecr
Expand Down
1 change: 1 addition & 0 deletions service/internal/integrationtest/ecs/smoke_test.go
@@ -1,3 +1,4 @@
//go:build integration
// +build integration

package ecs
Expand Down

0 comments on commit 6134785

Please sign in to comment.