-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(go): emit deprecation warning when using go1.16 and go1.17
Both go1.16 and go1.17 have reached end-of-life. Customers should upgrade to go1.18 or 1.19. Support for go1.16 and go1.17 will be dropped around late September 2022.
- Loading branch information
1 parent
bf9c142
commit de58d37
Showing
9 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/aws/jsii/go-runtime-test | ||
|
||
go 1.17 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/aws/jsii-runtime-go v0.0.0 | ||
|
22 changes: 22 additions & 0 deletions
22
packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//go:build (go1.16 || go1.17) && !go1.18 | ||
// +build go1.16 go1.17 | ||
// +build !go1.18 | ||
|
||
package jsii | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/aws/jsii-runtime-go/internal/compiler" | ||
) | ||
|
||
// / Emits a deprecation warning message when | ||
func init() { | ||
fmt.Println("###########################################################") | ||
fmt.Printf("# This binary was compiled with %v, which has reached #\n", compiler.Version) | ||
fmt.Printf("# end-of-life on %v. #", compiler.EndOfLifeDate) | ||
fmt.Println("# Support for this version will be dropped in the future. #") | ||
fmt.Println("# #") | ||
fmt.Println("# See https://go.dev/security for more information. #") | ||
fmt.Println("###########################################################") | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.16.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build go1.16 && !go1.17 | ||
// +build go1.16,!go1.17 | ||
|
||
package compiler | ||
|
||
// Version denotes the version of the go compiler that was used for building | ||
// this binary. It is intended for use only in the compiler deprecation warning | ||
// message. | ||
const Version = "go1.16" | ||
|
||
// EndOfLifeDate is the date at which this compiler version reached end-of-life. | ||
const EndOfLifeDate = "2022-03-15" |
12 changes: 12 additions & 0 deletions
12
packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.17.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build go1.17 && !go1.18 | ||
// +build go1.17,!go1.18 | ||
|
||
package compiler | ||
|
||
// Version denotes the version of the go compiler that was used for building | ||
// this binary. It is intended for use only in the compiler deprecation warning | ||
// message. | ||
const Version = "go1.17" | ||
|
||
// EndOfLifeDate is the date at which this compiler version reached end-of-life. | ||
const EndOfLifeDate = "2022-08-02" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters