Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
icholy
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
icholy
3y ago
You can, which makes me wonder why they added the range-over-int functionality when it could have been a function in the proposed iter package: for x := range iter.N(10) { ... }
62.
▲
by
icholy
3y ago
Apologies, I misread your comment. But can you elaborate on your statement that tree-shaking (more commonly referred to as dead-code-elimination) is no longer required?
63.
▲
by
icholy
3y ago
Calling vtables "reflection" is a stretch.
64.
▲
by
icholy
3y ago
I believe the checks you're referring are local to a package. It doesn't do whole program analysis like deadcode does.
65.
▲
by
icholy
3y ago
Last time I checked, it didn't even unroll loops.
66.
▲
by
icholy
3y ago
It's not that simple. The Go compiler uses a main package as its entry point when compiling a binary. A module can have a many main packages each using different subsets of the library packages. So there are two choices here: 1.
67.
▲
by
icholy
3y ago
Seems like you're conflating two separate things here. The Go compiler has a DCE pass which prevents unused code from ending up in the binary. The linked blog-post describes a tool for identifying unused code in your codebase. Two comp
68.
▲
by
icholy
3y ago
deadcode ./cmd/...
69.
▲
by
icholy
3y ago
At my company we have a shared "wins" document where team members add entries for things they're proud of. It's annoying to maintain, but it's definitely been helpful when asking for a raise.
70.
▲
by
icholy
3y ago
It goes both ways.
71.
▲
by
icholy
3y ago
Looks like a competitor to me.
72.
▲
by
icholy
3y ago
Semgrep is capable of one-off searching and refactoring. I agreed that the docs are a little hard to navigate.
73.
▲
by
icholy
3y ago
I only switched mine once a second dev joined the project.
74.
▲
by
icholy
3y ago
Thanks for the follow up. Is your fork public?
75.
▲
by
icholy
3y ago
Eh, I like Go and respect Rob Pike, but I seriously doubt gob had any impact on the proto3 design
76.
▲
by
icholy
3y ago
I think it's because Go's encoding/json package doesn't support incremental parsing.
77.
▲
by
icholy
3y ago
You can clean up this code by writing a package for generating JSON token by token. w := jsonx.New(os.Stdout) w.OpenObject() w.ObjectKey("commit") w.Int(0) w.CloseObject()
78.
▲
by
icholy
3y ago
ipdb.set_trace is the best of both worlds
79.
▲
by
icholy
3y ago
It's because the package predates generics and a v2 hasn't been added yet.
80.
▲
by
icholy
3y ago
https://raytracing.github.io/
81.
▲
by
icholy
3y ago
Why can't opening hours be stored in UTC?
82.
▲
by
icholy
3y ago
Go channels are synchronous by default.
83.
▲
by
icholy
3y ago
It's not 75% of the code-base. During the error handling proposals, the Go team analyzed a large corpus of Go, and it turns out people drastically overstate how much error handling contributes to the line count.
84.
▲
by
icholy
3y ago
If this turns out to be real issue (which I seriously doubt), then they'll add a vet check.
85.
▲
by
icholy
3y ago
Then don't act like total knob. Demanding justification for someone's personal blog post is weird man.
86.
▲
by
icholy
3y ago
Yeah, that one if statement really melts my brain. /s
87.
▲
by
icholy
3y ago
You're just making problems up now ...
88.
▲
by
icholy
3y ago
There's no reason it can't be optimized away when they're not necessary.
89.
▲
by
icholy
3y ago
Keep posting about D, I'm sure it will catch on soon.
90.
▲
by
icholy
3y ago
They did something sneaky. In go 1.21, they changed the version number format in the `go.mod` files. So trying to build with go 1.18 will result in: go: errors parsing go.mod: go.mod:3: invalid go version '1.21.0': must matc
More ›