Chris
Chris
CCoder.com
Created by Chris on 3/13/2024 in #help
Using the golang codersdk
Here is my program:
package main

import (
"fmt"
"net/url"

"github.com/coder/coder/v2/codersdk"
)

const coderHost = "http://devspaces.us-west-1.elasticbeanstalk.com"

func main() {
client := codersdk.New(&url.URL{Scheme: "https", Host: coderHost})
res, err := client.BuildInfo()
if err != nil {
fmt.Println("Error: ", err)
return
}
fmt.Println("Response: ", res)
}
package main

import (
"fmt"
"net/url"

"github.com/coder/coder/v2/codersdk"
)

const coderHost = "http://devspaces.us-west-1.elasticbeanstalk.com"

func main() {
client := codersdk.New(&url.URL{Scheme: "https", Host: coderHost})
res, err := client.BuildInfo()
if err != nil {
fmt.Println("Error: ", err)
return
}
fmt.Println("Response: ", res)
}
When I try to build this program, I get the following error:
# gvisor.dev/gvisor/pkg/sync
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/gate_unsafe.go:114:3: undefined: goready
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/gate_unsafe.go:144:2: undefined: gopark
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:76:3: undefined: semacquire
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:102:4: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:152:3: undefined: semacquire
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:179:3: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:207:3: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/seqcount.go:87:6: undefined: canSpin
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/seqcount.go:89:4: undefined: doSpin
# tailscale.com/net/tsaddr
../go/pkg/mod/[email protected]/net/tsaddr/tsaddr.go:255:21: type func(ri netip.Prefix, rj netip.Prefix) bool of func(ri, rj netip.Prefix) bool {…} does not match inferred type func(a netip.Prefix, b netip.Prefix) int for func(a E, b E) int
# gvisor.dev/gvisor/pkg/sync
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/gate_unsafe.go:114:3: undefined: goready
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/gate_unsafe.go:144:2: undefined: gopark
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:76:3: undefined: semacquire
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:102:4: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:152:3: undefined: semacquire
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:179:3: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/rwmutex_unsafe.go:207:3: undefined: semrelease
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/seqcount.go:87:6: undefined: canSpin
../go/pkg/mod/gvisor.dev/[email protected]/pkg/sync/seqcount.go:89:4: undefined: doSpin
# tailscale.com/net/tsaddr
../go/pkg/mod/[email protected]/net/tsaddr/tsaddr.go:255:21: type func(ri netip.Prefix, rj netip.Prefix) bool of func(ri, rj netip.Prefix) bool {…} does not match inferred type func(a netip.Prefix, b netip.Prefix) int for func(a E, b E) int
5 replies
CCoder.com
Created by Chris on 3/13/2024 in #help
Using the golang codersdk
I'm now running into the following issue trying to build a simple program to communicate with the Coder API.
5 replies
CCoder.com
Created by Chris on 3/13/2024 in #help
Using the golang codersdk
I figured this out. I was importing "github.com/coder/coder/codersdk" instead of "github.com/coder/coder/v2/codersdk"
5 replies