I'm translating a tool originally written in C++ to Go using VS Code, but the Go linter doesn't like my stack declaration.
I've imported the stack collection per the Go documentation and I think my go workspace directory hierarchy is correct.
-go (workspace)
-bin
-pkg
-darwin_amd64
-github.com
-golang-collections
-collections
-stack.a
-src
-github.com
-golang-collections
-collections
-stack
stack.go
stack_test.go
-zwnewsom
-verifier
main.go
package main
import (
"C"
"github.com/golang-collections/collections/stack"
)
type Item struct {
key int
value int
//sum int
sum float64
numerator int64
denominator int64
exponent float64
status Status
promoteItems := stack.New()
}
the 'New()' function should return a pointer to a stack but the VS Code Go linter gives me a yellow squiggly under ':= stack.New()' with an error saying "expected ';', found ':='" which is doubly confusing since I was under the impression that Go doesn't use semicolons to terminate lines.