Skip to content

Commit

Permalink
Update Go 1.18 code to match RC 1 (ko-build#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored Mar 2, 2022
1 parent 66bd5fc commit f40d2dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
go-version: '1.17.x'

# Use the installed Go version to download and install the latest 1.18
# beta and replace our existing go with that one.
# release candidate and replace our existing go with that one.
- if: ${{ matrix.go-version == '1.18.x' }}
run: |
go install golang.org/dl/go1.18beta1@latest
go1.18beta1 download
cp $(which go1.18beta1) $(which go)
go install golang.org/dl/go1.18rc1@latest
go1.18rc1 download
cp $(which go1.18rc1) $(which go)
go version
- run: |
Expand Down
9 changes: 5 additions & 4 deletions internal/sbom/mod_1.18.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
package sbom

import (
"fmt"
"runtime/debug"
)

type BuildInfo debug.BuildInfo

func (bi *BuildInfo) UnmarshalText(data []byte) error {
dbi := (*debug.BuildInfo)(bi)
if err := dbi.UnmarshalText(data); err != nil {
return err
dbi, err := debug.ParseBuildInfo(string(data))
if err != nil {
return fmt.Errorf("parsing build info: %w", err)
}
bi = (*BuildInfo)(dbi)
*bi = BuildInfo(*dbi)
return nil
}

0 comments on commit f40d2dc

Please sign in to comment.