Skip to content

Commit

Permalink
feat: use go 1.19 (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlJi authored Aug 31, 2022
1 parent 4f377e5 commit 6795ec7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e_test_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v2
- name: Go build
Expand All @@ -43,7 +43,7 @@ jobs:
needs: job_1
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x]
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45
version: v1.49

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -96,7 +96,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand All @@ -113,7 +113,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
go-version: 1.19.x
- name: compile and release
run: |
./ci-build.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
# We have generics code, so only 1.18+ can work
go-version: [1.18.x]
go-version: [1.19.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ut_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: go test
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x]
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand Down
16 changes: 8 additions & 8 deletions cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ func init() {
rootCmd.AddCommand(diffCmd)
}

//goc diff --new-profile=./new.cov --base-profile=./base.cov
//+------------------------------------------------------+---------------+--------------+--------+
//| File | Base Coverage | New Coverage | Delta |
//+------------------------------------------------------+---------------+--------------+--------+
//| qiniu.com/kodo/bd/pfd/pfdstg/cursor/mgr.go | 53.5% | 50.5% | -3.0% |
//| qiniu.com/kodo/bd/pfd/pfdstg/svr/getstripe.go | 0.5% | 0.0% | -0.5% |
//| Total | 35.7% | 35.7% | -0.0% |
//+------------------------------------------------------+---------------+--------------+--------+
// goc diff --new-profile=./new.cov --base-profile=./base.cov
// +------------------------------------------------------+---------------+--------------+--------+
// | File | Base Coverage | New Coverage | Delta |
// +------------------------------------------------------+---------------+--------------+--------+
// | qiniu.com/kodo/bd/pfd/pfdstg/cursor/mgr.go | 53.5% | 50.5% | -3.0% |
// | qiniu.com/kodo/bd/pfd/pfdstg/svr/getstripe.go | 0.5% | 0.0% | -0.5% |
// | Total | 35.7% | 35.7% | -0.0% |
// +------------------------------------------------------+---------------+--------------+--------+
func doDiffForLocalProfiles(cmd *cobra.Command, args []string) {
localP, err := cover.ReadFileToCoverList(newProfile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cover/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ type CoverInfo struct {
Singleton bool
}

//Execute inject cover variables for all the .go files in the target folder
// Execute inject cover variables for all the .go files in the target folder
func Execute(coverInfo *CoverInfo) error {
target := coverInfo.Target
newGopath := coverInfo.GoPath
Expand Down
2 changes: 1 addition & 1 deletion pkg/cover/internal/tool/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (f *File) newCounter(start, end token.Pos, numStmt int) string {
// S1
// if cond {
// S2
// }
// }
// S3
//
// counters will be added before S1 and before S3. The block containing S2
Expand Down
2 changes: 1 addition & 1 deletion pkg/cover/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ type ProfileParam struct {
SkipFilePatterns []string `form:"skipfile" json:"skipfile"`
}

//listServices list all the registered services
// listServices list all the registered services
func (s *server) listServices(c *gin.Context) {
services := s.Store.GetAll()
c.JSON(http.StatusOK, services)
Expand Down
3 changes: 2 additions & 1 deletion pkg/prow/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ func (j *Job) RunPeriodic() error {
return nil
}

//trim github filename to profile format:
// trim github filename to profile format:
//
// src/qiniu.com/kodo/io/io/io_svr.go -> qiniu.com/kodo/io/io/io_svr.go
func trimGhFileToProfile(ghFiles []string) (pFiles []string) {
//TODO: need compatible other situation
Expand Down
2 changes: 1 addition & 1 deletion tests/samples/gomod_replace_library/bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package foo

import "fmt"

//Bar fake method
// Bar fake method
func Bar() {
fmt.Println("foo bar")
}

0 comments on commit 6795ec7

Please sign in to comment.