Skip to content

Commit

Permalink
Merge branch 'master' into fixLang
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpect authored Oct 6, 2024
2 parents e083429 + 697eba9 commit cb37867
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read

jobs:
golangci:
strategy:
matrix:
go: [stable]
os: [ubuntu-latest, macos-latest, windows-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
38 changes: 19 additions & 19 deletions pkg/staging/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ func copy(src llb.State, srcPath string, dest llb.State, destPath string) llb.St
}))
}

func copyForStates(src llb.State, dst llb.State, srcpaths []string, dstpath string) llb.State {
return dst.With(
copyMultiple(src, srcpaths, dstpath),
)
}

func copyMultiple(src llb.State, srcPaths []string, destPath string) llb.StateOption {
var stateOptions []llb.StateOption
for _, srcPath := range srcPaths {
stateOptions = append(stateOptions, copyFrom(src, srcPath, destPath))
}

return func(s llb.State) llb.State {
for _, stateOption := range stateOptions {
s = stateOption(s)
}
return s
}
}
// Functions which might be useful later, left as comments here :
// func copyForStates(src llb.State, dst llb.State, srcpaths []string, dstpath string) llb.State {
// return dst.With(
// copyMultiple(src, srcpaths, dstpath),
// )
// }

// func copyMultiple(src llb.State, srcPaths []string, destPath string) llb.StateOption {
// var stateOptions []llb.StateOption
// for _, srcPath := range srcPaths {
// stateOptions = append(stateOptions, copyFrom(src, srcPath, destPath))
// }
// return func(s llb.State) llb.State {
// for _, stateOption := range stateOptions {
// s = stateOption(s)
// }
// return s
// }
// }

0 comments on commit cb37867

Please sign in to comment.