question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

met issue with golang 1.18 standard package strings.Cut

See original GitHub issue

Description: I used strings.Cut in my project and our go.mod already updated to golang 1.18.2 and I update actions/setup-go with go-version1.19, but there are some errors. Now I update them to golang 1.19 and still met these errors

Action version: actions/setup-go@v3 actions/checkout@v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          persist-credentials: false
          ref: ${{ needs.filter_changes.outputs.ref }}

      - name: Install Go
        uses: actions/setup-go@v3
        with:
          go-version: '1.19.0'

      - name: Checkout ENV go version
        run: go version

      # ==run unitest. I use ginkgo -v 
      - name: Run unitest
        id: unitest
        continue-on-error: true
        run: |
          sudo make unitest-tests 

Log

coverage: [no statements]
Failed to compile cmd:

# github.com/spidernet-io/spiderpool/pkg/workloadendpointmanager
Error: ../../../pkg/workloadendpointmanager/workloadendpoint_manager.go:292:16: undefined: strings.Cut
Error: ../../../pkg/workloadendpointmanager/workloadendpoint_manager.go:336:25: undefined: strings.Cut
Error: ../../../pkg/workloadendpointmanager/workloadendpoint_manager.go:341:25: undefined: strings.Cut
note: module requires Go 1.19

composite coverage: 85.1% of statements
exit status 1

make: *** [Makefile:268: unitest-tests] Error 1
Ginkgo ran 4 suites in 1m15.916056532s

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
e-korolevskiicommented, Aug 17, 2022

Hello @Icarus9913!

Have you already tried the workarounds suggested in this issue? Did they not work for you? Could you provide a workflow with errors?

1reaction
Icarus9913commented, Aug 11, 2022

Got it! Resolved! Thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Go 1.18: Cut added to strings/bytes - DEV Community ‍ ‍
This article brings the Cut function added to strings and bytes package as a topic. The Cut function is described like this in...
Read more >
Go 1.18 Release Notes - The Go Programming Language
Introduction to Go 1.18. The latest Go release, version 1.18, is a significant release, including changes to the language, implementation of the toolchain, ......
Read more >
Commonlibs - Go Packages
package module ... A helper module using Golang 1.18 generics. ... func Md5(in string) string; func Reduce(input []T, initial K, f func(K, ...
Read more >
Go Playground - The Go Programming Language
The only communication a playground program has to the outside world is by writing to standard output and standard error. In the playground...
Read more >
Go 1.8 Release Notes - The Go Programming Language
Introduction to Go 1.8; Changes to the language; Ports: Known Issues ... into the standard library, Go 1.8 adds more context support to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found