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.

Platform sources for Go

See original GitHub issue

Is there a way to have go_binary and go_library to include only the source files compatible with current platform (OS/arch)? The native go build <package> command does that automatically, but I don’t know how to configure buck to have the same behavior.

For example, the following command shows the list of files included in go build when I am building the package:

go list -f '{{.GoFiles}}' github.com/jessevdk/go-flags

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nemithcommented, Dec 31, 2017

That functionality doesn’t exist yet. At facebook we wrote a small go utility that creates BUCK files with the correct files based off of build.Package (https://golang.org/pkg/go/build/#Context.Import)

Less than ideal but it works. Buck doesn’t inspect the contents of files so it cannot work the same as go build.

0reactions
linzhpcommented, Dec 31, 2017

The native Go compiler does filter files. If you run go build github.com/jessevdk/go-flags, only source files in the package compatible with the current platform are included. I am trying to figure out how Buck turns that filtering off and how I can turn it on again. Any hint?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Our 5 Favorite Go Open Source Projects - Undo.io
Our 5 Favorite Go Open Source Projects · 1. Kubernetes · 2. Hugo · 3. CoreDNS · 4. CockroachDB · 5. Monzo Bank....
Read more >
The Go Programming Language
An open-source programming language supported by Google · Easy to learn and great for teams · Built-in concurrency and a robust standard library...
Read more >
A curated list of awesome Go frameworks, libraries and ...
CDS - Enterprise-Grade CI/CD and DevOps Automation Open Source Platform. drone - Drone is a Continuous Integration platform built on Docker, written in...
Read more >
Top 7 Golang IDEs for Go Developers - Tabnine
LiteIDE is a simple, open source, cross-platform Go IDE that highly resembles Visual Studio and GCC C++.
Read more >
Google Open Source Projects
The Go programming language is an open source project to make programmers more productive. Go is expressive, concise, clean, and efficient.
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