repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1 value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hairyhenderson/gomplate | random/random.go | rndString | func rndString(count int, chars []rune) (string, error) {
s := make([]rune, count)
for i := range s {
s[i] = chars[Rnd.Intn(len(chars))]
}
return string(s), nil
} | go | func rndString(count int, chars []rune) (string, error) {
s := make([]rune, count)
for i := range s {
s[i] = chars[Rnd.Intn(len(chars))]
}
return string(s), nil
} | [
"func",
"rndString",
"(",
"count",
"int",
",",
"chars",
"[",
"]",
"rune",
")",
"(",
"string",
",",
"error",
")",
"{",
"s",
":=",
"make",
"(",
"[",
"]",
"rune",
",",
"count",
")",
"\n",
"for",
"i",
":=",
"range",
"s",
"{",
"s",
"[",
"i",
"]",
... | // produce a string containing a random selection of given characters | [
"produce",
"a",
"string",
"containing",
"a",
"random",
"selection",
"of",
"given",
"characters"
] | 20937becaa32cdec93e77a84ad04c73e9155b8e7 | https://github.com/hairyhenderson/gomplate/blob/20937becaa32cdec93e77a84ad04c73e9155b8e7/random/random.go#L47-L53 | train |
hairyhenderson/gomplate | random/random.go | Float | func Float(min, max float64) (float64, error) {
return min + Rnd.Float64()*(max-min), nil
} | go | func Float(min, max float64) (float64, error) {
return min + Rnd.Float64()*(max-min), nil
} | [
"func",
"Float",
"(",
"min",
",",
"max",
"float64",
")",
"(",
"float64",
",",
"error",
")",
"{",
"return",
"min",
"+",
"Rnd",
".",
"Float64",
"(",
")",
"*",
"(",
"max",
"-",
"min",
")",
",",
"nil",
"\n",
"}"
] | // Float - For now this is really just a wrapper around `rand.Float64` | [
"Float",
"-",
"For",
"now",
"this",
"is",
"really",
"just",
"a",
"wrapper",
"around",
"rand",
".",
"Float64"
] | 20937becaa32cdec93e77a84ad04c73e9155b8e7 | https://github.com/hairyhenderson/gomplate/blob/20937becaa32cdec93e77a84ad04c73e9155b8e7/random/random.go#L107-L109 | train |
hairyhenderson/gomplate | context.go | Env | func (c *context) Env() map[string]string {
env := make(map[string]string)
for _, i := range os.Environ() {
sep := strings.Index(i, "=")
env[i[0:sep]] = i[sep+1:]
}
return env
} | go | func (c *context) Env() map[string]string {
env := make(map[string]string)
for _, i := range os.Environ() {
sep := strings.Index(i, "=")
env[i[0:sep]] = i[sep+1:]
}
return env
} | [
"func",
"(",
"c",
"*",
"context",
")",
"Env",
"(",
")",
"map",
"[",
"string",
"]",
"string",
"{",
"env",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"for",
"_",
",",
"i",
":=",
"range",
"os",
".",
"Environ",
"(",
")",
"... | // Env - Map environment variables for use in a template | [
"Env",
"-",
"Map",
"environment",
"variables",
"for",
"use",
"in",
"a",
"template"
] | 20937becaa32cdec93e77a84ad04c73e9155b8e7 | https://github.com/hairyhenderson/gomplate/blob/20937becaa32cdec93e77a84ad04c73e9155b8e7/context.go#L14-L21 | train |
hairyhenderson/gomplate | aws/ec2meta.go | retrieveMetadata | func (e *Ec2Meta) retrieveMetadata(url string, def ...string) (string, error) {
if value, ok := e.cache[url]; ok {
return value, nil
}
if e.nonAWS {
return returnDefault(def), nil
}
if e.Client == nil {
timeout := e.options.Timeout
if timeout == 0 {
timeout = 500 * time.Millisecond
}
e.Client = &http.Client{Timeout: timeout}
}
resp, err := e.Client.Get(url)
if err != nil {
if unreachable(err) {
e.nonAWS = true
}
return returnDefault(def), nil
}
// nolint: errcheck
defer resp.Body.Close()
if resp.StatusCode > 399 {
return returnDefault(def), nil
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", errors.Wrapf(err, "Failed to read response body from %s", url)
}
value := strings.TrimSpace(string(body))
e.cache[url] = value
return value, nil
} | go | func (e *Ec2Meta) retrieveMetadata(url string, def ...string) (string, error) {
if value, ok := e.cache[url]; ok {
return value, nil
}
if e.nonAWS {
return returnDefault(def), nil
}
if e.Client == nil {
timeout := e.options.Timeout
if timeout == 0 {
timeout = 500 * time.Millisecond
}
e.Client = &http.Client{Timeout: timeout}
}
resp, err := e.Client.Get(url)
if err != nil {
if unreachable(err) {
e.nonAWS = true
}
return returnDefault(def), nil
}
// nolint: errcheck
defer resp.Body.Close()
if resp.StatusCode > 399 {
return returnDefault(def), nil
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", errors.Wrapf(err, "Failed to read response body from %s", url)
}
value := strings.TrimSpace(string(body))
e.cache[url] = value
return value, nil
} | [
"func",
"(",
"e",
"*",
"Ec2Meta",
")",
"retrieveMetadata",
"(",
"url",
"string",
",",
"def",
"...",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"value",
",",
"ok",
":=",
"e",
".",
"cache",
"[",
"url",
"]",
";",
"ok",
"{",
"return"... | // retrieve EC2 metadata, defaulting if we're not in EC2 or if there's a non-OK
// response. If there is an OK response, but we can't parse it, this errors | [
"retrieve",
"EC2",
"metadata",
"defaulting",
"if",
"we",
"re",
"not",
"in",
"EC2",
"or",
"if",
"there",
"s",
"a",
"non",
"-",
"OK",
"response",
".",
"If",
"there",
"is",
"an",
"OK",
"response",
"but",
"we",
"can",
"t",
"parse",
"it",
"this",
"errors"... | 20937becaa32cdec93e77a84ad04c73e9155b8e7 | https://github.com/hairyhenderson/gomplate/blob/20937becaa32cdec93e77a84ad04c73e9155b8e7/aws/ec2meta.go#L61-L99 | train |
muesli/smartcrop | smartcrop.go | NewAnalyzer | func NewAnalyzer(resizer options.Resizer) Analyzer {
logger := Logger{
DebugMode: false,
}
return NewAnalyzerWithLogger(resizer, logger)
} | go | func NewAnalyzer(resizer options.Resizer) Analyzer {
logger := Logger{
DebugMode: false,
}
return NewAnalyzerWithLogger(resizer, logger)
} | [
"func",
"NewAnalyzer",
"(",
"resizer",
"options",
".",
"Resizer",
")",
"Analyzer",
"{",
"logger",
":=",
"Logger",
"{",
"DebugMode",
":",
"false",
",",
"}",
"\n\n",
"return",
"NewAnalyzerWithLogger",
"(",
"resizer",
",",
"logger",
")",
"\n",
"}"
] | // NewAnalyzer returns a new Analyzer using the given Resizer. | [
"NewAnalyzer",
"returns",
"a",
"new",
"Analyzer",
"using",
"the",
"given",
"Resizer",
"."
] | 548bbf0c0965feac4997e1b51c96764f30dba677 | https://github.com/muesli/smartcrop/blob/548bbf0c0965feac4997e1b51c96764f30dba677/smartcrop.go#L111-L117 | train |
muesli/smartcrop | smartcrop.go | NewAnalyzerWithLogger | func NewAnalyzerWithLogger(resizer options.Resizer, logger Logger) Analyzer {
if logger.Log == nil {
logger.Log = log.New(ioutil.Discard, "", 0)
}
return &smartcropAnalyzer{Resizer: resizer, logger: logger}
} | go | func NewAnalyzerWithLogger(resizer options.Resizer, logger Logger) Analyzer {
if logger.Log == nil {
logger.Log = log.New(ioutil.Discard, "", 0)
}
return &smartcropAnalyzer{Resizer: resizer, logger: logger}
} | [
"func",
"NewAnalyzerWithLogger",
"(",
"resizer",
"options",
".",
"Resizer",
",",
"logger",
"Logger",
")",
"Analyzer",
"{",
"if",
"logger",
".",
"Log",
"==",
"nil",
"{",
"logger",
".",
"Log",
"=",
"log",
".",
"New",
"(",
"ioutil",
".",
"Discard",
",",
"... | // NewAnalyzerWithLogger returns a new analyzer with the given Resizer and Logger. | [
"NewAnalyzerWithLogger",
"returns",
"a",
"new",
"analyzer",
"with",
"the",
"given",
"Resizer",
"and",
"Logger",
"."
] | 548bbf0c0965feac4997e1b51c96764f30dba677 | https://github.com/muesli/smartcrop/blob/548bbf0c0965feac4997e1b51c96764f30dba677/smartcrop.go#L120-L125 | train |
muesli/smartcrop | smartcrop.go | toRGBA | func toRGBA(img image.Image) *image.RGBA {
switch img.(type) {
case *image.RGBA:
return img.(*image.RGBA)
}
out := image.NewRGBA(img.Bounds())
draw.Copy(out, image.Pt(0, 0), img, img.Bounds(), draw.Src, nil)
return out
} | go | func toRGBA(img image.Image) *image.RGBA {
switch img.(type) {
case *image.RGBA:
return img.(*image.RGBA)
}
out := image.NewRGBA(img.Bounds())
draw.Copy(out, image.Pt(0, 0), img, img.Bounds(), draw.Src, nil)
return out
} | [
"func",
"toRGBA",
"(",
"img",
"image",
".",
"Image",
")",
"*",
"image",
".",
"RGBA",
"{",
"switch",
"img",
".",
"(",
"type",
")",
"{",
"case",
"*",
"image",
".",
"RGBA",
":",
"return",
"img",
".",
"(",
"*",
"image",
".",
"RGBA",
")",
"\n",
"}",... | // toRGBA converts an image.Image to an image.RGBA | [
"toRGBA",
"converts",
"an",
"image",
".",
"Image",
"to",
"an",
"image",
".",
"RGBA"
] | 548bbf0c0965feac4997e1b51c96764f30dba677 | https://github.com/muesli/smartcrop/blob/548bbf0c0965feac4997e1b51c96764f30dba677/smartcrop.go#L466-L474 | train |
mdlayher/raw | raw_bsd.go | configureBPF | func configureBPF(fd int, ifi *net.Interface, proto uint16) (int, error) {
// Use specified interface with BPF device
if err := syscall.SetBpfInterface(fd, ifi.Name); err != nil {
return 0, err
}
// Inform BPF to send us its data immediately
if err := syscall.SetBpfImmediate(fd, 1); err != nil {
return 0, err
}
// Check buffer size of BPF device
buflen, err := syscall.BpfBuflen(fd)
if err != nil {
return 0, err
}
// Do not automatically complete source address in ethernet headers
if err := syscall.SetBpfHeadercmpl(fd, 1); err != nil {
return 0, err
}
// Only retrieve incoming traffic using BPF device
if err := setBPFDirection(fd, bpfDIn); err != nil {
return 0, err
}
// Build and apply base BPF filter which checks for correct EtherType
// on incoming packets
prog, err := bpf.Assemble(baseInterfaceFilter(proto, ifi.MTU))
if err != nil {
return 0, err
}
if err := syscall.SetBpf(fd, assembleBpfInsn(prog)); err != nil {
return 0, err
}
// Flush any packets currently in the BPF device's buffer
if err := syscall.FlushBpf(fd); err != nil {
return 0, err
}
return buflen, nil
} | go | func configureBPF(fd int, ifi *net.Interface, proto uint16) (int, error) {
// Use specified interface with BPF device
if err := syscall.SetBpfInterface(fd, ifi.Name); err != nil {
return 0, err
}
// Inform BPF to send us its data immediately
if err := syscall.SetBpfImmediate(fd, 1); err != nil {
return 0, err
}
// Check buffer size of BPF device
buflen, err := syscall.BpfBuflen(fd)
if err != nil {
return 0, err
}
// Do not automatically complete source address in ethernet headers
if err := syscall.SetBpfHeadercmpl(fd, 1); err != nil {
return 0, err
}
// Only retrieve incoming traffic using BPF device
if err := setBPFDirection(fd, bpfDIn); err != nil {
return 0, err
}
// Build and apply base BPF filter which checks for correct EtherType
// on incoming packets
prog, err := bpf.Assemble(baseInterfaceFilter(proto, ifi.MTU))
if err != nil {
return 0, err
}
if err := syscall.SetBpf(fd, assembleBpfInsn(prog)); err != nil {
return 0, err
}
// Flush any packets currently in the BPF device's buffer
if err := syscall.FlushBpf(fd); err != nil {
return 0, err
}
return buflen, nil
} | [
"func",
"configureBPF",
"(",
"fd",
"int",
",",
"ifi",
"*",
"net",
".",
"Interface",
",",
"proto",
"uint16",
")",
"(",
"int",
",",
"error",
")",
"{",
"// Use specified interface with BPF device",
"if",
"err",
":=",
"syscall",
".",
"SetBpfInterface",
"(",
"fd"... | // configureBPF configures a BPF device with the specified file descriptor to
// use the specified network and interface and protocol. | [
"configureBPF",
"configures",
"a",
"BPF",
"device",
"with",
"the",
"specified",
"file",
"descriptor",
"to",
"use",
"the",
"specified",
"network",
"and",
"interface",
"and",
"protocol",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_bsd.go#L238-L281 | train |
mdlayher/raw | raw_bsd.go | assembleBpfInsn | func assembleBpfInsn(filter []bpf.RawInstruction) []syscall.BpfInsn {
// Copy each bpf.RawInstruction into syscall.BpfInsn. If needed,
// the structures have the same memory layout and could probably be
// unsafely cast to each other for speed.
insns := make([]syscall.BpfInsn, 0, len(filter))
for _, ins := range filter {
insns = append(insns, syscall.BpfInsn{
Code: ins.Op,
Jt: ins.Jt,
Jf: ins.Jf,
K: ins.K,
})
}
return insns
} | go | func assembleBpfInsn(filter []bpf.RawInstruction) []syscall.BpfInsn {
// Copy each bpf.RawInstruction into syscall.BpfInsn. If needed,
// the structures have the same memory layout and could probably be
// unsafely cast to each other for speed.
insns := make([]syscall.BpfInsn, 0, len(filter))
for _, ins := range filter {
insns = append(insns, syscall.BpfInsn{
Code: ins.Op,
Jt: ins.Jt,
Jf: ins.Jf,
K: ins.K,
})
}
return insns
} | [
"func",
"assembleBpfInsn",
"(",
"filter",
"[",
"]",
"bpf",
".",
"RawInstruction",
")",
"[",
"]",
"syscall",
".",
"BpfInsn",
"{",
"// Copy each bpf.RawInstruction into syscall.BpfInsn. If needed,",
"// the structures have the same memory layout and could probably be",
"// unsafel... | // assembleBpfInsn assembles a slice of bpf.RawInstructions to the format required by
// package syscall. | [
"assembleBpfInsn",
"assembles",
"a",
"slice",
"of",
"bpf",
".",
"RawInstructions",
"to",
"the",
"format",
"required",
"by",
"package",
"syscall",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_bsd.go#L285-L300 | train |
mdlayher/raw | raw_bsd.go | baseInterfaceFilter | func baseInterfaceFilter(proto uint16, mtu int) []bpf.Instruction {
return append(
// Filter traffic based on EtherType
baseFilter(proto),
// Accept the packet bytes up to the interface's MTU
bpf.RetConstant{
Val: uint32(mtu),
},
)
} | go | func baseInterfaceFilter(proto uint16, mtu int) []bpf.Instruction {
return append(
// Filter traffic based on EtherType
baseFilter(proto),
// Accept the packet bytes up to the interface's MTU
bpf.RetConstant{
Val: uint32(mtu),
},
)
} | [
"func",
"baseInterfaceFilter",
"(",
"proto",
"uint16",
",",
"mtu",
"int",
")",
"[",
"]",
"bpf",
".",
"Instruction",
"{",
"return",
"append",
"(",
"// Filter traffic based on EtherType",
"baseFilter",
"(",
"proto",
")",
",",
"// Accept the packet bytes up to the interf... | // baseInterfaceFilter creates a base BPF filter which filters traffic based
// on its EtherType and returns up to "mtu" bytes of data for processing. | [
"baseInterfaceFilter",
"creates",
"a",
"base",
"BPF",
"filter",
"which",
"filters",
"traffic",
"based",
"on",
"its",
"EtherType",
"and",
"returns",
"up",
"to",
"mtu",
"bytes",
"of",
"data",
"for",
"processing",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_bsd.go#L304-L313 | train |
mdlayher/raw | raw_bsd.go | baseFilter | func baseFilter(proto uint16) []bpf.Instruction {
// Offset | Length | Comment
// -------------------------
// 00 | 06 | Ethernet destination MAC address
// 06 | 06 | Ethernet source MAC address
// 12 | 02 | Ethernet EtherType
const (
etherTypeOffset = 12
etherTypeLength = 2
)
return []bpf.Instruction{
// Load EtherType value from Ethernet header
bpf.LoadAbsolute{
Off: etherTypeOffset,
Size: etherTypeLength,
},
// If EtherType is equal to the protocol we are using, jump to instructions
// added outside of this function.
bpf.JumpIf{
Cond: bpf.JumpEqual,
Val: uint32(proto),
SkipTrue: 1,
},
// EtherType does not match our protocol
bpf.RetConstant{
Val: 0,
},
}
} | go | func baseFilter(proto uint16) []bpf.Instruction {
// Offset | Length | Comment
// -------------------------
// 00 | 06 | Ethernet destination MAC address
// 06 | 06 | Ethernet source MAC address
// 12 | 02 | Ethernet EtherType
const (
etherTypeOffset = 12
etherTypeLength = 2
)
return []bpf.Instruction{
// Load EtherType value from Ethernet header
bpf.LoadAbsolute{
Off: etherTypeOffset,
Size: etherTypeLength,
},
// If EtherType is equal to the protocol we are using, jump to instructions
// added outside of this function.
bpf.JumpIf{
Cond: bpf.JumpEqual,
Val: uint32(proto),
SkipTrue: 1,
},
// EtherType does not match our protocol
bpf.RetConstant{
Val: 0,
},
}
} | [
"func",
"baseFilter",
"(",
"proto",
"uint16",
")",
"[",
"]",
"bpf",
".",
"Instruction",
"{",
"// Offset | Length | Comment",
"// -------------------------",
"// 00 | 06 | Ethernet destination MAC address",
"// 06 | 06 | Ethernet source MAC address",
"// 12 | 02 ... | // baseFilter creates a base BPF filter which filters traffic based on its
// EtherType. baseFilter can be prepended to other filters to handle common
// filtering tasks. | [
"baseFilter",
"creates",
"a",
"base",
"BPF",
"filter",
"which",
"filters",
"traffic",
"based",
"on",
"its",
"EtherType",
".",
"baseFilter",
"can",
"be",
"prepended",
"to",
"other",
"filters",
"to",
"handle",
"common",
"filtering",
"tasks",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_bsd.go#L318-L347 | train |
mdlayher/raw | raw_others.go | listenPacket | func listenPacket(ifi *net.Interface, proto uint16, cfg Config) (*packetConn, error) {
return nil, ErrNotImplemented
} | go | func listenPacket(ifi *net.Interface, proto uint16, cfg Config) (*packetConn, error) {
return nil, ErrNotImplemented
} | [
"func",
"listenPacket",
"(",
"ifi",
"*",
"net",
".",
"Interface",
",",
"proto",
"uint16",
",",
"cfg",
"Config",
")",
"(",
"*",
"packetConn",
",",
"error",
")",
"{",
"return",
"nil",
",",
"ErrNotImplemented",
"\n",
"}"
] | // listenPacket is not currently implemented on this platform. | [
"listenPacket",
"is",
"not",
"currently",
"implemented",
"on",
"this",
"platform",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_others.go#L21-L23 | train |
mdlayher/raw | raw_others.go | ReadFrom | func (p *packetConn) ReadFrom(b []byte) (int, net.Addr, error) {
return 0, nil, ErrNotImplemented
} | go | func (p *packetConn) ReadFrom(b []byte) (int, net.Addr, error) {
return 0, nil, ErrNotImplemented
} | [
"func",
"(",
"p",
"*",
"packetConn",
")",
"ReadFrom",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"net",
".",
"Addr",
",",
"error",
")",
"{",
"return",
"0",
",",
"nil",
",",
"ErrNotImplemented",
"\n",
"}"
] | // ReadFrom is not currently implemented on this platform. | [
"ReadFrom",
"is",
"not",
"currently",
"implemented",
"on",
"this",
"platform",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_others.go#L26-L28 | train |
mdlayher/raw | raw_others.go | WriteTo | func (p *packetConn) WriteTo(b []byte, addr net.Addr) (int, error) {
return 0, ErrNotImplemented
} | go | func (p *packetConn) WriteTo(b []byte, addr net.Addr) (int, error) {
return 0, ErrNotImplemented
} | [
"func",
"(",
"p",
"*",
"packetConn",
")",
"WriteTo",
"(",
"b",
"[",
"]",
"byte",
",",
"addr",
"net",
".",
"Addr",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"0",
",",
"ErrNotImplemented",
"\n",
"}"
] | // WriteTo is not currently implemented on this platform. | [
"WriteTo",
"is",
"not",
"currently",
"implemented",
"on",
"this",
"platform",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_others.go#L31-L33 | train |
mdlayher/raw | timeval.go | newTimeval | func newTimeval(timeout time.Duration) (*unix.Timeval, error) {
if timeout < time.Microsecond {
return nil, &timeoutError{}
}
return &unix.Timeval{
Sec: int64(timeout / time.Second),
Usec: int64(timeout % time.Second / time.Microsecond),
}, nil
} | go | func newTimeval(timeout time.Duration) (*unix.Timeval, error) {
if timeout < time.Microsecond {
return nil, &timeoutError{}
}
return &unix.Timeval{
Sec: int64(timeout / time.Second),
Usec: int64(timeout % time.Second / time.Microsecond),
}, nil
} | [
"func",
"newTimeval",
"(",
"timeout",
"time",
".",
"Duration",
")",
"(",
"*",
"unix",
".",
"Timeval",
",",
"error",
")",
"{",
"if",
"timeout",
"<",
"time",
".",
"Microsecond",
"{",
"return",
"nil",
",",
"&",
"timeoutError",
"{",
"}",
"\n",
"}",
"\n",... | // newTimeval transforms a duration into a unix.Timeval struct.
// An error is returned in case of zero time value. | [
"newTimeval",
"transforms",
"a",
"duration",
"into",
"a",
"unix",
".",
"Timeval",
"struct",
".",
"An",
"error",
"is",
"returned",
"in",
"case",
"of",
"zero",
"time",
"value",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/timeval.go#L13-L21 | train |
mdlayher/raw | raw_linux.go | newPacketConn | func newPacketConn(ifi *net.Interface, s socket, pbe uint16, filter []bpf.RawInstruction) (*packetConn, error) {
pc := &packetConn{
ifi: ifi,
s: s,
pbe: pbe,
}
if len(filter) > 0 {
if err := pc.SetBPF(filter); err != nil {
return nil, err
}
}
// Bind the packet socket to the interface specified by ifi
// packet(7):
// Only the sll_protocol and the sll_ifindex address fields are used for
// purposes of binding.
// This overrides the protocol given to socket(AF_PACKET).
err := s.Bind(&unix.SockaddrLinklayer{
Protocol: pc.pbe,
Ifindex: ifi.Index,
})
if err != nil {
return nil, err
}
return pc, nil
} | go | func newPacketConn(ifi *net.Interface, s socket, pbe uint16, filter []bpf.RawInstruction) (*packetConn, error) {
pc := &packetConn{
ifi: ifi,
s: s,
pbe: pbe,
}
if len(filter) > 0 {
if err := pc.SetBPF(filter); err != nil {
return nil, err
}
}
// Bind the packet socket to the interface specified by ifi
// packet(7):
// Only the sll_protocol and the sll_ifindex address fields are used for
// purposes of binding.
// This overrides the protocol given to socket(AF_PACKET).
err := s.Bind(&unix.SockaddrLinklayer{
Protocol: pc.pbe,
Ifindex: ifi.Index,
})
if err != nil {
return nil, err
}
return pc, nil
} | [
"func",
"newPacketConn",
"(",
"ifi",
"*",
"net",
".",
"Interface",
",",
"s",
"socket",
",",
"pbe",
"uint16",
",",
"filter",
"[",
"]",
"bpf",
".",
"RawInstruction",
")",
"(",
"*",
"packetConn",
",",
"error",
")",
"{",
"pc",
":=",
"&",
"packetConn",
"{... | // newPacketConn creates a net.PacketConn using the specified network
// interface, wrapped socket and big endian protocol number.
//
// It is the entry point for tests in this package. | [
"newPacketConn",
"creates",
"a",
"net",
".",
"PacketConn",
"using",
"the",
"specified",
"network",
"interface",
"wrapped",
"socket",
"and",
"big",
"endian",
"protocol",
"number",
".",
"It",
"is",
"the",
"entry",
"point",
"for",
"tests",
"in",
"this",
"package"... | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_linux.go#L107-L134 | train |
mdlayher/raw | raw_linux.go | SetWriteDeadline | func (p *packetConn) SetWriteDeadline(t time.Time) error {
return p.s.SetWriteDeadline(t)
} | go | func (p *packetConn) SetWriteDeadline(t time.Time) error {
return p.s.SetWriteDeadline(t)
} | [
"func",
"(",
"p",
"*",
"packetConn",
")",
"SetWriteDeadline",
"(",
"t",
"time",
".",
"Time",
")",
"error",
"{",
"return",
"p",
".",
"s",
".",
"SetWriteDeadline",
"(",
"t",
")",
"\n",
"}"
] | // SetWriteDeadline implements the net.PacketConn.SetWriteDeadline method. | [
"SetWriteDeadline",
"implements",
"the",
"net",
".",
"PacketConn",
".",
"SetWriteDeadline",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_linux.go#L214-L216 | train |
mdlayher/raw | raw_linux.go | Stats | func (p *packetConn) Stats() (*Stats, error) {
stats, err := p.s.GetSockoptTpacketStats(unix.SOL_PACKET, unix.PACKET_STATISTICS)
if err != nil {
return nil, err
}
return p.handleStats(stats), nil
} | go | func (p *packetConn) Stats() (*Stats, error) {
stats, err := p.s.GetSockoptTpacketStats(unix.SOL_PACKET, unix.PACKET_STATISTICS)
if err != nil {
return nil, err
}
return p.handleStats(stats), nil
} | [
"func",
"(",
"p",
"*",
"packetConn",
")",
"Stats",
"(",
")",
"(",
"*",
"Stats",
",",
"error",
")",
"{",
"stats",
",",
"err",
":=",
"p",
".",
"s",
".",
"GetSockoptTpacketStats",
"(",
"unix",
".",
"SOL_PACKET",
",",
"unix",
".",
"PACKET_STATISTICS",
")... | // Stats retrieves statistics from the Conn. | [
"Stats",
"retrieves",
"statistics",
"from",
"the",
"Conn",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_linux.go#L253-L260 | train |
mdlayher/raw | raw_linux.go | handleStats | func (p *packetConn) handleStats(s *unix.TpacketStats) *Stats {
// Does the caller want instantaneous stats as provided by Linux? If so,
// return the structure directly.
if p.noCumulativeStats {
return &Stats{
Packets: uint64(s.Packets),
Drops: uint64(s.Drops),
}
}
// The caller wants cumulative stats. Add stats with the internal stats
// structure and return a copy of the resulting stats.
packets := atomic.AddUint64(&p.stats.Packets, uint64(s.Packets))
drops := atomic.AddUint64(&p.stats.Drops, uint64(s.Drops))
return &Stats{
Packets: packets,
Drops: drops,
}
} | go | func (p *packetConn) handleStats(s *unix.TpacketStats) *Stats {
// Does the caller want instantaneous stats as provided by Linux? If so,
// return the structure directly.
if p.noCumulativeStats {
return &Stats{
Packets: uint64(s.Packets),
Drops: uint64(s.Drops),
}
}
// The caller wants cumulative stats. Add stats with the internal stats
// structure and return a copy of the resulting stats.
packets := atomic.AddUint64(&p.stats.Packets, uint64(s.Packets))
drops := atomic.AddUint64(&p.stats.Drops, uint64(s.Drops))
return &Stats{
Packets: packets,
Drops: drops,
}
} | [
"func",
"(",
"p",
"*",
"packetConn",
")",
"handleStats",
"(",
"s",
"*",
"unix",
".",
"TpacketStats",
")",
"*",
"Stats",
"{",
"// Does the caller want instantaneous stats as provided by Linux? If so,",
"// return the structure directly.",
"if",
"p",
".",
"noCumulativeStat... | // handleStats handles creation of Stats structures from raw packet socket stats. | [
"handleStats",
"handles",
"creation",
"of",
"Stats",
"structures",
"from",
"raw",
"packet",
"socket",
"stats",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw_linux.go#L263-L282 | train |
mdlayher/raw | raw.go | ReadFrom | func (c *Conn) ReadFrom(b []byte) (int, net.Addr, error) {
return c.p.ReadFrom(b)
} | go | func (c *Conn) ReadFrom(b []byte) (int, net.Addr, error) {
return c.p.ReadFrom(b)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"ReadFrom",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"net",
".",
"Addr",
",",
"error",
")",
"{",
"return",
"c",
".",
"p",
".",
"ReadFrom",
"(",
"b",
")",
"\n",
"}"
] | // ReadFrom implements the net.PacketConn ReadFrom method. | [
"ReadFrom",
"implements",
"the",
"net",
".",
"PacketConn",
"ReadFrom",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L48-L50 | train |
mdlayher/raw | raw.go | WriteTo | func (c *Conn) WriteTo(b []byte, addr net.Addr) (int, error) {
return c.p.WriteTo(b, addr)
} | go | func (c *Conn) WriteTo(b []byte, addr net.Addr) (int, error) {
return c.p.WriteTo(b, addr)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"WriteTo",
"(",
"b",
"[",
"]",
"byte",
",",
"addr",
"net",
".",
"Addr",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"c",
".",
"p",
".",
"WriteTo",
"(",
"b",
",",
"addr",
")",
"\n",
"}"
] | // WriteTo implements the net.PacketConn WriteTo method. | [
"WriteTo",
"implements",
"the",
"net",
".",
"PacketConn",
"WriteTo",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L53-L55 | train |
mdlayher/raw | raw.go | SetDeadline | func (c *Conn) SetDeadline(t time.Time) error {
return c.p.SetDeadline(t)
} | go | func (c *Conn) SetDeadline(t time.Time) error {
return c.p.SetDeadline(t)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetDeadline",
"(",
"t",
"time",
".",
"Time",
")",
"error",
"{",
"return",
"c",
".",
"p",
".",
"SetDeadline",
"(",
"t",
")",
"\n",
"}"
] | // SetDeadline implements the net.PacketConn SetDeadline method. | [
"SetDeadline",
"implements",
"the",
"net",
".",
"PacketConn",
"SetDeadline",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L68-L70 | train |
mdlayher/raw | raw.go | SetReadDeadline | func (c *Conn) SetReadDeadline(t time.Time) error {
return c.p.SetReadDeadline(t)
} | go | func (c *Conn) SetReadDeadline(t time.Time) error {
return c.p.SetReadDeadline(t)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetReadDeadline",
"(",
"t",
"time",
".",
"Time",
")",
"error",
"{",
"return",
"c",
".",
"p",
".",
"SetReadDeadline",
"(",
"t",
")",
"\n",
"}"
] | // SetReadDeadline implements the net.PacketConn SetReadDeadline method. | [
"SetReadDeadline",
"implements",
"the",
"net",
".",
"PacketConn",
"SetReadDeadline",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L73-L75 | train |
mdlayher/raw | raw.go | SetWriteDeadline | func (c *Conn) SetWriteDeadline(t time.Time) error {
return c.p.SetWriteDeadline(t)
} | go | func (c *Conn) SetWriteDeadline(t time.Time) error {
return c.p.SetWriteDeadline(t)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetWriteDeadline",
"(",
"t",
"time",
".",
"Time",
")",
"error",
"{",
"return",
"c",
".",
"p",
".",
"SetWriteDeadline",
"(",
"t",
")",
"\n",
"}"
] | // SetWriteDeadline implements the net.PacketConn SetWriteDeadline method. | [
"SetWriteDeadline",
"implements",
"the",
"net",
".",
"PacketConn",
"SetWriteDeadline",
"method",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L78-L80 | train |
mdlayher/raw | raw.go | SetBPF | func (c *Conn) SetBPF(filter []bpf.RawInstruction) error {
return c.p.SetBPF(filter)
} | go | func (c *Conn) SetBPF(filter []bpf.RawInstruction) error {
return c.p.SetBPF(filter)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetBPF",
"(",
"filter",
"[",
"]",
"bpf",
".",
"RawInstruction",
")",
"error",
"{",
"return",
"c",
".",
"p",
".",
"SetBPF",
"(",
"filter",
")",
"\n",
"}"
] | // SetBPF attaches an assembled BPF program to the connection. | [
"SetBPF",
"attaches",
"an",
"assembled",
"BPF",
"program",
"to",
"the",
"connection",
"."
] | 64193704e47285d33feb098cd01306301cdeba4b | https://github.com/mdlayher/raw/blob/64193704e47285d33feb098cd01306301cdeba4b/raw.go#L85-L87 | train |
dave/jennifer | jen/tokens.go | Dot | func (s *Statement) Dot(name string) *Statement {
d := token{
typ: delimiterToken,
content: ".",
}
t := token{
typ: identifierToken,
content: name,
}
*s = append(*s, d, t)
return s
} | go | func (s *Statement) Dot(name string) *Statement {
d := token{
typ: delimiterToken,
content: ".",
}
t := token{
typ: identifierToken,
content: name,
}
*s = append(*s, d, t)
return s
} | [
"func",
"(",
"s",
"*",
"Statement",
")",
"Dot",
"(",
"name",
"string",
")",
"*",
"Statement",
"{",
"d",
":=",
"token",
"{",
"typ",
":",
"delimiterToken",
",",
"content",
":",
"\"",
"\"",
",",
"}",
"\n",
"t",
":=",
"token",
"{",
"typ",
":",
"ident... | // Dot renders a period followed by an identifier. Use for fields and selectors. | [
"Dot",
"renders",
"a",
"period",
"followed",
"by",
"an",
"identifier",
".",
"Use",
"for",
"fields",
"and",
"selectors",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/tokens.go#L191-L202 | train |
dave/jennifer | jen/jen.go | Save | func (f *File) Save(filename string) error {
// notest
buf := &bytes.Buffer{}
if err := f.Render(buf); err != nil {
return err
}
if err := ioutil.WriteFile(filename, buf.Bytes(), 0644); err != nil {
return err
}
return nil
} | go | func (f *File) Save(filename string) error {
// notest
buf := &bytes.Buffer{}
if err := f.Render(buf); err != nil {
return err
}
if err := ioutil.WriteFile(filename, buf.Bytes(), 0644); err != nil {
return err
}
return nil
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Save",
"(",
"filename",
"string",
")",
"error",
"{",
"// notest",
"buf",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"f",
".",
"Render",
"(",
"buf",
")",
";",
"err",
"!=",
"nil",
"{... | // Save renders the file and saves to the filename provided. | [
"Save",
"renders",
"the",
"file",
"and",
"saves",
"to",
"the",
"filename",
"provided",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/jen.go#L21-L31 | train |
dave/jennifer | jen/jen.go | Render | func (f *File) Render(w io.Writer) error {
body := &bytes.Buffer{}
if err := f.render(f, body, nil); err != nil {
return err
}
source := &bytes.Buffer{}
if len(f.headers) > 0 {
for _, c := range f.headers {
if err := Comment(c).render(f, source, nil); err != nil {
return err
}
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
// Append an extra newline so that header comments don't get lumped in
// with package comments.
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
for _, c := range f.comments {
if err := Comment(c).render(f, source, nil); err != nil {
return err
}
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
if _, err := fmt.Fprintf(source, "package %s", f.name); err != nil {
return err
}
if f.CanonicalPath != "" {
if _, err := fmt.Fprintf(source, " // import %q", f.CanonicalPath); err != nil {
return err
}
}
if _, err := fmt.Fprint(source, "\n\n"); err != nil {
return err
}
if err := f.renderImports(source); err != nil {
return err
}
if _, err := source.Write(body.Bytes()); err != nil {
return err
}
formatted, err := format.Source(source.Bytes())
if err != nil {
return fmt.Errorf("Error %s while formatting source:\n%s", err, source.String())
}
if _, err := w.Write(formatted); err != nil {
return err
}
return nil
} | go | func (f *File) Render(w io.Writer) error {
body := &bytes.Buffer{}
if err := f.render(f, body, nil); err != nil {
return err
}
source := &bytes.Buffer{}
if len(f.headers) > 0 {
for _, c := range f.headers {
if err := Comment(c).render(f, source, nil); err != nil {
return err
}
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
// Append an extra newline so that header comments don't get lumped in
// with package comments.
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
for _, c := range f.comments {
if err := Comment(c).render(f, source, nil); err != nil {
return err
}
if _, err := fmt.Fprint(source, "\n"); err != nil {
return err
}
}
if _, err := fmt.Fprintf(source, "package %s", f.name); err != nil {
return err
}
if f.CanonicalPath != "" {
if _, err := fmt.Fprintf(source, " // import %q", f.CanonicalPath); err != nil {
return err
}
}
if _, err := fmt.Fprint(source, "\n\n"); err != nil {
return err
}
if err := f.renderImports(source); err != nil {
return err
}
if _, err := source.Write(body.Bytes()); err != nil {
return err
}
formatted, err := format.Source(source.Bytes())
if err != nil {
return fmt.Errorf("Error %s while formatting source:\n%s", err, source.String())
}
if _, err := w.Write(formatted); err != nil {
return err
}
return nil
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Render",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"body",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"f",
".",
"render",
"(",
"f",
",",
"body",
",",
"nil",
")",
";",
"... | // Render renders the file to the provided writer. | [
"Render",
"renders",
"the",
"file",
"to",
"the",
"provided",
"writer",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/jen.go#L34-L88 | train |
dave/jennifer | jen/statement.go | Render | func (s *Statement) Render(writer io.Writer) error {
return s.RenderWithFile(writer, NewFile(""))
} | go | func (s *Statement) Render(writer io.Writer) error {
return s.RenderWithFile(writer, NewFile(""))
} | [
"func",
"(",
"s",
"*",
"Statement",
")",
"Render",
"(",
"writer",
"io",
".",
"Writer",
")",
"error",
"{",
"return",
"s",
".",
"RenderWithFile",
"(",
"writer",
",",
"NewFile",
"(",
"\"",
"\"",
")",
")",
"\n",
"}"
] | // Render renders the Statement to the provided writer. | [
"Render",
"renders",
"the",
"Statement",
"to",
"the",
"provided",
"writer",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/statement.go#L73-L75 | train |
dave/jennifer | jen/statement.go | GoString | func (s *Statement) GoString() string {
buf := bytes.Buffer{}
if err := s.Render(&buf); err != nil {
panic(err)
}
return buf.String()
} | go | func (s *Statement) GoString() string {
buf := bytes.Buffer{}
if err := s.Render(&buf); err != nil {
panic(err)
}
return buf.String()
} | [
"func",
"(",
"s",
"*",
"Statement",
")",
"GoString",
"(",
")",
"string",
"{",
"buf",
":=",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"s",
".",
"Render",
"(",
"&",
"buf",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
... | // GoString renders the Statement for testing. Any error will cause a panic. | [
"GoString",
"renders",
"the",
"Statement",
"for",
"testing",
".",
"Any",
"error",
"will",
"cause",
"a",
"panic",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/statement.go#L78-L84 | train |
dave/jennifer | jen/group.go | Render | func (g *Group) Render(writer io.Writer) error {
return g.RenderWithFile(writer, NewFile(""))
} | go | func (g *Group) Render(writer io.Writer) error {
return g.RenderWithFile(writer, NewFile(""))
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Render",
"(",
"writer",
"io",
".",
"Writer",
")",
"error",
"{",
"return",
"g",
".",
"RenderWithFile",
"(",
"writer",
",",
"NewFile",
"(",
"\"",
"\"",
")",
")",
"\n",
"}"
] | // Render renders the Group to the provided writer. | [
"Render",
"renders",
"the",
"Group",
"to",
"the",
"provided",
"writer",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/group.go#L119-L121 | train |
dave/jennifer | jen/group.go | GoString | func (g *Group) GoString() string {
buf := bytes.Buffer{}
if err := g.Render(&buf); err != nil {
panic(err)
}
return buf.String()
} | go | func (g *Group) GoString() string {
buf := bytes.Buffer{}
if err := g.Render(&buf); err != nil {
panic(err)
}
return buf.String()
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"GoString",
"(",
")",
"string",
"{",
"buf",
":=",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"g",
".",
"Render",
"(",
"&",
"buf",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")"... | // GoString renders the Group for testing. Any error will cause a panic. | [
"GoString",
"renders",
"the",
"Group",
"for",
"testing",
".",
"Any",
"error",
"will",
"cause",
"a",
"panic",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/group.go#L124-L130 | train |
dave/jennifer | jen/group.go | RenderWithFile | func (g *Group) RenderWithFile(writer io.Writer, file *File) error {
buf := &bytes.Buffer{}
if err := g.render(file, buf, nil); err != nil {
return err
}
b, err := format.Source(buf.Bytes())
if err != nil {
return fmt.Errorf("Error %s while formatting source:\n%s", err, buf.String())
}
if _, err := writer.Write(b); err != nil {
return err
}
return nil
} | go | func (g *Group) RenderWithFile(writer io.Writer, file *File) error {
buf := &bytes.Buffer{}
if err := g.render(file, buf, nil); err != nil {
return err
}
b, err := format.Source(buf.Bytes())
if err != nil {
return fmt.Errorf("Error %s while formatting source:\n%s", err, buf.String())
}
if _, err := writer.Write(b); err != nil {
return err
}
return nil
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"RenderWithFile",
"(",
"writer",
"io",
".",
"Writer",
",",
"file",
"*",
"File",
")",
"error",
"{",
"buf",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"g",
".",
"render",
"(",
"file",
... | // RenderWithFile renders the Group to the provided writer, using imports from the provided file. | [
"RenderWithFile",
"renders",
"the",
"Group",
"to",
"the",
"provided",
"writer",
"using",
"imports",
"from",
"the",
"provided",
"file",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/group.go#L133-L146 | train |
dave/jennifer | jen/generated.go | Parens | func (g *Group) Parens(item Code) *Statement {
s := Parens(item)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Parens(item Code) *Statement {
s := Parens(item)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Parens",
"(",
"item",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Parens",
"(",
"item",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"... | // Parens renders a single item in parenthesis. Use for type conversion or to specify evaluation order. | [
"Parens",
"renders",
"a",
"single",
"item",
"in",
"parenthesis",
".",
"Use",
"for",
"type",
"conversion",
"or",
"to",
"specify",
"evaluation",
"order",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L11-L15 | train |
dave/jennifer | jen/generated.go | List | func (g *Group) List(items ...Code) *Statement {
s := List(items...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) List(items ...Code) *Statement {
s := List(items...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"List",
"(",
"items",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"List",
"(",
"items",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
... | // List renders a comma separated list. Use for multiple return functions. | [
"List",
"renders",
"a",
"comma",
"separated",
"list",
".",
"Use",
"for",
"multiple",
"return",
"functions",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L37-L41 | train |
dave/jennifer | jen/generated.go | ListFunc | func (g *Group) ListFunc(f func(*Group)) *Statement {
s := ListFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) ListFunc(f func(*Group)) *Statement {
s := ListFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"ListFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"ListFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
... | // ListFunc renders a comma separated list. Use for multiple return functions. | [
"ListFunc",
"renders",
"a",
"comma",
"separated",
"list",
".",
"Use",
"for",
"multiple",
"return",
"functions",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L63-L67 | train |
dave/jennifer | jen/generated.go | Values | func (g *Group) Values(values ...Code) *Statement {
s := Values(values...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Values(values ...Code) *Statement {
s := Values(values...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Values",
"(",
"values",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Values",
"(",
"values",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"retur... | // Values renders a comma separated list enclosed by curly braces. Use for slice or composite literals. | [
"Values",
"renders",
"a",
"comma",
"separated",
"list",
"enclosed",
"by",
"curly",
"braces",
".",
"Use",
"for",
"slice",
"or",
"composite",
"literals",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L89-L93 | train |
dave/jennifer | jen/generated.go | ValuesFunc | func (g *Group) ValuesFunc(f func(*Group)) *Statement {
s := ValuesFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) ValuesFunc(f func(*Group)) *Statement {
s := ValuesFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"ValuesFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"ValuesFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // ValuesFunc renders a comma separated list enclosed by curly braces. Use for slice or composite literals. | [
"ValuesFunc",
"renders",
"a",
"comma",
"separated",
"list",
"enclosed",
"by",
"curly",
"braces",
".",
"Use",
"for",
"slice",
"or",
"composite",
"literals",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L115-L119 | train |
dave/jennifer | jen/generated.go | DefsFunc | func (g *Group) DefsFunc(f func(*Group)) *Statement {
s := DefsFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) DefsFunc(f func(*Group)) *Statement {
s := DefsFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"DefsFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"DefsFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
... | // DefsFunc renders a statement list enclosed in parenthesis. Use for definition lists. | [
"DefsFunc",
"renders",
"a",
"statement",
"list",
"enclosed",
"in",
"parenthesis",
".",
"Use",
"for",
"definition",
"lists",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L271-L275 | train |
dave/jennifer | jen/generated.go | Call | func (g *Group) Call(params ...Code) *Statement {
s := Call(params...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Call(params ...Code) *Statement {
s := Call(params...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Call",
"(",
"params",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Call",
"(",
"params",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
... | // Call renders a comma separated list enclosed by parenthesis. Use for function calls. | [
"Call",
"renders",
"a",
"comma",
"separated",
"list",
"enclosed",
"by",
"parenthesis",
".",
"Use",
"for",
"function",
"calls",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L297-L301 | train |
dave/jennifer | jen/generated.go | ParamsFunc | func (g *Group) ParamsFunc(f func(*Group)) *Statement {
s := ParamsFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) ParamsFunc(f func(*Group)) *Statement {
s := ParamsFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"ParamsFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"ParamsFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // ParamsFunc renders a comma separated list enclosed by parenthesis. Use for function parameters and method receivers. | [
"ParamsFunc",
"renders",
"a",
"comma",
"separated",
"list",
"enclosed",
"by",
"parenthesis",
".",
"Use",
"for",
"function",
"parameters",
"and",
"method",
"receivers",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L375-L379 | train |
dave/jennifer | jen/generated.go | Assert | func (s *Statement) Assert(typ Code) *Statement {
g := &Group{
close: ")",
items: []Code{typ},
multi: false,
name: "assert",
open: ".(",
separator: "",
}
*s = append(*s, g)
return s
} | go | func (s *Statement) Assert(typ Code) *Statement {
g := &Group{
close: ")",
items: []Code{typ},
multi: false,
name: "assert",
open: ".(",
separator: "",
}
*s = append(*s, g)
return s
} | [
"func",
"(",
"s",
"*",
"Statement",
")",
"Assert",
"(",
"typ",
"Code",
")",
"*",
"Statement",
"{",
"g",
":=",
"&",
"Group",
"{",
"close",
":",
"\"",
"\"",
",",
"items",
":",
"[",
"]",
"Code",
"{",
"typ",
"}",
",",
"multi",
":",
"false",
",",
... | // Assert renders a period followed by a single item enclosed by parenthesis. Use for type assertions. | [
"Assert",
"renders",
"a",
"period",
"followed",
"by",
"a",
"single",
"item",
"enclosed",
"by",
"parenthesis",
".",
"Use",
"for",
"type",
"assertions",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L408-L419 | train |
dave/jennifer | jen/generated.go | If | func (g *Group) If(conditions ...Code) *Statement {
s := If(conditions...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) If(conditions ...Code) *Statement {
s := If(conditions...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"If",
"(",
"conditions",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"If",
"(",
"conditions",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"retur... | // If renders the keyword followed by a semicolon separated list. | [
"If",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"semicolon",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L453-L457 | train |
dave/jennifer | jen/generated.go | IfFunc | func (g *Group) IfFunc(f func(*Group)) *Statement {
s := IfFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) IfFunc(f func(*Group)) *Statement {
s := IfFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"IfFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"IfFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"r... | // IfFunc renders the keyword followed by a semicolon separated list. | [
"IfFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"semicolon",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L479-L483 | train |
dave/jennifer | jen/generated.go | Return | func (g *Group) Return(results ...Code) *Statement {
s := Return(results...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Return(results ...Code) *Statement {
s := Return(results...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Return",
"(",
"results",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Return",
"(",
"results",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"ret... | // Return renders the keyword followed by a comma separated list. | [
"Return",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"comma",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L505-L509 | train |
dave/jennifer | jen/generated.go | ReturnFunc | func (g *Group) ReturnFunc(f func(*Group)) *Statement {
s := ReturnFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) ReturnFunc(f func(*Group)) *Statement {
s := ReturnFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"ReturnFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"ReturnFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // ReturnFunc renders the keyword followed by a comma separated list. | [
"ReturnFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"comma",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L531-L535 | train |
dave/jennifer | jen/generated.go | ForFunc | func (g *Group) ForFunc(f func(*Group)) *Statement {
s := ForFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) ForFunc(f func(*Group)) *Statement {
s := ForFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"ForFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"ForFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
... | // ForFunc renders the keyword followed by a semicolon separated list. | [
"ForFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"semicolon",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L583-L587 | train |
dave/jennifer | jen/generated.go | SwitchFunc | func (g *Group) SwitchFunc(f func(*Group)) *Statement {
s := SwitchFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) SwitchFunc(f func(*Group)) *Statement {
s := SwitchFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"SwitchFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"SwitchFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // SwitchFunc renders the keyword followed by a semicolon separated list. | [
"SwitchFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"semicolon",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L635-L639 | train |
dave/jennifer | jen/generated.go | InterfaceFunc | func (g *Group) InterfaceFunc(f func(*Group)) *Statement {
s := InterfaceFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) InterfaceFunc(f func(*Group)) *Statement {
s := InterfaceFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"InterfaceFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"InterfaceFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")"... | // InterfaceFunc renders the keyword followed by a method list enclosed by curly braces. | [
"InterfaceFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"method",
"list",
"enclosed",
"by",
"curly",
"braces",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L687-L691 | train |
dave/jennifer | jen/generated.go | StructFunc | func (g *Group) StructFunc(f func(*Group)) *Statement {
s := StructFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) StructFunc(f func(*Group)) *Statement {
s := StructFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"StructFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"StructFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // StructFunc renders the keyword followed by a field list enclosed by curly braces. | [
"StructFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"field",
"list",
"enclosed",
"by",
"curly",
"braces",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L739-L743 | train |
dave/jennifer | jen/generated.go | Case | func (g *Group) Case(cases ...Code) *Statement {
s := Case(cases...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Case(cases ...Code) *Statement {
s := Case(cases...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Case",
"(",
"cases",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Case",
"(",
"cases",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
... | // Case renders the keyword followed by a comma separated list. | [
"Case",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"comma",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L765-L769 | train |
dave/jennifer | jen/generated.go | CaseFunc | func (g *Group) CaseFunc(f func(*Group)) *Statement {
s := CaseFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) CaseFunc(f func(*Group)) *Statement {
s := CaseFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"CaseFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"CaseFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
... | // CaseFunc renders the keyword followed by a comma separated list. | [
"CaseFunc",
"renders",
"the",
"keyword",
"followed",
"by",
"a",
"comma",
"separated",
"list",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L791-L795 | train |
dave/jennifer | jen/generated.go | AppendFunc | func (g *Group) AppendFunc(f func(*Group)) *Statement {
s := AppendFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) AppendFunc(f func(*Group)) *Statement {
s := AppendFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"AppendFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"AppendFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\... | // AppendFunc renders the append built-in function. | [
"AppendFunc",
"renders",
"the",
"append",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L843-L847 | train |
dave/jennifer | jen/generated.go | Cap | func (g *Group) Cap(v Code) *Statement {
s := Cap(v)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Cap(v Code) *Statement {
s := Cap(v)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Cap",
"(",
"v",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Cap",
"(",
"v",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Cap renders the cap built-in function. | [
"Cap",
"renders",
"the",
"cap",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L869-L873 | train |
dave/jennifer | jen/generated.go | Imag | func (g *Group) Imag(c Code) *Statement {
s := Imag(c)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Imag(c Code) *Statement {
s := Imag(c)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Imag",
"(",
"c",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Imag",
"(",
"c",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Imag renders the imag built-in function. | [
"Imag",
"renders",
"the",
"imag",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L999-L1003 | train |
dave/jennifer | jen/generated.go | New | func (g *Group) New(typ Code) *Statement {
s := New(typ)
g.items = append(g.items, s)
return s
} | go | func (g *Group) New(typ Code) *Statement {
s := New(typ)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"New",
"(",
"typ",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"New",
"(",
"typ",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // New renders the new built-in function. | [
"New",
"renders",
"the",
"new",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1077-L1081 | train |
dave/jennifer | jen/generated.go | Print | func (g *Group) Print(args ...Code) *Statement {
s := Print(args...)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Print(args ...Code) *Statement {
s := Print(args...)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Print",
"(",
"args",
"...",
"Code",
")",
"*",
"Statement",
"{",
"s",
":=",
"Print",
"(",
"args",
"...",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
... | // Print renders the print built-in function. | [
"Print",
"renders",
"the",
"print",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1129-L1133 | train |
dave/jennifer | jen/generated.go | PrintFunc | func (g *Group) PrintFunc(f func(*Group)) *Statement {
s := PrintFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) PrintFunc(f func(*Group)) *Statement {
s := PrintFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"PrintFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"PrintFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n"... | // PrintFunc renders the print built-in function. | [
"PrintFunc",
"renders",
"the",
"print",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1155-L1159 | train |
dave/jennifer | jen/generated.go | PrintlnFunc | func (g *Group) PrintlnFunc(f func(*Group)) *Statement {
s := PrintlnFunc(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) PrintlnFunc(f func(*Group)) *Statement {
s := PrintlnFunc(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"PrintlnFunc",
"(",
"f",
"func",
"(",
"*",
"Group",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"PrintlnFunc",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
... | // PrintlnFunc renders the println built-in function. | [
"PrintlnFunc",
"renders",
"the",
"println",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1207-L1211 | train |
dave/jennifer | jen/generated.go | Recover | func (g *Group) Recover() *Statement {
s := Recover()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Recover() *Statement {
s := Recover()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Recover",
"(",
")",
"*",
"Statement",
"{",
"s",
":=",
"Recover",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Recover renders the recover built-in function. | [
"Recover",
"renders",
"the",
"recover",
"built",
"-",
"in",
"function",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1259-L1263 | train |
dave/jennifer | jen/generated.go | Bool | func (g *Group) Bool() *Statement {
s := Bool()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Bool() *Statement {
s := Bool()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Bool",
"(",
")",
"*",
"Statement",
"{",
"s",
":=",
"Bool",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Bool renders the bool identifier. | [
"Bool",
"renders",
"the",
"bool",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1285-L1289 | train |
dave/jennifer | jen/generated.go | Byte | func (g *Group) Byte() *Statement {
// notest
s := Byte()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Byte() *Statement {
// notest
s := Byte()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Byte",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Byte",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Byte renders the byte identifier. | [
"Byte",
"renders",
"the",
"byte",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1308-L1313 | train |
dave/jennifer | jen/generated.go | Complex64 | func (g *Group) Complex64() *Statement {
// notest
s := Complex64()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Complex64() *Statement {
// notest
s := Complex64()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Complex64",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Complex64",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Complex64 renders the complex64 identifier. | [
"Complex64",
"renders",
"the",
"complex64",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1333-L1338 | train |
dave/jennifer | jen/generated.go | Complex128 | func (g *Group) Complex128() *Statement {
// notest
s := Complex128()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Complex128() *Statement {
// notest
s := Complex128()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Complex128",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Complex128",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Complex128 renders the complex128 identifier. | [
"Complex128",
"renders",
"the",
"complex128",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1358-L1363 | train |
dave/jennifer | jen/generated.go | Error | func (g *Group) Error() *Statement {
// notest
s := Error()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Error() *Statement {
// notest
s := Error()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Error",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Error",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Error renders the error identifier. | [
"Error",
"renders",
"the",
"error",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1383-L1388 | train |
dave/jennifer | jen/generated.go | Float32 | func (g *Group) Float32() *Statement {
// notest
s := Float32()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Float32() *Statement {
// notest
s := Float32()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Float32",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Float32",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Float32 renders the float32 identifier. | [
"Float32",
"renders",
"the",
"float32",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1408-L1413 | train |
dave/jennifer | jen/generated.go | Float64 | func (g *Group) Float64() *Statement {
// notest
s := Float64()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Float64() *Statement {
// notest
s := Float64()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Float64",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Float64",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Float64 renders the float64 identifier. | [
"Float64",
"renders",
"the",
"float64",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1433-L1438 | train |
dave/jennifer | jen/generated.go | Int8 | func (g *Group) Int8() *Statement {
// notest
s := Int8()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Int8() *Statement {
// notest
s := Int8()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Int8",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Int8",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Int8 renders the int8 identifier. | [
"Int8",
"renders",
"the",
"int8",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1483-L1488 | train |
dave/jennifer | jen/generated.go | Int16 | func (g *Group) Int16() *Statement {
// notest
s := Int16()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Int16() *Statement {
// notest
s := Int16()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Int16",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Int16",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Int16 renders the int16 identifier. | [
"Int16",
"renders",
"the",
"int16",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1508-L1513 | train |
dave/jennifer | jen/generated.go | Int32 | func (g *Group) Int32() *Statement {
// notest
s := Int32()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Int32() *Statement {
// notest
s := Int32()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Int32",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Int32",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Int32 renders the int32 identifier. | [
"Int32",
"renders",
"the",
"int32",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1533-L1538 | train |
dave/jennifer | jen/generated.go | Int64 | func (g *Group) Int64() *Statement {
// notest
s := Int64()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Int64() *Statement {
// notest
s := Int64()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Int64",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Int64",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Int64 renders the int64 identifier. | [
"Int64",
"renders",
"the",
"int64",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1558-L1563 | train |
dave/jennifer | jen/generated.go | Rune | func (g *Group) Rune() *Statement {
// notest
s := Rune()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Rune() *Statement {
// notest
s := Rune()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Rune",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Rune",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Rune renders the rune identifier. | [
"Rune",
"renders",
"the",
"rune",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1583-L1588 | train |
dave/jennifer | jen/generated.go | String | func (g *Group) String() *Statement {
// notest
s := String()
g.items = append(g.items, s)
return s
} | go | func (g *Group) String() *Statement {
// notest
s := String()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"String",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"String",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // String renders the string identifier. | [
"String",
"renders",
"the",
"string",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1608-L1613 | train |
dave/jennifer | jen/generated.go | Uint | func (g *Group) Uint() *Statement {
// notest
s := Uint()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uint() *Statement {
// notest
s := Uint()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uint",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uint",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uint renders the uint identifier. | [
"Uint",
"renders",
"the",
"uint",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1633-L1638 | train |
dave/jennifer | jen/generated.go | Uint8 | func (g *Group) Uint8() *Statement {
// notest
s := Uint8()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uint8() *Statement {
// notest
s := Uint8()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uint8",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uint8",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uint8 renders the uint8 identifier. | [
"Uint8",
"renders",
"the",
"uint8",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1658-L1663 | train |
dave/jennifer | jen/generated.go | Uint16 | func (g *Group) Uint16() *Statement {
// notest
s := Uint16()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uint16() *Statement {
// notest
s := Uint16()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uint16",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uint16",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uint16 renders the uint16 identifier. | [
"Uint16",
"renders",
"the",
"uint16",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1683-L1688 | train |
dave/jennifer | jen/generated.go | Uint32 | func (g *Group) Uint32() *Statement {
// notest
s := Uint32()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uint32() *Statement {
// notest
s := Uint32()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uint32",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uint32",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uint32 renders the uint32 identifier. | [
"Uint32",
"renders",
"the",
"uint32",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1708-L1713 | train |
dave/jennifer | jen/generated.go | Uint64 | func (g *Group) Uint64() *Statement {
// notest
s := Uint64()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uint64() *Statement {
// notest
s := Uint64()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uint64",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uint64",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uint64 renders the uint64 identifier. | [
"Uint64",
"renders",
"the",
"uint64",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1733-L1738 | train |
dave/jennifer | jen/generated.go | Uintptr | func (g *Group) Uintptr() *Statement {
// notest
s := Uintptr()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Uintptr() *Statement {
// notest
s := Uintptr()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Uintptr",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Uintptr",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Uintptr renders the uintptr identifier. | [
"Uintptr",
"renders",
"the",
"uintptr",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1758-L1763 | train |
dave/jennifer | jen/generated.go | True | func (g *Group) True() *Statement {
// notest
s := True()
g.items = append(g.items, s)
return s
} | go | func (g *Group) True() *Statement {
// notest
s := True()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"True",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"True",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // True renders the true identifier. | [
"True",
"renders",
"the",
"true",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1783-L1788 | train |
dave/jennifer | jen/generated.go | False | func (g *Group) False() *Statement {
// notest
s := False()
g.items = append(g.items, s)
return s
} | go | func (g *Group) False() *Statement {
// notest
s := False()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"False",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"False",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // False renders the false identifier. | [
"False",
"renders",
"the",
"false",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1808-L1813 | train |
dave/jennifer | jen/generated.go | Iota | func (g *Group) Iota() *Statement {
// notest
s := Iota()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Iota() *Statement {
// notest
s := Iota()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Iota",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Iota",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Iota renders the iota identifier. | [
"Iota",
"renders",
"the",
"iota",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1833-L1838 | train |
dave/jennifer | jen/generated.go | Nil | func (g *Group) Nil() *Statement {
// notest
s := Nil()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Nil() *Statement {
// notest
s := Nil()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Nil",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Nil",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Nil renders the nil identifier. | [
"Nil",
"renders",
"the",
"nil",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1858-L1863 | train |
dave/jennifer | jen/generated.go | Err | func (g *Group) Err() *Statement {
// notest
s := Err()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Err() *Statement {
// notest
s := Err()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Err",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Err",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Err renders the err identifier. | [
"Err",
"renders",
"the",
"err",
"identifier",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1883-L1888 | train |
dave/jennifer | jen/generated.go | Break | func (g *Group) Break() *Statement {
// notest
s := Break()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Break() *Statement {
// notest
s := Break()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Break",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Break",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Break renders the break keyword. | [
"Break",
"renders",
"the",
"break",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1908-L1913 | train |
dave/jennifer | jen/generated.go | Default | func (g *Group) Default() *Statement {
// notest
s := Default()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Default() *Statement {
// notest
s := Default()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Default",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Default",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Default renders the default keyword. | [
"Default",
"renders",
"the",
"default",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1933-L1938 | train |
dave/jennifer | jen/generated.go | Func | func (g *Group) Func() *Statement {
// notest
s := Func()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Func() *Statement {
// notest
s := Func()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Func",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Func",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Func renders the func keyword. | [
"Func",
"renders",
"the",
"func",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1958-L1963 | train |
dave/jennifer | jen/generated.go | Select | func (g *Group) Select() *Statement {
// notest
s := Select()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Select() *Statement {
// notest
s := Select()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Select",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Select",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Select renders the select keyword. | [
"Select",
"renders",
"the",
"select",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L1983-L1988 | train |
dave/jennifer | jen/generated.go | Chan | func (g *Group) Chan() *Statement {
// notest
s := Chan()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Chan() *Statement {
// notest
s := Chan()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Chan",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Chan",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Chan renders the chan keyword. | [
"Chan",
"renders",
"the",
"chan",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2008-L2013 | train |
dave/jennifer | jen/generated.go | Else | func (g *Group) Else() *Statement {
// notest
s := Else()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Else() *Statement {
// notest
s := Else()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Else",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Else",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Else renders the else keyword. | [
"Else",
"renders",
"the",
"else",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2033-L2038 | train |
dave/jennifer | jen/generated.go | Const | func (g *Group) Const() *Statement {
// notest
s := Const()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Const() *Statement {
// notest
s := Const()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Const",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Const",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Const renders the const keyword. | [
"Const",
"renders",
"the",
"const",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2058-L2063 | train |
dave/jennifer | jen/generated.go | Fallthrough | func (g *Group) Fallthrough() *Statement {
// notest
s := Fallthrough()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Fallthrough() *Statement {
// notest
s := Fallthrough()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Fallthrough",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Fallthrough",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Fallthrough renders the fallthrough keyword. | [
"Fallthrough",
"renders",
"the",
"fallthrough",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2083-L2088 | train |
dave/jennifer | jen/generated.go | Type | func (g *Group) Type() *Statement {
// notest
s := Type()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Type() *Statement {
// notest
s := Type()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Type",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Type",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Type renders the type keyword. | [
"Type",
"renders",
"the",
"type",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2108-L2113 | train |
dave/jennifer | jen/generated.go | Continue | func (g *Group) Continue() *Statement {
// notest
s := Continue()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Continue() *Statement {
// notest
s := Continue()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Continue",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Continue",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Continue renders the continue keyword. | [
"Continue",
"renders",
"the",
"continue",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2133-L2138 | train |
dave/jennifer | jen/generated.go | Var | func (g *Group) Var() *Statement {
// notest
s := Var()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Var() *Statement {
// notest
s := Var()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Var",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Var",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Var renders the var keyword. | [
"Var",
"renders",
"the",
"var",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2158-L2163 | train |
dave/jennifer | jen/generated.go | Goto | func (g *Group) Goto() *Statement {
// notest
s := Goto()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Goto() *Statement {
// notest
s := Goto()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Goto",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Goto",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Goto renders the goto keyword. | [
"Goto",
"renders",
"the",
"goto",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2183-L2188 | train |
dave/jennifer | jen/generated.go | Defer | func (g *Group) Defer() *Statement {
// notest
s := Defer()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Defer() *Statement {
// notest
s := Defer()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Defer",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Defer",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Defer renders the defer keyword. | [
"Defer",
"renders",
"the",
"defer",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2208-L2213 | train |
dave/jennifer | jen/generated.go | Go | func (g *Group) Go() *Statement {
// notest
s := Go()
g.items = append(g.items, s)
return s
} | go | func (g *Group) Go() *Statement {
// notest
s := Go()
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Go",
"(",
")",
"*",
"Statement",
"{",
"// notest",
"s",
":=",
"Go",
"(",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Go renders the go keyword. | [
"Go",
"renders",
"the",
"go",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/generated.go#L2233-L2238 | train |
dave/jennifer | jen/file.go | NewFile | func NewFile(packageName string) *File {
return &File{
Group: &Group{
multi: true,
},
name: packageName,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | go | func NewFile(packageName string) *File {
return &File{
Group: &Group{
multi: true,
},
name: packageName,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | [
"func",
"NewFile",
"(",
"packageName",
"string",
")",
"*",
"File",
"{",
"return",
"&",
"File",
"{",
"Group",
":",
"&",
"Group",
"{",
"multi",
":",
"true",
",",
"}",
",",
"name",
":",
"packageName",
",",
"imports",
":",
"map",
"[",
"string",
"]",
"i... | // NewFile Creates a new file, with the specified package name. | [
"NewFile",
"Creates",
"a",
"new",
"file",
"with",
"the",
"specified",
"package",
"name",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L11-L20 | train |
dave/jennifer | jen/file.go | NewFilePath | func NewFilePath(packagePath string) *File {
return &File{
Group: &Group{
multi: true,
},
name: guessAlias(packagePath),
path: packagePath,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | go | func NewFilePath(packagePath string) *File {
return &File{
Group: &Group{
multi: true,
},
name: guessAlias(packagePath),
path: packagePath,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | [
"func",
"NewFilePath",
"(",
"packagePath",
"string",
")",
"*",
"File",
"{",
"return",
"&",
"File",
"{",
"Group",
":",
"&",
"Group",
"{",
"multi",
":",
"true",
",",
"}",
",",
"name",
":",
"guessAlias",
"(",
"packagePath",
")",
",",
"path",
":",
"packa... | // NewFilePath creates a new file while specifying the package path - the
// package name is inferred from the path. | [
"NewFilePath",
"creates",
"a",
"new",
"file",
"while",
"specifying",
"the",
"package",
"path",
"-",
"the",
"package",
"name",
"is",
"inferred",
"from",
"the",
"path",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L24-L34 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.