Hi,
Yes, there are some gotchas involved with setting up VS Code with the Go
project. The most common fix is to make sure that the go command resolved
from PATH is the go command built via src/make.bash. There are some more
details
at
https://github.com/golang/tools/blob/master/gopls/doc/adva
> FYI, there is an existing tool that can detect structs where fields
> could be rearranged.
Interesting, I hadn't run into that before.
> I don't think that one helps, as struct sizes are always increased to
> be a multiple of the required struct alignment.
Ah, this is true. I was working off
On Tue, Apr 18, 2023 at 10:54 AM Def Ceb wrote:
>
> While working on a personal project, I noticed that quite a few structs in
> the standard library, exported or otherwise, could have their memory
> footprint reduced by simply reordering their members so that padding required
> for alignment i
Dear all,
I'm trying to find the callgraph of a method, using the following code:
package main
import (
"log"
"golang.org/x/tools/go/callgraph"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/ssa/ssautil"
)
func main() {
cfg := &packages.Config{Mode: packages.LoadSyntax}
initial, err :
True, having it as a general compiler optimization and fiddling with many
structs dealing with lower-level things are off-limits.
And serialization via e.g encoding/binary is also a reason to avoid
touching public fields.
On Tuesday, April 18, 2023 at 6:26:27 PM UTC TheDiveO wrote:
> The standa
...would immediately *negatively affect* workhorses...
On Tuesday, April 18, 2023 at 8:26:27 PM UTC+2 TheDiveO wrote:
> The standard libraries in several parts define and also use structs where
> the field ordering and padding is crucial as they are shared with operating
> system functions. Try
The standard libraries in several parts define and also use structs where
the field ordering and padding is crucial as they are shared with operating
system functions. Trying to rearrange fields in 3rd party apllications
would immediately workhorses like Docker container engine, with associated
Hello.
This is a request for comments on an idea I had.
While working on a personal project, I noticed that quite a few structs in
the standard library, exported or otherwise, could have their memory
footprint reduced by simply reordering their members so that padding
required for alignment is