Skip to content

cmd/go: document that a .go file is required even if there is a .swig file #11875

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
chai2010 opened this issue Jul 27, 2015 · 2 comments
Closed
Labels
Documentation Issues describing a change to documentation. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@chai2010
Copy link
Contributor

go version devel +aad4fe4 Thu Jul 23 05:50:53 2015 +0000 windows/amd64

Only include example.swig and simple.c:

go build
can't load package: package mydev/swig/simple: no buildable Go source files in C:\go\gopkg\src\mydev\swig\simple

If i create a x.go like this:

package example

go build is ok.

@ianlancetaylor
Copy link
Member

This seems unavoidable: without a .go file, the go tool does not know the name of the package. Furthermore, it seems desirable: you should have a .go file that documents that package, as godoc does not know how to extract documentation from a .swig file.

I'll leave this open to update the documentation.

@ianlancetaylor ianlancetaylor changed the title swig: can't load package cmd/go: document that a .go file is required even if there is a .swig file Jul 27, 2015
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jul 27, 2015
@ianlancetaylor ianlancetaylor added the Documentation Issues describing a change to documentation. label Jul 27, 2015
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 23, 2019
@seankhliao seankhliao added the GoCommand cmd/go label Feb 22, 2025
linsite added a commit to linsite/go that referenced this issue Feb 26, 2025
linsite added a commit to linsite/go that referenced this issue Feb 26, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/652675 mentions this issue: cmd/go: update c document

linsite added a commit to linsite/go that referenced this issue Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues describing a change to documentation. GoCommand cmd/go NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants