sizeof

command module
v0.0.0-...-68aefd8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

README

go get [-u] rsc.io/sizeof

https://godoc.org/rsc.io/sizeof

Documentation

Overview

Sizeof prints the size of named Go types in a package.

Usage:

sizeof [-c] [-f] [-p path] [-v] [name...]

Sizeof prints the size of Go types in a given package.

If the -p option is given, sizeof compiles the package named by the import path. Otherwise it compiles the package in the current directory.

If type names are given on the command line, sizeof prints the size of those types. Otherwise it prints the size of all named types in the package.

If the -f option is given, sizeof also prints field locations for each type.

If the -c option is given, sizeof ignores types and instead prints the values of integer constants.

If the -v option is given, sizeof prints information about its internal operations.

Sizeof builds the package using “go build,” so it uses the same operating system and architecture as “go build” does. To find the size on a different system, set GOOS and/or GOARCH.

Example

To find the size of regexp's Regexp:

cd $GOROOT/src/regexp
sizeof Regexp

To find the size of regexp/syntax's Regexp, without going into that directory:

sizeof -p regexp/syntax Regexp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL