id
int32 0
167k
| 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
sequencelengths 21
1.41k
| docstring
stringlengths 6
2.61k
| docstring_tokens
sequencelengths 3
215
| sha
stringlengths 40
40
| url
stringlengths 85
252
|
---|---|---|---|---|---|---|---|---|---|---|---|
153,100 | 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",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"source",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"len",
"(",
"f",
".",
"headers",
")",
">",
"0",
"{",
"for",
"_",
",",
"c",
":=",
"range",
"f",
".",
"headers",
"{",
"if",
"err",
":=",
"Comment",
"(",
"c",
")",
".",
"render",
"(",
"f",
",",
"source",
",",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"source",
",",
"\"",
"\\n",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"// 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",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"_",
",",
"c",
":=",
"range",
"f",
".",
"comments",
"{",
"if",
"err",
":=",
"Comment",
"(",
"c",
")",
".",
"render",
"(",
"f",
",",
"source",
",",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"source",
",",
"\"",
"\\n",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprintf",
"(",
"source",
",",
"\"",
"\"",
",",
"f",
".",
"name",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"f",
".",
"CanonicalPath",
"!=",
"\"",
"\"",
"{",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprintf",
"(",
"source",
",",
"\"",
"\"",
",",
"f",
".",
"CanonicalPath",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"fmt",
".",
"Fprint",
"(",
"source",
",",
"\"",
"\\n",
"\\n",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"err",
":=",
"f",
".",
"renderImports",
"(",
"source",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"source",
".",
"Write",
"(",
"body",
".",
"Bytes",
"(",
")",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"formatted",
",",
"err",
":=",
"format",
".",
"Source",
"(",
"source",
".",
"Bytes",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\\n",
"\"",
",",
"err",
",",
"source",
".",
"String",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"w",
".",
"Write",
"(",
"formatted",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // 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 |
153,101 | 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 |
153,102 | 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",
")",
"\n",
"}",
"\n",
"return",
"buf",
".",
"String",
"(",
")",
"\n",
"}"
] | // 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 |
153,103 | 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 |
153,104 | 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",
")",
"\n",
"}",
"\n",
"return",
"buf",
".",
"String",
"(",
")",
"\n",
"}"
] | // 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 |
153,105 | 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",
",",
"buf",
",",
"nil",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"b",
",",
"err",
":=",
"format",
".",
"Source",
"(",
"buf",
".",
"Bytes",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\\n",
"\"",
",",
"err",
",",
"buf",
".",
"String",
"(",
")",
")",
"\n",
"}",
"\n",
"if",
"_",
",",
"err",
":=",
"writer",
".",
"Write",
"(",
"b",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // 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 |
153,106 | 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 |
153,107 | 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",
"s",
"\n",
"}"
] | // 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 |
153,108 | 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",
"return",
"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 |
153,109 | 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",
"return",
"s",
"\n",
"}"
] | // 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 |
153,110 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,111 | 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",
"return",
"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 |
153,112 | 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",
"s",
"\n",
"}"
] | // 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 |
153,113 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,114 | 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",
",",
"name",
":",
"\"",
"\"",
",",
"open",
":",
"\"",
"\"",
",",
"separator",
":",
"\"",
"\"",
",",
"}",
"\n",
"*",
"s",
"=",
"append",
"(",
"*",
"s",
",",
"g",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,115 | 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",
"return",
"s",
"\n",
"}"
] | // 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 |
153,116 | 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",
"return",
"s",
"\n",
"}"
] | // 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 |
153,117 | 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",
"return",
"s",
"\n",
"}"
] | // 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 |
153,118 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,119 | 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",
"return",
"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 |
153,120 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,121 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,122 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,123 | 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",
"s",
"\n",
"}"
] | // 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 |
153,124 | 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",
"return",
"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 |
153,125 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,126 | 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 |
153,127 | 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 |
153,128 | 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 |
153,129 | 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",
"s",
"\n",
"}"
] | // 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 |
153,130 | 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",
"return",
"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 |
153,131 | 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",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // 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 |
153,132 | 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 |
153,133 | 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 |
153,134 | 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 |
153,135 | 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 |
153,136 | 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 |
153,137 | 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 |
153,138 | 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 |
153,139 | 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 |
153,140 | 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 |
153,141 | 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 |
153,142 | 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 |
153,143 | 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 |
153,144 | 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 |
153,145 | 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 |
153,146 | 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 |
153,147 | 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 |
153,148 | 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 |
153,149 | 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 |
153,150 | 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 |
153,151 | 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 |
153,152 | 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 |
153,153 | 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 |
153,154 | 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 |
153,155 | 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 |
153,156 | 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 |
153,157 | 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 |
153,158 | 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 |
153,159 | 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 |
153,160 | 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 |
153,161 | 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 |
153,162 | 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 |
153,163 | 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 |
153,164 | 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 |
153,165 | 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 |
153,166 | 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 |
153,167 | 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 |
153,168 | 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 |
153,169 | 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 |
153,170 | 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 |
153,171 | 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",
"]",
"importdef",
"{",
"}",
",",
"hints",
":",
"map",
"[",
"string",
"]",
"importdef",
"{",
"}",
",",
"}",
"\n",
"}"
] | // 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 |
153,172 | 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",
":",
"packagePath",
",",
"imports",
":",
"map",
"[",
"string",
"]",
"importdef",
"{",
"}",
",",
"hints",
":",
"map",
"[",
"string",
"]",
"importdef",
"{",
"}",
",",
"}",
"\n",
"}"
] | // 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 |
153,173 | dave/jennifer | jen/file.go | NewFilePathName | func NewFilePathName(packagePath, packageName string) *File {
return &File{
Group: &Group{
multi: true,
},
name: packageName,
path: packagePath,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | go | func NewFilePathName(packagePath, packageName string) *File {
return &File{
Group: &Group{
multi: true,
},
name: packageName,
path: packagePath,
imports: map[string]importdef{},
hints: map[string]importdef{},
}
} | [
"func",
"NewFilePathName",
"(",
"packagePath",
",",
"packageName",
"string",
")",
"*",
"File",
"{",
"return",
"&",
"File",
"{",
"Group",
":",
"&",
"Group",
"{",
"multi",
":",
"true",
",",
"}",
",",
"name",
":",
"packageName",
",",
"path",
":",
"packagePath",
",",
"imports",
":",
"map",
"[",
"string",
"]",
"importdef",
"{",
"}",
",",
"hints",
":",
"map",
"[",
"string",
"]",
"importdef",
"{",
"}",
",",
"}",
"\n",
"}"
] | // NewFilePathName creates a new file with the specified package path and name. | [
"NewFilePathName",
"creates",
"a",
"new",
"file",
"with",
"the",
"specified",
"package",
"path",
"and",
"name",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L37-L47 |
153,174 | dave/jennifer | jen/file.go | HeaderComment | func (f *File) HeaderComment(comment string) {
f.headers = append(f.headers, comment)
} | go | func (f *File) HeaderComment(comment string) {
f.headers = append(f.headers, comment)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"HeaderComment",
"(",
"comment",
"string",
")",
"{",
"f",
".",
"headers",
"=",
"append",
"(",
"f",
".",
"headers",
",",
"comment",
")",
"\n",
"}"
] | // HeaderComment adds a comment to the top of the file, above any package
// comments. A blank line is rendered below the header comments, ensuring
// header comments are not included in the package doc. | [
"HeaderComment",
"adds",
"a",
"comment",
"to",
"the",
"top",
"of",
"the",
"file",
"above",
"any",
"package",
"comments",
".",
"A",
"blank",
"line",
"is",
"rendered",
"below",
"the",
"header",
"comments",
"ensuring",
"header",
"comments",
"are",
"not",
"included",
"in",
"the",
"package",
"doc",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L79-L81 |
153,175 | dave/jennifer | jen/file.go | PackageComment | func (f *File) PackageComment(comment string) {
f.comments = append(f.comments, comment)
} | go | func (f *File) PackageComment(comment string) {
f.comments = append(f.comments, comment)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"PackageComment",
"(",
"comment",
"string",
")",
"{",
"f",
".",
"comments",
"=",
"append",
"(",
"f",
".",
"comments",
",",
"comment",
")",
"\n",
"}"
] | // PackageComment adds a comment to the top of the file, above the package
// keyword. | [
"PackageComment",
"adds",
"a",
"comment",
"to",
"the",
"top",
"of",
"the",
"file",
"above",
"the",
"package",
"keyword",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L85-L87 |
153,176 | dave/jennifer | jen/file.go | CgoPreamble | func (f *File) CgoPreamble(comment string) {
f.cgoPreamble = append(f.cgoPreamble, comment)
} | go | func (f *File) CgoPreamble(comment string) {
f.cgoPreamble = append(f.cgoPreamble, comment)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"CgoPreamble",
"(",
"comment",
"string",
")",
"{",
"f",
".",
"cgoPreamble",
"=",
"append",
"(",
"f",
".",
"cgoPreamble",
",",
"comment",
")",
"\n",
"}"
] | // CgoPreamble adds a cgo preamble comment that is rendered directly before the "C" pseudo-package
// import. | [
"CgoPreamble",
"adds",
"a",
"cgo",
"preamble",
"comment",
"that",
"is",
"rendered",
"directly",
"before",
"the",
"C",
"pseudo",
"-",
"package",
"import",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L91-L93 |
153,177 | dave/jennifer | jen/file.go | Anon | func (f *File) Anon(paths ...string) {
for _, p := range paths {
f.imports[p] = importdef{name: "_", alias: true}
}
} | go | func (f *File) Anon(paths ...string) {
for _, p := range paths {
f.imports[p] = importdef{name: "_", alias: true}
}
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Anon",
"(",
"paths",
"...",
"string",
")",
"{",
"for",
"_",
",",
"p",
":=",
"range",
"paths",
"{",
"f",
".",
"imports",
"[",
"p",
"]",
"=",
"importdef",
"{",
"name",
":",
"\"",
"\"",
",",
"alias",
":",
"true",
"}",
"\n",
"}",
"\n",
"}"
] | // Anon adds an anonymous import. | [
"Anon",
"adds",
"an",
"anonymous",
"import",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L96-L100 |
153,178 | dave/jennifer | jen/file.go | ImportName | func (f *File) ImportName(path, name string) {
f.hints[path] = importdef{name: name, alias: false}
} | go | func (f *File) ImportName(path, name string) {
f.hints[path] = importdef{name: name, alias: false}
} | [
"func",
"(",
"f",
"*",
"File",
")",
"ImportName",
"(",
"path",
",",
"name",
"string",
")",
"{",
"f",
".",
"hints",
"[",
"path",
"]",
"=",
"importdef",
"{",
"name",
":",
"name",
",",
"alias",
":",
"false",
"}",
"\n",
"}"
] | // ImportName provides the package name for a path. If specified, the alias will be omitted from the
// import block. This is optional. If not specified, a sensible package name is used based on the path
// and this is added as an alias in the import block. | [
"ImportName",
"provides",
"the",
"package",
"name",
"for",
"a",
"path",
".",
"If",
"specified",
"the",
"alias",
"will",
"be",
"omitted",
"from",
"the",
"import",
"block",
".",
"This",
"is",
"optional",
".",
"If",
"not",
"specified",
"a",
"sensible",
"package",
"name",
"is",
"used",
"based",
"on",
"the",
"path",
"and",
"this",
"is",
"added",
"as",
"an",
"alias",
"in",
"the",
"import",
"block",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L105-L107 |
153,179 | dave/jennifer | jen/file.go | ImportAlias | func (f *File) ImportAlias(path, alias string) {
f.hints[path] = importdef{name: alias, alias: true}
} | go | func (f *File) ImportAlias(path, alias string) {
f.hints[path] = importdef{name: alias, alias: true}
} | [
"func",
"(",
"f",
"*",
"File",
")",
"ImportAlias",
"(",
"path",
",",
"alias",
"string",
")",
"{",
"f",
".",
"hints",
"[",
"path",
"]",
"=",
"importdef",
"{",
"name",
":",
"alias",
",",
"alias",
":",
"true",
"}",
"\n",
"}"
] | // ImportAlias provides the alias for a package path that should be used in the import block. A
// period can be used to force a dot-import. | [
"ImportAlias",
"provides",
"the",
"alias",
"for",
"a",
"package",
"path",
"that",
"should",
"be",
"used",
"in",
"the",
"import",
"block",
".",
"A",
"period",
"can",
"be",
"used",
"to",
"force",
"a",
"dot",
"-",
"import",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L119-L121 |
153,180 | dave/jennifer | jen/file.go | GoString | func (f *File) GoString() string {
buf := &bytes.Buffer{}
if err := f.Render(buf); err != nil {
panic(err)
}
return buf.String()
} | go | func (f *File) GoString() string {
buf := &bytes.Buffer{}
if err := f.Render(buf); err != nil {
panic(err)
}
return buf.String()
} | [
"func",
"(",
"f",
"*",
"File",
")",
"GoString",
"(",
")",
"string",
"{",
"buf",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"if",
"err",
":=",
"f",
".",
"Render",
"(",
"buf",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"buf",
".",
"String",
"(",
")",
"\n",
"}"
] | // GoString renders the File for testing. Any error will cause a panic. | [
"GoString",
"renders",
"the",
"File",
"for",
"testing",
".",
"Any",
"error",
"will",
"cause",
"a",
"panic",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/file.go#L232-L238 |
153,181 | dave/jennifer | jen/do.go | Do | func (g *Group) Do(f func(*Statement)) *Statement {
s := Do(f)
g.items = append(g.items, s)
return s
} | go | func (g *Group) Do(f func(*Statement)) *Statement {
s := Do(f)
g.items = append(g.items, s)
return s
} | [
"func",
"(",
"g",
"*",
"Group",
")",
"Do",
"(",
"f",
"func",
"(",
"*",
"Statement",
")",
")",
"*",
"Statement",
"{",
"s",
":=",
"Do",
"(",
"f",
")",
"\n",
"g",
".",
"items",
"=",
"append",
"(",
"g",
".",
"items",
",",
"s",
")",
"\n",
"return",
"s",
"\n",
"}"
] | // Do calls the provided function with the statement as a parameter. Use for
// embedding logic. | [
"Do",
"calls",
"the",
"provided",
"function",
"with",
"the",
"statement",
"as",
"a",
"parameter",
".",
"Use",
"for",
"embedding",
"logic",
"."
] | 14e399b6b5e8456c66c45c955fc27b568bacb5c9 | https://github.com/dave/jennifer/blob/14e399b6b5e8456c66c45c955fc27b568bacb5c9/jen/do.go#L11-L15 |
153,182 | anaskhan96/soup | soup.go | GetWithClient | func GetWithClient(url string, client *http.Client) (string, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
if debug {
panic("Couldn't perform GET request to " + url)
}
return "", errors.New("couldn't perform GET request to " + url)
}
// Set headers
for hName, hValue := range Headers {
req.Header.Set(hName, hValue)
}
// Set cookies
for cName, cValue := range Cookies {
req.AddCookie(&http.Cookie{
Name: cName,
Value: cValue,
})
}
// Perform request
resp, err := client.Do(req)
if err != nil {
if debug {
panic("Couldn't perform GET request to " + url)
}
return "", errors.New("couldn't perform GET request to " + url)
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
if debug {
panic("Unable to read the response body")
}
return "", errors.New("unable to read the response body")
}
return string(bytes), nil
} | go | func GetWithClient(url string, client *http.Client) (string, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
if debug {
panic("Couldn't perform GET request to " + url)
}
return "", errors.New("couldn't perform GET request to " + url)
}
// Set headers
for hName, hValue := range Headers {
req.Header.Set(hName, hValue)
}
// Set cookies
for cName, cValue := range Cookies {
req.AddCookie(&http.Cookie{
Name: cName,
Value: cValue,
})
}
// Perform request
resp, err := client.Do(req)
if err != nil {
if debug {
panic("Couldn't perform GET request to " + url)
}
return "", errors.New("couldn't perform GET request to " + url)
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
if debug {
panic("Unable to read the response body")
}
return "", errors.New("unable to read the response body")
}
return string(bytes), nil
} | [
"func",
"GetWithClient",
"(",
"url",
"string",
",",
"client",
"*",
"http",
".",
"Client",
")",
"(",
"string",
",",
"error",
")",
"{",
"req",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"url",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"url",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"url",
")",
"\n",
"}",
"\n",
"// Set headers",
"for",
"hName",
",",
"hValue",
":=",
"range",
"Headers",
"{",
"req",
".",
"Header",
".",
"Set",
"(",
"hName",
",",
"hValue",
")",
"\n",
"}",
"\n",
"// Set cookies",
"for",
"cName",
",",
"cValue",
":=",
"range",
"Cookies",
"{",
"req",
".",
"AddCookie",
"(",
"&",
"http",
".",
"Cookie",
"{",
"Name",
":",
"cName",
",",
"Value",
":",
"cValue",
",",
"}",
")",
"\n",
"}",
"\n",
"// Perform request",
"resp",
",",
"err",
":=",
"client",
".",
"Do",
"(",
"req",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"url",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"url",
")",
"\n",
"}",
"\n",
"defer",
"resp",
".",
"Body",
".",
"Close",
"(",
")",
"\n",
"bytes",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"resp",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"string",
"(",
"bytes",
")",
",",
"nil",
"\n",
"}"
] | // GetWithClient returns the HTML returned by the url using a provided HTTP client | [
"GetWithClient",
"returns",
"the",
"HTML",
"returned",
"by",
"the",
"url",
"using",
"a",
"provided",
"HTTP",
"client"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L50-L86 |
153,183 | anaskhan96/soup | soup.go | Get | func Get(url string) (string, error) {
// Init a new HTTP client
client := &http.Client{}
return GetWithClient(url, client)
} | go | func Get(url string) (string, error) {
// Init a new HTTP client
client := &http.Client{}
return GetWithClient(url, client)
} | [
"func",
"Get",
"(",
"url",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"// Init a new HTTP client",
"client",
":=",
"&",
"http",
".",
"Client",
"{",
"}",
"\n",
"return",
"GetWithClient",
"(",
"url",
",",
"client",
")",
"\n",
"}"
] | // Get returns the HTML returned by the url in string using the default HTTP client | [
"Get",
"returns",
"the",
"HTML",
"returned",
"by",
"the",
"url",
"in",
"string",
"using",
"the",
"default",
"HTTP",
"client"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L89-L93 |
153,184 | anaskhan96/soup | soup.go | HTMLParse | func HTMLParse(s string) Root {
r, err := html.Parse(strings.NewReader(s))
if err != nil {
if debug {
panic("Unable to parse the HTML")
}
return Root{nil, "", errors.New("unable to parse the HTML")}
}
for r.Type != html.ElementNode {
switch r.Type {
case html.DocumentNode:
r = r.FirstChild
case html.DoctypeNode:
r = r.NextSibling
case html.CommentNode:
r = r.NextSibling
}
}
return Root{r, r.Data, nil}
} | go | func HTMLParse(s string) Root {
r, err := html.Parse(strings.NewReader(s))
if err != nil {
if debug {
panic("Unable to parse the HTML")
}
return Root{nil, "", errors.New("unable to parse the HTML")}
}
for r.Type != html.ElementNode {
switch r.Type {
case html.DocumentNode:
r = r.FirstChild
case html.DoctypeNode:
r = r.NextSibling
case html.CommentNode:
r = r.NextSibling
}
}
return Root{r, r.Data, nil}
} | [
"func",
"HTMLParse",
"(",
"s",
"string",
")",
"Root",
"{",
"r",
",",
"err",
":=",
"html",
".",
"Parse",
"(",
"strings",
".",
"NewReader",
"(",
"s",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"for",
"r",
".",
"Type",
"!=",
"html",
".",
"ElementNode",
"{",
"switch",
"r",
".",
"Type",
"{",
"case",
"html",
".",
"DocumentNode",
":",
"r",
"=",
"r",
".",
"FirstChild",
"\n",
"case",
"html",
".",
"DoctypeNode",
":",
"r",
"=",
"r",
".",
"NextSibling",
"\n",
"case",
"html",
".",
"CommentNode",
":",
"r",
"=",
"r",
".",
"NextSibling",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"r",
",",
"r",
".",
"Data",
",",
"nil",
"}",
"\n",
"}"
] | // HTMLParse parses the HTML returning a start pointer to the DOM | [
"HTMLParse",
"parses",
"the",
"HTML",
"returning",
"a",
"start",
"pointer",
"to",
"the",
"DOM"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L96-L115 |
153,185 | anaskhan96/soup | soup.go | Find | func (r Root) Find(args ...string) Root {
temp, ok := findOnce(r.Pointer, args, false, false)
if ok == false {
if debug {
panic("Element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")
}
return Root{nil, "", errors.New("element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")}
}
return Root{temp, temp.Data, nil}
} | go | func (r Root) Find(args ...string) Root {
temp, ok := findOnce(r.Pointer, args, false, false)
if ok == false {
if debug {
panic("Element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")
}
return Root{nil, "", errors.New("element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")}
}
return Root{temp, temp.Data, nil}
} | [
"func",
"(",
"r",
"Root",
")",
"Find",
"(",
"args",
"...",
"string",
")",
"Root",
"{",
"temp",
",",
"ok",
":=",
"findOnce",
"(",
"r",
".",
"Pointer",
",",
"args",
",",
"false",
",",
"false",
")",
"\n",
"if",
"ok",
"==",
"false",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"args",
"[",
"0",
"]",
"+",
"\"",
"\"",
"+",
"strings",
".",
"Join",
"(",
"args",
"[",
"1",
":",
"]",
",",
"\"",
"\"",
")",
"+",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"args",
"[",
"0",
"]",
"+",
"\"",
"\"",
"+",
"strings",
".",
"Join",
"(",
"args",
"[",
"1",
":",
"]",
",",
"\"",
"\"",
")",
"+",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"temp",
",",
"temp",
".",
"Data",
",",
"nil",
"}",
"\n",
"}"
] | // Find finds the first occurrence of the given tag name,
// with or without attribute key and value specified,
// and returns a struct with a pointer to it | [
"Find",
"finds",
"the",
"first",
"occurrence",
"of",
"the",
"given",
"tag",
"name",
"with",
"or",
"without",
"attribute",
"key",
"and",
"value",
"specified",
"and",
"returns",
"a",
"struct",
"with",
"a",
"pointer",
"to",
"it"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L120-L129 |
153,186 | anaskhan96/soup | soup.go | FindAll | func (r Root) FindAll(args ...string) []Root {
temp := findAllofem(r.Pointer, args, false)
if len(temp) == 0 {
if debug {
panic("Element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")
}
return []Root{}
}
pointers := make([]Root, 0, len(temp))
for i := 0; i < len(temp); i++ {
pointers = append(pointers, Root{temp[i], temp[i].Data, nil})
}
return pointers
} | go | func (r Root) FindAll(args ...string) []Root {
temp := findAllofem(r.Pointer, args, false)
if len(temp) == 0 {
if debug {
panic("Element `" + args[0] + "` with attributes `" + strings.Join(args[1:], " ") + "` not found")
}
return []Root{}
}
pointers := make([]Root, 0, len(temp))
for i := 0; i < len(temp); i++ {
pointers = append(pointers, Root{temp[i], temp[i].Data, nil})
}
return pointers
} | [
"func",
"(",
"r",
"Root",
")",
"FindAll",
"(",
"args",
"...",
"string",
")",
"[",
"]",
"Root",
"{",
"temp",
":=",
"findAllofem",
"(",
"r",
".",
"Pointer",
",",
"args",
",",
"false",
")",
"\n",
"if",
"len",
"(",
"temp",
")",
"==",
"0",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
"+",
"args",
"[",
"0",
"]",
"+",
"\"",
"\"",
"+",
"strings",
".",
"Join",
"(",
"args",
"[",
"1",
":",
"]",
",",
"\"",
"\"",
")",
"+",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"[",
"]",
"Root",
"{",
"}",
"\n",
"}",
"\n",
"pointers",
":=",
"make",
"(",
"[",
"]",
"Root",
",",
"0",
",",
"len",
"(",
"temp",
")",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"temp",
")",
";",
"i",
"++",
"{",
"pointers",
"=",
"append",
"(",
"pointers",
",",
"Root",
"{",
"temp",
"[",
"i",
"]",
",",
"temp",
"[",
"i",
"]",
".",
"Data",
",",
"nil",
"}",
")",
"\n",
"}",
"\n",
"return",
"pointers",
"\n",
"}"
] | // FindAll finds all occurrences of the given tag name,
// with or without key and value specified,
// and returns an array of structs, each having
// the respective pointers | [
"FindAll",
"finds",
"all",
"occurrences",
"of",
"the",
"given",
"tag",
"name",
"with",
"or",
"without",
"key",
"and",
"value",
"specified",
"and",
"returns",
"an",
"array",
"of",
"structs",
"each",
"having",
"the",
"respective",
"pointers"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L135-L148 |
153,187 | anaskhan96/soup | soup.go | FindNextSibling | func (r Root) FindNextSibling() Root {
nextSibling := r.Pointer.NextSibling
if nextSibling == nil {
if debug {
panic("No next sibling found")
}
return Root{nil, "", errors.New("no next sibling found")}
}
return Root{nextSibling, nextSibling.Data, nil}
} | go | func (r Root) FindNextSibling() Root {
nextSibling := r.Pointer.NextSibling
if nextSibling == nil {
if debug {
panic("No next sibling found")
}
return Root{nil, "", errors.New("no next sibling found")}
}
return Root{nextSibling, nextSibling.Data, nil}
} | [
"func",
"(",
"r",
"Root",
")",
"FindNextSibling",
"(",
")",
"Root",
"{",
"nextSibling",
":=",
"r",
".",
"Pointer",
".",
"NextSibling",
"\n",
"if",
"nextSibling",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nextSibling",
",",
"nextSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"}"
] | // FindNextSibling finds the next sibling of the pointer in the DOM
// returning a struct with a pointer to it | [
"FindNextSibling",
"finds",
"the",
"next",
"sibling",
"of",
"the",
"pointer",
"in",
"the",
"DOM",
"returning",
"a",
"struct",
"with",
"a",
"pointer",
"to",
"it"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L182-L191 |
153,188 | anaskhan96/soup | soup.go | FindPrevSibling | func (r Root) FindPrevSibling() Root {
prevSibling := r.Pointer.PrevSibling
if prevSibling == nil {
if debug {
panic("No previous sibling found")
}
return Root{nil, "", errors.New("no previous sibling found")}
}
return Root{prevSibling, prevSibling.Data, nil}
} | go | func (r Root) FindPrevSibling() Root {
prevSibling := r.Pointer.PrevSibling
if prevSibling == nil {
if debug {
panic("No previous sibling found")
}
return Root{nil, "", errors.New("no previous sibling found")}
}
return Root{prevSibling, prevSibling.Data, nil}
} | [
"func",
"(",
"r",
"Root",
")",
"FindPrevSibling",
"(",
")",
"Root",
"{",
"prevSibling",
":=",
"r",
".",
"Pointer",
".",
"PrevSibling",
"\n",
"if",
"prevSibling",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"prevSibling",
",",
"prevSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"}"
] | // FindPrevSibling finds the previous sibling of the pointer in the DOM
// returning a struct with a pointer to it | [
"FindPrevSibling",
"finds",
"the",
"previous",
"sibling",
"of",
"the",
"pointer",
"in",
"the",
"DOM",
"returning",
"a",
"struct",
"with",
"a",
"pointer",
"to",
"it"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L195-L204 |
153,189 | anaskhan96/soup | soup.go | FindNextElementSibling | func (r Root) FindNextElementSibling() Root {
nextSibling := r.Pointer.NextSibling
if nextSibling == nil {
if debug {
panic("No next element sibling found")
}
return Root{nil, "", errors.New("no next element sibling found")}
}
if nextSibling.Type == html.ElementNode {
return Root{nextSibling, nextSibling.Data, nil}
}
p := Root{nextSibling, nextSibling.Data, nil}
return p.FindNextElementSibling()
} | go | func (r Root) FindNextElementSibling() Root {
nextSibling := r.Pointer.NextSibling
if nextSibling == nil {
if debug {
panic("No next element sibling found")
}
return Root{nil, "", errors.New("no next element sibling found")}
}
if nextSibling.Type == html.ElementNode {
return Root{nextSibling, nextSibling.Data, nil}
}
p := Root{nextSibling, nextSibling.Data, nil}
return p.FindNextElementSibling()
} | [
"func",
"(",
"r",
"Root",
")",
"FindNextElementSibling",
"(",
")",
"Root",
"{",
"nextSibling",
":=",
"r",
".",
"Pointer",
".",
"NextSibling",
"\n",
"if",
"nextSibling",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"if",
"nextSibling",
".",
"Type",
"==",
"html",
".",
"ElementNode",
"{",
"return",
"Root",
"{",
"nextSibling",
",",
"nextSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"}",
"\n",
"p",
":=",
"Root",
"{",
"nextSibling",
",",
"nextSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"return",
"p",
".",
"FindNextElementSibling",
"(",
")",
"\n",
"}"
] | // FindNextElementSibling finds the next element sibling of the pointer in the DOM
// returning a struct with a pointer to it | [
"FindNextElementSibling",
"finds",
"the",
"next",
"element",
"sibling",
"of",
"the",
"pointer",
"in",
"the",
"DOM",
"returning",
"a",
"struct",
"with",
"a",
"pointer",
"to",
"it"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L208-L221 |
153,190 | anaskhan96/soup | soup.go | FindPrevElementSibling | func (r Root) FindPrevElementSibling() Root {
prevSibling := r.Pointer.PrevSibling
if prevSibling == nil {
if debug {
panic("No previous element sibling found")
}
return Root{nil, "", errors.New("no previous element sibling found")}
}
if prevSibling.Type == html.ElementNode {
return Root{prevSibling, prevSibling.Data, nil}
}
p := Root{prevSibling, prevSibling.Data, nil}
return p.FindPrevElementSibling()
} | go | func (r Root) FindPrevElementSibling() Root {
prevSibling := r.Pointer.PrevSibling
if prevSibling == nil {
if debug {
panic("No previous element sibling found")
}
return Root{nil, "", errors.New("no previous element sibling found")}
}
if prevSibling.Type == html.ElementNode {
return Root{prevSibling, prevSibling.Data, nil}
}
p := Root{prevSibling, prevSibling.Data, nil}
return p.FindPrevElementSibling()
} | [
"func",
"(",
"r",
"Root",
")",
"FindPrevElementSibling",
"(",
")",
"Root",
"{",
"prevSibling",
":=",
"r",
".",
"Pointer",
".",
"PrevSibling",
"\n",
"if",
"prevSibling",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"Root",
"{",
"nil",
",",
"\"",
"\"",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"}",
"\n",
"}",
"\n",
"if",
"prevSibling",
".",
"Type",
"==",
"html",
".",
"ElementNode",
"{",
"return",
"Root",
"{",
"prevSibling",
",",
"prevSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"}",
"\n",
"p",
":=",
"Root",
"{",
"prevSibling",
",",
"prevSibling",
".",
"Data",
",",
"nil",
"}",
"\n",
"return",
"p",
".",
"FindPrevElementSibling",
"(",
")",
"\n",
"}"
] | // FindPrevElementSibling finds the previous element sibling of the pointer in the DOM
// returning a struct with a pointer to it | [
"FindPrevElementSibling",
"finds",
"the",
"previous",
"element",
"sibling",
"of",
"the",
"pointer",
"in",
"the",
"DOM",
"returning",
"a",
"struct",
"with",
"a",
"pointer",
"to",
"it"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L225-L238 |
153,191 | anaskhan96/soup | soup.go | Children | func (r Root) Children() []Root {
child := r.Pointer.FirstChild
var children []Root
for child != nil {
children = append(children, Root{child, child.Data, nil})
child = child.NextSibling
}
return children
} | go | func (r Root) Children() []Root {
child := r.Pointer.FirstChild
var children []Root
for child != nil {
children = append(children, Root{child, child.Data, nil})
child = child.NextSibling
}
return children
} | [
"func",
"(",
"r",
"Root",
")",
"Children",
"(",
")",
"[",
"]",
"Root",
"{",
"child",
":=",
"r",
".",
"Pointer",
".",
"FirstChild",
"\n",
"var",
"children",
"[",
"]",
"Root",
"\n",
"for",
"child",
"!=",
"nil",
"{",
"children",
"=",
"append",
"(",
"children",
",",
"Root",
"{",
"child",
",",
"child",
".",
"Data",
",",
"nil",
"}",
")",
"\n",
"child",
"=",
"child",
".",
"NextSibling",
"\n",
"}",
"\n",
"return",
"children",
"\n",
"}"
] | // Children retuns all direct children of this DOME element. | [
"Children",
"retuns",
"all",
"direct",
"children",
"of",
"this",
"DOME",
"element",
"."
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L241-L249 |
153,192 | anaskhan96/soup | soup.go | Attrs | func (r Root) Attrs() map[string]string {
if r.Pointer.Type != html.ElementNode {
if debug {
panic("Not an ElementNode")
}
return nil
}
if len(r.Pointer.Attr) == 0 {
return nil
}
return getKeyValue(r.Pointer.Attr)
} | go | func (r Root) Attrs() map[string]string {
if r.Pointer.Type != html.ElementNode {
if debug {
panic("Not an ElementNode")
}
return nil
}
if len(r.Pointer.Attr) == 0 {
return nil
}
return getKeyValue(r.Pointer.Attr)
} | [
"func",
"(",
"r",
"Root",
")",
"Attrs",
"(",
")",
"map",
"[",
"string",
"]",
"string",
"{",
"if",
"r",
".",
"Pointer",
".",
"Type",
"!=",
"html",
".",
"ElementNode",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"len",
"(",
"r",
".",
"Pointer",
".",
"Attr",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"getKeyValue",
"(",
"r",
".",
"Pointer",
".",
"Attr",
")",
"\n",
"}"
] | // Attrs returns a map containing all attributes | [
"Attrs",
"returns",
"a",
"map",
"containing",
"all",
"attributes"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L252-L263 |
153,193 | anaskhan96/soup | soup.go | Text | func (r Root) Text() string {
k := r.Pointer.FirstChild
checkNode:
if k != nil && k.Type != html.TextNode {
k = k.NextSibling
if k == nil {
if debug {
panic("No text node found")
}
return ""
}
goto checkNode
}
if k != nil {
r, _ := regexp.Compile(`^\s+$`)
if ok := r.MatchString(k.Data); ok {
k = k.NextSibling
if k == nil {
if debug {
panic("No text node found")
}
return ""
}
goto checkNode
}
return k.Data
}
return ""
} | go | func (r Root) Text() string {
k := r.Pointer.FirstChild
checkNode:
if k != nil && k.Type != html.TextNode {
k = k.NextSibling
if k == nil {
if debug {
panic("No text node found")
}
return ""
}
goto checkNode
}
if k != nil {
r, _ := regexp.Compile(`^\s+$`)
if ok := r.MatchString(k.Data); ok {
k = k.NextSibling
if k == nil {
if debug {
panic("No text node found")
}
return ""
}
goto checkNode
}
return k.Data
}
return ""
} | [
"func",
"(",
"r",
"Root",
")",
"Text",
"(",
")",
"string",
"{",
"k",
":=",
"r",
".",
"Pointer",
".",
"FirstChild",
"\n",
"checkNode",
":",
"if",
"k",
"!=",
"nil",
"&&",
"k",
".",
"Type",
"!=",
"html",
".",
"TextNode",
"{",
"k",
"=",
"k",
".",
"NextSibling",
"\n",
"if",
"k",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"goto",
"checkNode",
"\n",
"}",
"\n",
"if",
"k",
"!=",
"nil",
"{",
"r",
",",
"_",
":=",
"regexp",
".",
"Compile",
"(",
"`^\\s+$`",
")",
"\n",
"if",
"ok",
":=",
"r",
".",
"MatchString",
"(",
"k",
".",
"Data",
")",
";",
"ok",
"{",
"k",
"=",
"k",
".",
"NextSibling",
"\n",
"if",
"k",
"==",
"nil",
"{",
"if",
"debug",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"goto",
"checkNode",
"\n",
"}",
"\n",
"return",
"k",
".",
"Data",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}"
] | // Text returns the string inside a non-nested element | [
"Text",
"returns",
"the",
"string",
"inside",
"a",
"non",
"-",
"nested",
"element"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L266-L294 |
153,194 | anaskhan96/soup | soup.go | FullText | func (r Root) FullText() string {
var buf bytes.Buffer
var f func(*html.Node)
f = func(n *html.Node) {
if n.Type == html.TextNode {
buf.WriteString(n.Data)
}
if n.Type == html.ElementNode {
f(n.FirstChild)
}
if n.NextSibling != nil {
f(n.NextSibling)
}
}
f(r.Pointer.FirstChild)
return buf.String()
} | go | func (r Root) FullText() string {
var buf bytes.Buffer
var f func(*html.Node)
f = func(n *html.Node) {
if n.Type == html.TextNode {
buf.WriteString(n.Data)
}
if n.Type == html.ElementNode {
f(n.FirstChild)
}
if n.NextSibling != nil {
f(n.NextSibling)
}
}
f(r.Pointer.FirstChild)
return buf.String()
} | [
"func",
"(",
"r",
"Root",
")",
"FullText",
"(",
")",
"string",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n\n",
"var",
"f",
"func",
"(",
"*",
"html",
".",
"Node",
")",
"\n",
"f",
"=",
"func",
"(",
"n",
"*",
"html",
".",
"Node",
")",
"{",
"if",
"n",
".",
"Type",
"==",
"html",
".",
"TextNode",
"{",
"buf",
".",
"WriteString",
"(",
"n",
".",
"Data",
")",
"\n",
"}",
"\n",
"if",
"n",
".",
"Type",
"==",
"html",
".",
"ElementNode",
"{",
"f",
"(",
"n",
".",
"FirstChild",
")",
"\n",
"}",
"\n",
"if",
"n",
".",
"NextSibling",
"!=",
"nil",
"{",
"f",
"(",
"n",
".",
"NextSibling",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"f",
"(",
"r",
".",
"Pointer",
".",
"FirstChild",
")",
"\n\n",
"return",
"buf",
".",
"String",
"(",
")",
"\n",
"}"
] | // FullText returns the string inside even a nested element | [
"FullText",
"returns",
"the",
"string",
"inside",
"even",
"a",
"nested",
"element"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L297-L316 |
153,195 | anaskhan96/soup | soup.go | findOnce | func findOnce(n *html.Node, args []string, uni bool, strict bool) (*html.Node, bool) {
if uni == true {
if n.Type == html.ElementNode && n.Data == args[0] {
if len(args) > 1 && len(args) < 4 {
for i := 0; i < len(n.Attr); i++ {
attr := n.Attr[i]
searchAttrName := args[1]
searchAttrVal := args[2]
if (strict && attributeAndValueEquals(attr, searchAttrName, searchAttrVal)) ||
(!strict && attributeContainsValue(attr, searchAttrName, searchAttrVal)) {
return n, true
}
}
} else if len(args) == 1 {
return n, true
}
}
}
uni = true
for c := n.FirstChild; c != nil; c = c.NextSibling {
p, q := findOnce(c, args, true, strict)
if q != false {
return p, q
}
}
return nil, false
} | go | func findOnce(n *html.Node, args []string, uni bool, strict bool) (*html.Node, bool) {
if uni == true {
if n.Type == html.ElementNode && n.Data == args[0] {
if len(args) > 1 && len(args) < 4 {
for i := 0; i < len(n.Attr); i++ {
attr := n.Attr[i]
searchAttrName := args[1]
searchAttrVal := args[2]
if (strict && attributeAndValueEquals(attr, searchAttrName, searchAttrVal)) ||
(!strict && attributeContainsValue(attr, searchAttrName, searchAttrVal)) {
return n, true
}
}
} else if len(args) == 1 {
return n, true
}
}
}
uni = true
for c := n.FirstChild; c != nil; c = c.NextSibling {
p, q := findOnce(c, args, true, strict)
if q != false {
return p, q
}
}
return nil, false
} | [
"func",
"findOnce",
"(",
"n",
"*",
"html",
".",
"Node",
",",
"args",
"[",
"]",
"string",
",",
"uni",
"bool",
",",
"strict",
"bool",
")",
"(",
"*",
"html",
".",
"Node",
",",
"bool",
")",
"{",
"if",
"uni",
"==",
"true",
"{",
"if",
"n",
".",
"Type",
"==",
"html",
".",
"ElementNode",
"&&",
"n",
".",
"Data",
"==",
"args",
"[",
"0",
"]",
"{",
"if",
"len",
"(",
"args",
")",
">",
"1",
"&&",
"len",
"(",
"args",
")",
"<",
"4",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"n",
".",
"Attr",
")",
";",
"i",
"++",
"{",
"attr",
":=",
"n",
".",
"Attr",
"[",
"i",
"]",
"\n",
"searchAttrName",
":=",
"args",
"[",
"1",
"]",
"\n",
"searchAttrVal",
":=",
"args",
"[",
"2",
"]",
"\n",
"if",
"(",
"strict",
"&&",
"attributeAndValueEquals",
"(",
"attr",
",",
"searchAttrName",
",",
"searchAttrVal",
")",
")",
"||",
"(",
"!",
"strict",
"&&",
"attributeContainsValue",
"(",
"attr",
",",
"searchAttrName",
",",
"searchAttrVal",
")",
")",
"{",
"return",
"n",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"else",
"if",
"len",
"(",
"args",
")",
"==",
"1",
"{",
"return",
"n",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"uni",
"=",
"true",
"\n",
"for",
"c",
":=",
"n",
".",
"FirstChild",
";",
"c",
"!=",
"nil",
";",
"c",
"=",
"c",
".",
"NextSibling",
"{",
"p",
",",
"q",
":=",
"findOnce",
"(",
"c",
",",
"args",
",",
"true",
",",
"strict",
")",
"\n",
"if",
"q",
"!=",
"false",
"{",
"return",
"p",
",",
"q",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
",",
"false",
"\n",
"}"
] | // Using depth first search to find the first occurrence and return | [
"Using",
"depth",
"first",
"search",
"to",
"find",
"the",
"first",
"occurrence",
"and",
"return"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L319-L345 |
153,196 | anaskhan96/soup | soup.go | findAllofem | func findAllofem(n *html.Node, args []string, strict bool) []*html.Node {
var nodeLinks = make([]*html.Node, 0, 10)
var f func(*html.Node, []string, bool)
f = func(n *html.Node, args []string, uni bool) {
if uni == true {
if n.Data == args[0] {
if len(args) > 1 && len(args) < 4 {
for i := 0; i < len(n.Attr); i++ {
attr := n.Attr[i]
searchAttrName := args[1]
searchAttrVal := args[2]
if (strict && attributeAndValueEquals(attr, searchAttrName, searchAttrVal)) ||
(!strict && attributeContainsValue(attr, searchAttrName, searchAttrVal)) {
nodeLinks = append(nodeLinks, n)
}
}
} else if len(args) == 1 {
nodeLinks = append(nodeLinks, n)
}
}
}
uni = true
for c := n.FirstChild; c != nil; c = c.NextSibling {
f(c, args, true)
}
}
f(n, args, false)
return nodeLinks
} | go | func findAllofem(n *html.Node, args []string, strict bool) []*html.Node {
var nodeLinks = make([]*html.Node, 0, 10)
var f func(*html.Node, []string, bool)
f = func(n *html.Node, args []string, uni bool) {
if uni == true {
if n.Data == args[0] {
if len(args) > 1 && len(args) < 4 {
for i := 0; i < len(n.Attr); i++ {
attr := n.Attr[i]
searchAttrName := args[1]
searchAttrVal := args[2]
if (strict && attributeAndValueEquals(attr, searchAttrName, searchAttrVal)) ||
(!strict && attributeContainsValue(attr, searchAttrName, searchAttrVal)) {
nodeLinks = append(nodeLinks, n)
}
}
} else if len(args) == 1 {
nodeLinks = append(nodeLinks, n)
}
}
}
uni = true
for c := n.FirstChild; c != nil; c = c.NextSibling {
f(c, args, true)
}
}
f(n, args, false)
return nodeLinks
} | [
"func",
"findAllofem",
"(",
"n",
"*",
"html",
".",
"Node",
",",
"args",
"[",
"]",
"string",
",",
"strict",
"bool",
")",
"[",
"]",
"*",
"html",
".",
"Node",
"{",
"var",
"nodeLinks",
"=",
"make",
"(",
"[",
"]",
"*",
"html",
".",
"Node",
",",
"0",
",",
"10",
")",
"\n",
"var",
"f",
"func",
"(",
"*",
"html",
".",
"Node",
",",
"[",
"]",
"string",
",",
"bool",
")",
"\n",
"f",
"=",
"func",
"(",
"n",
"*",
"html",
".",
"Node",
",",
"args",
"[",
"]",
"string",
",",
"uni",
"bool",
")",
"{",
"if",
"uni",
"==",
"true",
"{",
"if",
"n",
".",
"Data",
"==",
"args",
"[",
"0",
"]",
"{",
"if",
"len",
"(",
"args",
")",
">",
"1",
"&&",
"len",
"(",
"args",
")",
"<",
"4",
"{",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"n",
".",
"Attr",
")",
";",
"i",
"++",
"{",
"attr",
":=",
"n",
".",
"Attr",
"[",
"i",
"]",
"\n",
"searchAttrName",
":=",
"args",
"[",
"1",
"]",
"\n",
"searchAttrVal",
":=",
"args",
"[",
"2",
"]",
"\n",
"if",
"(",
"strict",
"&&",
"attributeAndValueEquals",
"(",
"attr",
",",
"searchAttrName",
",",
"searchAttrVal",
")",
")",
"||",
"(",
"!",
"strict",
"&&",
"attributeContainsValue",
"(",
"attr",
",",
"searchAttrName",
",",
"searchAttrVal",
")",
")",
"{",
"nodeLinks",
"=",
"append",
"(",
"nodeLinks",
",",
"n",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"else",
"if",
"len",
"(",
"args",
")",
"==",
"1",
"{",
"nodeLinks",
"=",
"append",
"(",
"nodeLinks",
",",
"n",
")",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"uni",
"=",
"true",
"\n",
"for",
"c",
":=",
"n",
".",
"FirstChild",
";",
"c",
"!=",
"nil",
";",
"c",
"=",
"c",
".",
"NextSibling",
"{",
"f",
"(",
"c",
",",
"args",
",",
"true",
")",
"\n",
"}",
"\n",
"}",
"\n",
"f",
"(",
"n",
",",
"args",
",",
"false",
")",
"\n",
"return",
"nodeLinks",
"\n",
"}"
] | // Using depth first search to find all occurrences and return | [
"Using",
"depth",
"first",
"search",
"to",
"find",
"all",
"occurrences",
"and",
"return"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L348-L376 |
153,197 | anaskhan96/soup | soup.go | attributeAndValueEquals | func attributeAndValueEquals(attr html.Attribute, attribute, value string) bool {
return attr.Key == attribute && attr.Val == value
} | go | func attributeAndValueEquals(attr html.Attribute, attribute, value string) bool {
return attr.Key == attribute && attr.Val == value
} | [
"func",
"attributeAndValueEquals",
"(",
"attr",
"html",
".",
"Attribute",
",",
"attribute",
",",
"value",
"string",
")",
"bool",
"{",
"return",
"attr",
".",
"Key",
"==",
"attribute",
"&&",
"attr",
".",
"Val",
"==",
"value",
"\n",
"}"
] | // attributeAndValueEquals reports when the html.Attribute attr has the same attribute name and value as from
// provided arguments | [
"attributeAndValueEquals",
"reports",
"when",
"the",
"html",
".",
"Attribute",
"attr",
"has",
"the",
"same",
"attribute",
"name",
"and",
"value",
"as",
"from",
"provided",
"arguments"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L380-L382 |
153,198 | anaskhan96/soup | soup.go | attributeContainsValue | func attributeContainsValue(attr html.Attribute, attribute, value string) bool {
if attr.Key == attribute {
for _, attrVal := range strings.Fields(attr.Val) {
if attrVal == value {
return true
}
}
}
return false
} | go | func attributeContainsValue(attr html.Attribute, attribute, value string) bool {
if attr.Key == attribute {
for _, attrVal := range strings.Fields(attr.Val) {
if attrVal == value {
return true
}
}
}
return false
} | [
"func",
"attributeContainsValue",
"(",
"attr",
"html",
".",
"Attribute",
",",
"attribute",
",",
"value",
"string",
")",
"bool",
"{",
"if",
"attr",
".",
"Key",
"==",
"attribute",
"{",
"for",
"_",
",",
"attrVal",
":=",
"range",
"strings",
".",
"Fields",
"(",
"attr",
".",
"Val",
")",
"{",
"if",
"attrVal",
"==",
"value",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"false",
"\n",
"}"
] | // attributeContainsValue reports when the html.Attribute attr has the same attribute name as from provided
// attribute argument and compares if it has the same value in its values parameter | [
"attributeContainsValue",
"reports",
"when",
"the",
"html",
".",
"Attribute",
"attr",
"has",
"the",
"same",
"attribute",
"name",
"as",
"from",
"provided",
"attribute",
"argument",
"and",
"compares",
"if",
"it",
"has",
"the",
"same",
"value",
"in",
"its",
"values",
"parameter"
] | 50123c340ba50505026229a3fb7e0bc5343e7e4d | https://github.com/anaskhan96/soup/blob/50123c340ba50505026229a3fb7e0bc5343e7e4d/soup.go#L386-L395 |
153,199 | ccding/go-stun | stun/log.go | NewLogger | func NewLogger() *Logger {
logger := &Logger{*log.New(os.Stdout, "", log.LstdFlags), false, false}
return logger
} | go | func NewLogger() *Logger {
logger := &Logger{*log.New(os.Stdout, "", log.LstdFlags), false, false}
return logger
} | [
"func",
"NewLogger",
"(",
")",
"*",
"Logger",
"{",
"logger",
":=",
"&",
"Logger",
"{",
"*",
"log",
".",
"New",
"(",
"os",
".",
"Stdout",
",",
"\"",
"\"",
",",
"log",
".",
"LstdFlags",
")",
",",
"false",
",",
"false",
"}",
"\n",
"return",
"logger",
"\n",
"}"
] | // NewLogger creates a default logger. | [
"NewLogger",
"creates",
"a",
"default",
"logger",
"."
] | be486d185f3dfcb2dbf8429332da50a0da7f95a6 | https://github.com/ccding/go-stun/blob/be486d185f3dfcb2dbf8429332da50a0da7f95a6/stun/log.go#L32-L35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.