From 2adf578b12c49bbdcfe06638e3c403b63b59e877 Mon Sep 17 00:00:00 2001 From: wafuwafu13 Date: Sun, 21 May 2023 18:34:36 +0100 Subject: [PATCH 1/2] fix(go-runtime): use fatih/color instead of ANSI --- .../@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go | 5 +++-- packages/@jsii/go-runtime/jsii-runtime-go/go.mod | 2 ++ packages/@jsii/go-runtime/jsii-runtime-go/go.sum | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go b/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go index d8be02565d..bc23ca1767 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go @@ -9,6 +9,7 @@ import ( "os" "github.com/aws/jsii-runtime-go/internal/compiler" + "github.com/fatih/color" "github.com/mattn/go-isatty" ) @@ -18,7 +19,7 @@ func init() { if tty { // Set terminal to bold red - fmt.Fprintf(os.Stderr, "\u001b[31m\u001b[1m") + color.Set(color.FgRed, color.Bold) } fmt.Fprintln(os.Stderr, "###########################################################") @@ -32,6 +33,6 @@ func init() { if tty { // Reset terminal back to normal - fmt.Fprintf(os.Stderr, "\u001b[0m") + color.Unset() } } diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index 5ebaca792e..61833e3c68 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -12,6 +12,8 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/yuin/goldmark v1.4.13 // indirect golang.org/x/mod v0.10.0 // indirect diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 21ea945ca9..f5cac99357 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -3,6 +3,11 @@ github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYr github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -29,6 +34,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 72167644e53fa10627a2c1643cd8e7f36783bd08 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Mon, 3 Jul 2023 13:40:26 +0100 Subject: [PATCH 2/2] Update go.mod --- packages/@jsii/go-runtime/jsii-runtime-go/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index fe38d4a34f..41fe07daf9 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/Masterminds/semver/v3 v3.2.1 + github.com/fatih/color v1.15.0 github.com/mattn/go-isatty v0.0.19 github.com/stretchr/testify v1.8.4 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 @@ -12,7 +13,6 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.15.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/yuin/goldmark v1.4.13 // indirect