@@ -48,7 +48,7 @@ type Annotation struct {
4848// ErrorNotInGHA is the error returned when a function can only
4949// execute in GitHub Actions, but the current execution
5050// environment is NOT GitHub Actions
51- var ErrorNotInGHA = errors .New ("Not in GitHub Actions" )
51+ var ErrorNotInGHA = errors .New ("not in GitHub Actions" )
5252
5353// New returns a new GitHub Actions Writer
5454func New (out io.Writer ) * GHA {
@@ -76,12 +76,12 @@ func (gha *GHA) EnableGHAOutput() {
7676// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
7777func (gha * GHA ) StartGroup (name string ) {
7878 if ! gha .IsGHA () {
79- gha .println (text .Bold .Sprint (name ))
79+ _ , _ = gha .println (text .Bold .Sprint (name ))
8080 return
8181 }
8282
8383 out := "::group::" + name
84- gha .println (out )
84+ _ , _ = gha .println (out )
8585}
8686
8787// EndGroup ends a GitHub Actions logging group
@@ -91,7 +91,7 @@ func (gha *GHA) EndGroup() {
9191 return
9292 }
9393
94- gha .println ("::endgroup::" )
94+ _ , _ = gha .println ("::endgroup::" )
9595}
9696
9797// SetOutput generates a GitHub Actions output for the current job
@@ -122,7 +122,7 @@ func (gha *GHA) SetJobSummary(content string) error {
122122func (gha * GHA ) appendToFile (fileEnvVar string , content string ) error {
123123 path , exists := os .LookupEnv (fileEnvVar )
124124 if ! gha .IsGHA () || ! exists {
125- return fmt .Errorf ("Unable to set modify GitHub Actions environment file %s: %w" , fileEnvVar , ErrorNotInGHA )
125+ return fmt .Errorf ("unable to set modify GitHub Actions environment file %s: %w" , fileEnvVar , ErrorNotInGHA )
126126 }
127127
128128 // Short cut if no content is provided
@@ -141,7 +141,7 @@ func (gha *GHA) appendToFile(fileEnvVar string, content string) error {
141141 return err
142142 }
143143
144- defer f .Close ()
144+ defer func () { _ = f .Close () } ()
145145
146146 _ , err = f .WriteString (content )
147147 if err != nil {
@@ -199,10 +199,10 @@ func (gha *GHA) newAnnotation(T string, a Annotation) {
199199 // "::error file={name},line={line},endLine={endLine},title={title}::{message}"
200200 // "::error file=app.js,line=1,title=Syntax Error::Missing semicolon"
201201 str := fmt .Sprintf ("::%s %s::%s" , T , strings .Join (attributes , "," ), a .Message )
202- gha .println (str )
202+ _ , _ = gha .println (str )
203203}
204204
205205// println is an internal helper for printing to the expected output io.Writer
206- func (gha * GHA ) println (i ... interface {}) {
207- fmt .Fprintln (gha .outWriter , i ... )
206+ func (gha * GHA ) println (i ... interface {}) ( int , error ) {
207+ return fmt .Fprintln (gha .outWriter , i ... )
208208}
0 commit comments