https://pantsbuild.org/ logo
#general
Title
# general
h

hundreds-father-404

10/07/2021, 7:33 PM
Bikeshed for any Go developers out there (and others too!) golang
For the upcoming Pants Go support, the target types are: •
_go_internal_package
, corresponding to a Go package / a directory of first-party
.go
code •
_go_external_package
, corresponding to a package belonging to an external/third-party "module" •
go_mod
, which generates both of those targets based on the `go.mod`/`go.sum` contents and your source files
@fast-nail-55400 has explained that "internal" is a bad name because it makes people think of a package with the component
/internal/
Some ideas for new names: •
_go_source_package
and
_go_external_package
_go_1stparty_package
and
_go_3rdparty_package
_go_firstparty_package
and
_go_thirdparty_package
1
Also note that you will probably never actually explicitly create those targets in BUILD files because they get generated for you. So, I'm not as worried about the name being verbose - more important is that the names are clear and intuitive
cc @melodic-thailand-99227 @loud-stone-83419 @rapid-bird-79300 @plain-carpet-73994 @echoing-controller-7533 @worried-salesclerk-37834, I think y'all have expressed interest in Go?
w

worried-salesclerk-37834

10/07/2021, 7:48 PM
I like the last option, I think. Just because something is external doesn't mean it's not "source". Just my 2 pennies.
❤️ 1
h

happy-kitchen-89482

10/07/2021, 7:54 PM
Yeah, firstparty vs thirdparty is very, very clear and explicit
1
h

hundreds-father-404

10/07/2021, 7:55 PM
Good feedback, thanks Chris! That makes sense to me And sounds like people agree
firstparty
>
1stparty
? Especially since the only time you'd right this out explicitly is
./pants filter --target-type
- the extra characters are worth it
1
l

loud-stone-83419

10/07/2021, 7:59 PM
@brainy-photographer-16204
🙏 1
h

hundreds-father-404

10/07/2021, 8:09 PM
Cool, thanks everyone. Btw, we're close to having something alpha testable for tomorrow's dev release! • can build `go_binary`s for you, i.e. whereever you have
package main
gofmt
hooks up to
./pants lint
and
./pants fmt
• onboarding is pretty effortless. You run
./pants tailor
and it will generate ~1 BUILD file with a
go_mod
target for each
go.mod
file, and
go_binary
wherever there's a
package main
. Dependency inference + a new feature of target generation get rid of the boilerplate • we optimized a bunch the past two weeks. Benchmark went from 10 minutes(!!) for our very first proof-of-concept to 33 seconds on a cold cache Remaining work: •
./pants test
integration •
./pants check
integration (i.e. check if something compiles) • some edge cases with certain things not building, like if there are capital letters in the import path 👀
🔥 1