Skip to content

No packages found for open file #73712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aranw opened this issue May 14, 2025 · 2 comments
Closed

No packages found for open file #73712

aranw opened this issue May 14, 2025 · 2 comments
Labels
BugReport Issues describing a possible bug in the Go implementation.

Comments

@aranw
Copy link

aranw commented May 14, 2025

Go version

go version go1.24.3 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='0'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='<removed>/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='<removed>/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sq/3sdsh9n14p790p7xwhdlvdzc0000gn/T/go-build2836616649=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='<removed>/code/foundationdb/foundationdb/bindings/go/go.mod'
GOMODCACHE='<removed>/go/pkg/mod'
GONOPROXY='<removed>'
GONOSUMDB='<removed>'
GOOS='darwin'
GOPATH='<removed>/go'
GOPRIVATE='<removed>'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.24.3/libexec'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='<removed>/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.24.3/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.3'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I've been trying to work with the github.com/apple/foundationdb/bindings/go/src/fdb package that I loaded from Go modules

All I've done was get the package from go modules

go get github.com/apple/foundationdb/bindings/[email protected]

Then using a simple program tried to use it

package main

import (
	"fmt"
	"log"

	"github.com/apple/foundationdb/bindings/go/src/fdb"
)

func main() {
	fdb.MustAPIVersion(730)

	// Open the default database
	db, err := fdb.MustOpenDefault()
	if err != nil {
		log.Fatalf("Failed to open database: %v", err)
	}

	// Create keys for our test
	nameKey := []byte("person:name")
	ageKey := []byte("person:age")

	// Write some data in a transaction
	_, err = db.Transact(func(tr fdb.Transaction) (interface{}, error) {
		fmt.Println("Setting values...")
		tr.Set(nameKey, []byte("John Smith"))
		tr.Set(ageKey, []byte("42"))
		return nil, nil
	})
	if err != nil {
		log.Fatalf("Transaction failed: %v", err)
	}

	// Read data in a transaction
	result, err := db.Transact(func(tr fdb.Transaction) (interface{}, error) {
		fmt.Println("Reading values...")

		// Future represents a value that may not be ready yet
		nameFuture := tr.Get(nameKey)
		ageFuture := tr.Get(ageKey)

		// Wait for the futures to be ready and get their values
		name := nameFuture.MustGet()
		age := ageFuture.MustGet()

		// Return the results
		return map[string][]byte{
			"name": name,
			"age":  age,
		}, nil
	})
	if err != nil {
		log.Fatalf("Read transaction failed: %v", err)
	}

	// Type assertion to get our result map
	data := result.(map[string][]byte)

	// Print the results
	fmt.Printf("Name: %s\n", string(data["name"]))
	fmt.Printf("Age: %s\n", string(data["age"]))

	// Clear the data in a transaction
	_, err = db.Transact(func(tr fdb.Transaction) (interface{}, error) {
		fmt.Println("Clearing values...")
		tr.Clear(nameKey)
		tr.Clear(ageKey)
		return nil, nil
	})
	if err != nil {
		log.Fatalf("Clear transaction failed: %v", err)
	}

	fmt.Println("Data successfully written, read and cleared!")
}

What did you see happen?

When I tried to work with the package I noticed that there were a bunch of missing functions from my intellisense and I'd get errors such as undefined: fdb.MustAPIVersion (compiler UndeclaredImportedName)

When I'd go to look at the package in my go module cache <removed>/go/pkg/mod/github.com/apple/foundationdb/bindings/[email protected]/src/fdb/

I can see the missing functions but I have the following errors

No packages found for open file <removed>/go/pkg/mod/github.com/apple/foundationdb/bindings/[email protected]/src/fdb/fdb.go.
This file is ignored by your gopls build. (go list)

What did you expect to see?

I expected gopls to work and show these functions but for some reason it is ignoring them

I have no custom gopls config or build tags selected

❯ gopls -v version
Build info
----------
golang.org/x/tools/gopls v0.18.1
    golang.org/x/tools/[email protected] h1:2xJBNzdImS5u/kV/ZzqDLSvlBSeZX+pWY9uKVP7Pask=
    github.com/BurntSushi/[email protected] h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
    github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/[email protected] h1:1xaZTydL5Gsg78QharTwKfA9FY9CZ1VQj6D/AZEvHR0=
    golang.org/x/[email protected] h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
    golang.org/x/[email protected] h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
    golang.org/x/[email protected] h1:L2k9GUV2TpQKVRGMjN94qfUMgUwOFimSQ6gipyJIjKw=
    golang.org/x/[email protected] h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
    golang.org/x/[email protected] h1:Ja/5gV5a9Vvho3p2NC/T2TtxhHjrWS/2DvCKMvA0a+Y=
    golang.org/x/[email protected] h1:NPGnvPOTgnjBc9HTaUx+nj+EaUYxl5SJOWqaDYGaFYw=
    honnef.co/go/[email protected] h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
    mvdan.cc/[email protected] h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
    mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.24.3

Edit:

I found the following issue under the vscode-go project which I added a comment too but it seems to be closed and I don't think has any triage

@seankhliao
Copy link
Member

you've explicitly disabled cgo.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation.
Projects
None yet
Development

No branches or pull requests

3 participants