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
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
160,400
jmoiron/sqlx
named.go
Select
func (n *NamedStmt) Select(dest interface{}, arg interface{}) error { rows, err := n.Queryx(arg) if err != nil { return err } // if something happens here, we want to make sure the rows are Closed defer rows.Close() return scanAll(rows, dest, false) }
go
func (n *NamedStmt) Select(dest interface{}, arg interface{}) error { rows, err := n.Queryx(arg) if err != nil { return err } // if something happens here, we want to make sure the rows are Closed defer rows.Close() return scanAll(rows, dest, false) }
[ "func", "(", "n", "*", "NamedStmt", ")", "Select", "(", "dest", "interface", "{", "}", ",", "arg", "interface", "{", "}", ")", "error", "{", "rows", ",", "err", ":=", "n", ".", "Queryx", "(", "arg", ")", "\n", "if", "err", "!=", "nil", "{", "re...
// Select using this NamedStmt // Any named placeholder parameters are replaced with fields from arg.
[ "Select", "using", "this", "NamedStmt", "Any", "named", "placeholder", "parameters", "are", "replaced", "with", "fields", "from", "arg", "." ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L101-L109
160,401
jmoiron/sqlx
named.go
Get
func (n *NamedStmt) Get(dest interface{}, arg interface{}) error { r := n.QueryRowx(arg) return r.scanAny(dest, false) }
go
func (n *NamedStmt) Get(dest interface{}, arg interface{}) error { r := n.QueryRowx(arg) return r.scanAny(dest, false) }
[ "func", "(", "n", "*", "NamedStmt", ")", "Get", "(", "dest", "interface", "{", "}", ",", "arg", "interface", "{", "}", ")", "error", "{", "r", ":=", "n", ".", "QueryRowx", "(", "arg", ")", "\n", "return", "r", ".", "scanAny", "(", "dest", ",", ...
// Get using this NamedStmt // Any named placeholder parameters are replaced with fields from arg.
[ "Get", "using", "this", "NamedStmt", "Any", "named", "placeholder", "parameters", "are", "replaced", "with", "fields", "from", "arg", "." ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L113-L116
160,402
jmoiron/sqlx
named.go
Unsafe
func (n *NamedStmt) Unsafe() *NamedStmt { r := &NamedStmt{Params: n.Params, Stmt: n.Stmt, QueryString: n.QueryString} r.Stmt.unsafe = true return r }
go
func (n *NamedStmt) Unsafe() *NamedStmt { r := &NamedStmt{Params: n.Params, Stmt: n.Stmt, QueryString: n.QueryString} r.Stmt.unsafe = true return r }
[ "func", "(", "n", "*", "NamedStmt", ")", "Unsafe", "(", ")", "*", "NamedStmt", "{", "r", ":=", "&", "NamedStmt", "{", "Params", ":", "n", ".", "Params", ",", "Stmt", ":", "n", ".", "Stmt", ",", "QueryString", ":", "n", ".", "QueryString", "}", "\...
// Unsafe creates an unsafe version of the NamedStmt
[ "Unsafe", "creates", "an", "unsafe", "version", "of", "the", "NamedStmt" ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L119-L123
160,403
jmoiron/sqlx
named.go
bindArgs
func bindArgs(names []string, arg interface{}, m *reflectx.Mapper) ([]interface{}, error) { arglist := make([]interface{}, 0, len(names)) // grab the indirected value of arg v := reflect.ValueOf(arg) for v = reflect.ValueOf(arg); v.Kind() == reflect.Ptr; { v = v.Elem() } err := m.TraversalsByNameFunc(v.Type(), names, func(i int, t []int) error { if len(t) == 0 { return fmt.Errorf("could not find name %s in %#v", names[i], arg) } val := reflectx.FieldByIndexesReadOnly(v, t) arglist = append(arglist, val.Interface()) return nil }) return arglist, err }
go
func bindArgs(names []string, arg interface{}, m *reflectx.Mapper) ([]interface{}, error) { arglist := make([]interface{}, 0, len(names)) // grab the indirected value of arg v := reflect.ValueOf(arg) for v = reflect.ValueOf(arg); v.Kind() == reflect.Ptr; { v = v.Elem() } err := m.TraversalsByNameFunc(v.Type(), names, func(i int, t []int) error { if len(t) == 0 { return fmt.Errorf("could not find name %s in %#v", names[i], arg) } val := reflectx.FieldByIndexesReadOnly(v, t) arglist = append(arglist, val.Interface()) return nil }) return arglist, err }
[ "func", "bindArgs", "(", "names", "[", "]", "string", ",", "arg", "interface", "{", "}", ",", "m", "*", "reflectx", ".", "Mapper", ")", "(", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "arglist", ":=", "make", "(", "[", "]", "interfa...
// private interface to generate a list of interfaces from a given struct // type, given a list of names to pull out of the struct. Used by public // BindStruct interface.
[ "private", "interface", "to", "generate", "a", "list", "of", "interfaces", "from", "a", "given", "struct", "type", "given", "a", "list", "of", "names", "to", "pull", "out", "of", "the", "struct", ".", "Used", "by", "public", "BindStruct", "interface", "." ...
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L159-L180
160,404
jmoiron/sqlx
named.go
bindMapArgs
func bindMapArgs(names []string, arg map[string]interface{}) ([]interface{}, error) { arglist := make([]interface{}, 0, len(names)) for _, name := range names { val, ok := arg[name] if !ok { return arglist, fmt.Errorf("could not find name %s in %#v", name, arg) } arglist = append(arglist, val) } return arglist, nil }
go
func bindMapArgs(names []string, arg map[string]interface{}) ([]interface{}, error) { arglist := make([]interface{}, 0, len(names)) for _, name := range names { val, ok := arg[name] if !ok { return arglist, fmt.Errorf("could not find name %s in %#v", name, arg) } arglist = append(arglist, val) } return arglist, nil }
[ "func", "bindMapArgs", "(", "names", "[", "]", "string", ",", "arg", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "arglist", ":=", "make", "(", "[", "]", "interface", "{", "}...
// like bindArgs, but for maps.
[ "like", "bindArgs", "but", "for", "maps", "." ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L183-L194
160,405
jmoiron/sqlx
named.go
bindStruct
func bindStruct(bindType int, query string, arg interface{}, m *reflectx.Mapper) (string, []interface{}, error) { bound, names, err := compileNamedQuery([]byte(query), bindType) if err != nil { return "", []interface{}{}, err } arglist, err := bindArgs(names, arg, m) if err != nil { return "", []interface{}{}, err } return bound, arglist, nil }
go
func bindStruct(bindType int, query string, arg interface{}, m *reflectx.Mapper) (string, []interface{}, error) { bound, names, err := compileNamedQuery([]byte(query), bindType) if err != nil { return "", []interface{}{}, err } arglist, err := bindArgs(names, arg, m) if err != nil { return "", []interface{}{}, err } return bound, arglist, nil }
[ "func", "bindStruct", "(", "bindType", "int", ",", "query", "string", ",", "arg", "interface", "{", "}", ",", "m", "*", "reflectx", ".", "Mapper", ")", "(", "string", ",", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "bound", ",", "name...
// bindStruct binds a named parameter query with fields from a struct argument. // The rules for binding field names to parameter names follow the same // conventions as for StructScan, including obeying the `db` struct tags.
[ "bindStruct", "binds", "a", "named", "parameter", "query", "with", "fields", "from", "a", "struct", "argument", ".", "The", "rules", "for", "binding", "field", "names", "to", "parameter", "names", "follow", "the", "same", "conventions", "as", "for", "StructSca...
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L199-L211
160,406
jmoiron/sqlx
named.go
bindArray
func bindArray(bindType int, query string, arg interface{}, m *reflectx.Mapper) (string, []interface{}, error) { // do the initial binding with QUESTION; if bindType is not question, // we can rebind it at the end. bound, names, err := compileNamedQuery([]byte(query), QUESTION) if err != nil { return "", []interface{}{}, err } arrayValue := reflect.ValueOf(arg) arrayLen := arrayValue.Len() if arrayLen == 0 { return "", []interface{}{}, fmt.Errorf("length of array is 0: %#v", arg) } var arglist []interface{} for i := 0; i < arrayLen; i++ { elemArglist, err := bindArgs(names, arrayValue.Index(i).Interface(), m) if err != nil { return "", []interface{}{}, err } arglist = append(arglist, elemArglist...) } if arrayLen > 1 { bound = fixBound(bound, arrayLen) } // adjust binding type if we weren't on question if bindType != QUESTION { bound = Rebind(bindType, bound) } return bound, arglist, nil }
go
func bindArray(bindType int, query string, arg interface{}, m *reflectx.Mapper) (string, []interface{}, error) { // do the initial binding with QUESTION; if bindType is not question, // we can rebind it at the end. bound, names, err := compileNamedQuery([]byte(query), QUESTION) if err != nil { return "", []interface{}{}, err } arrayValue := reflect.ValueOf(arg) arrayLen := arrayValue.Len() if arrayLen == 0 { return "", []interface{}{}, fmt.Errorf("length of array is 0: %#v", arg) } var arglist []interface{} for i := 0; i < arrayLen; i++ { elemArglist, err := bindArgs(names, arrayValue.Index(i).Interface(), m) if err != nil { return "", []interface{}{}, err } arglist = append(arglist, elemArglist...) } if arrayLen > 1 { bound = fixBound(bound, arrayLen) } // adjust binding type if we weren't on question if bindType != QUESTION { bound = Rebind(bindType, bound) } return bound, arglist, nil }
[ "func", "bindArray", "(", "bindType", "int", ",", "query", "string", ",", "arg", "interface", "{", "}", ",", "m", "*", "reflectx", ".", "Mapper", ")", "(", "string", ",", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "// do the initial bindi...
// bindArray binds a named parameter query with fields from an array or slice of // structs argument.
[ "bindArray", "binds", "a", "named", "parameter", "query", "with", "fields", "from", "an", "array", "or", "slice", "of", "structs", "argument", "." ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L233-L261
160,407
jmoiron/sqlx
named.go
bindMap
func bindMap(bindType int, query string, args map[string]interface{}) (string, []interface{}, error) { bound, names, err := compileNamedQuery([]byte(query), bindType) if err != nil { return "", []interface{}{}, err } arglist, err := bindMapArgs(names, args) return bound, arglist, err }
go
func bindMap(bindType int, query string, args map[string]interface{}) (string, []interface{}, error) { bound, names, err := compileNamedQuery([]byte(query), bindType) if err != nil { return "", []interface{}{}, err } arglist, err := bindMapArgs(names, args) return bound, arglist, err }
[ "func", "bindMap", "(", "bindType", "int", ",", "query", "string", ",", "args", "map", "[", "string", "]", "interface", "{", "}", ")", "(", "string", ",", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "bound", ",", "names", ",", "err", ...
// bindMap binds a named parameter query with a map of arguments.
[ "bindMap", "binds", "a", "named", "parameter", "query", "with", "a", "map", "of", "arguments", "." ]
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L264-L272
160,408
jmoiron/sqlx
named.go
Named
func Named(query string, arg interface{}) (string, []interface{}, error) { return bindNamedMapper(QUESTION, query, arg, mapper()) }
go
func Named(query string, arg interface{}) (string, []interface{}, error) { return bindNamedMapper(QUESTION, query, arg, mapper()) }
[ "func", "Named", "(", "query", "string", ",", "arg", "interface", "{", "}", ")", "(", "string", ",", "[", "]", "interface", "{", "}", ",", "error", ")", "{", "return", "bindNamedMapper", "(", "QUESTION", ",", "query", ",", "arg", ",", "mapper", "(", ...
// Named takes a query using named parameters and an argument and // returns a new query with a list of args that can be executed by // a database. The return value uses the `?` bindvar.
[ "Named", "takes", "a", "query", "using", "named", "parameters", "and", "an", "argument", "and", "returns", "a", "new", "query", "with", "a", "list", "of", "args", "that", "can", "be", "executed", "by", "a", "database", ".", "The", "return", "value", "use...
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L377-L379
160,409
jmoiron/sqlx
named.go
NamedExec
func NamedExec(e Ext, query string, arg interface{}) (sql.Result, error) { q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e)) if err != nil { return nil, err } return e.Exec(q, args...) }
go
func NamedExec(e Ext, query string, arg interface{}) (sql.Result, error) { q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e)) if err != nil { return nil, err } return e.Exec(q, args...) }
[ "func", "NamedExec", "(", "e", "Ext", ",", "query", "string", ",", "arg", "interface", "{", "}", ")", "(", "sql", ".", "Result", ",", "error", ")", "{", "q", ",", "args", ",", "err", ":=", "bindNamedMapper", "(", "BindType", "(", "e", ".", "DriverN...
// NamedExec uses BindStruct to get a query executable by the driver and // then runs Exec on the result. Returns an error from the binding // or the query execution itself.
[ "NamedExec", "uses", "BindStruct", "to", "get", "a", "query", "executable", "by", "the", "driver", "and", "then", "runs", "Exec", "on", "the", "result", ".", "Returns", "an", "error", "from", "the", "binding", "or", "the", "query", "execution", "itself", "...
38398a30ed8516ffda617a04c822de09df8a3ec5
https://github.com/jmoiron/sqlx/blob/38398a30ed8516ffda617a04c822de09df8a3ec5/named.go#L407-L413
160,410
google/go-github
github/event.go
ParsePayload
func (e *Event) ParsePayload() (payload interface{}, err error) { switch *e.Type { case "CheckRunEvent": payload = &CheckRunEvent{} case "CheckSuiteEvent": payload = &CheckSuiteEvent{} case "CommitCommentEvent": payload = &CommitCommentEvent{} case "CreateEvent": payload = &CreateEvent{} case "DeleteEvent": payload = &DeleteEvent{} case "DeployKeyEvent": payload = &DeployKeyEvent{} case "DeploymentEvent": payload = &DeploymentEvent{} case "DeploymentStatusEvent": payload = &DeploymentStatusEvent{} case "ForkEvent": payload = &ForkEvent{} case "GitHubAppAuthorizationEvent": payload = &GitHubAppAuthorizationEvent{} case "GollumEvent": payload = &GollumEvent{} case "InstallationEvent": payload = &InstallationEvent{} case "InstallationRepositoriesEvent": payload = &InstallationRepositoriesEvent{} case "IssueCommentEvent": payload = &IssueCommentEvent{} case "IssuesEvent": payload = &IssuesEvent{} case "LabelEvent": payload = &LabelEvent{} case "MarketplacePurchaseEvent": payload = &MarketplacePurchaseEvent{} case "MemberEvent": payload = &MemberEvent{} case "MembershipEvent": payload = &MembershipEvent{} case "MetaEvent": payload = &MetaEvent{} case "MilestoneEvent": payload = &MilestoneEvent{} case "OrganizationEvent": payload = &OrganizationEvent{} case "OrgBlockEvent": payload = &OrgBlockEvent{} case "PageBuildEvent": payload = &PageBuildEvent{} case "PingEvent": payload = &PingEvent{} case "ProjectEvent": payload = &ProjectEvent{} case "ProjectCardEvent": payload = &ProjectCardEvent{} case "ProjectColumnEvent": payload = &ProjectColumnEvent{} case "PublicEvent": payload = &PublicEvent{} case "PullRequestEvent": payload = &PullRequestEvent{} case "PullRequestReviewEvent": payload = &PullRequestReviewEvent{} case "PullRequestReviewCommentEvent": payload = &PullRequestReviewCommentEvent{} case "PushEvent": payload = &PushEvent{} case "ReleaseEvent": payload = &ReleaseEvent{} case "RepositoryEvent": payload = &RepositoryEvent{} case "RepositoryVulnerabilityAlertEvent": payload = &RepositoryVulnerabilityAlertEvent{} case "StarEvent": payload = &StarEvent{} case "StatusEvent": payload = &StatusEvent{} case "TeamEvent": payload = &TeamEvent{} case "TeamAddEvent": payload = &TeamAddEvent{} case "WatchEvent": payload = &WatchEvent{} } err = json.Unmarshal(*e.RawPayload, &payload) return payload, err }
go
func (e *Event) ParsePayload() (payload interface{}, err error) { switch *e.Type { case "CheckRunEvent": payload = &CheckRunEvent{} case "CheckSuiteEvent": payload = &CheckSuiteEvent{} case "CommitCommentEvent": payload = &CommitCommentEvent{} case "CreateEvent": payload = &CreateEvent{} case "DeleteEvent": payload = &DeleteEvent{} case "DeployKeyEvent": payload = &DeployKeyEvent{} case "DeploymentEvent": payload = &DeploymentEvent{} case "DeploymentStatusEvent": payload = &DeploymentStatusEvent{} case "ForkEvent": payload = &ForkEvent{} case "GitHubAppAuthorizationEvent": payload = &GitHubAppAuthorizationEvent{} case "GollumEvent": payload = &GollumEvent{} case "InstallationEvent": payload = &InstallationEvent{} case "InstallationRepositoriesEvent": payload = &InstallationRepositoriesEvent{} case "IssueCommentEvent": payload = &IssueCommentEvent{} case "IssuesEvent": payload = &IssuesEvent{} case "LabelEvent": payload = &LabelEvent{} case "MarketplacePurchaseEvent": payload = &MarketplacePurchaseEvent{} case "MemberEvent": payload = &MemberEvent{} case "MembershipEvent": payload = &MembershipEvent{} case "MetaEvent": payload = &MetaEvent{} case "MilestoneEvent": payload = &MilestoneEvent{} case "OrganizationEvent": payload = &OrganizationEvent{} case "OrgBlockEvent": payload = &OrgBlockEvent{} case "PageBuildEvent": payload = &PageBuildEvent{} case "PingEvent": payload = &PingEvent{} case "ProjectEvent": payload = &ProjectEvent{} case "ProjectCardEvent": payload = &ProjectCardEvent{} case "ProjectColumnEvent": payload = &ProjectColumnEvent{} case "PublicEvent": payload = &PublicEvent{} case "PullRequestEvent": payload = &PullRequestEvent{} case "PullRequestReviewEvent": payload = &PullRequestReviewEvent{} case "PullRequestReviewCommentEvent": payload = &PullRequestReviewCommentEvent{} case "PushEvent": payload = &PushEvent{} case "ReleaseEvent": payload = &ReleaseEvent{} case "RepositoryEvent": payload = &RepositoryEvent{} case "RepositoryVulnerabilityAlertEvent": payload = &RepositoryVulnerabilityAlertEvent{} case "StarEvent": payload = &StarEvent{} case "StatusEvent": payload = &StatusEvent{} case "TeamEvent": payload = &TeamEvent{} case "TeamAddEvent": payload = &TeamAddEvent{} case "WatchEvent": payload = &WatchEvent{} } err = json.Unmarshal(*e.RawPayload, &payload) return payload, err }
[ "func", "(", "e", "*", "Event", ")", "ParsePayload", "(", ")", "(", "payload", "interface", "{", "}", ",", "err", "error", ")", "{", "switch", "*", "e", ".", "Type", "{", "case", "\"", "\"", ":", "payload", "=", "&", "CheckRunEvent", "{", "}", "\...
// ParsePayload parses the event payload. For recognized event types, // a value of the corresponding struct type will be returned.
[ "ParsePayload", "parses", "the", "event", "payload", ".", "For", "recognized", "event", "types", "a", "value", "of", "the", "corresponding", "struct", "type", "will", "be", "returned", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/event.go#L31-L118
160,411
google/go-github
github/repos_contents.go
GetContent
func (r *RepositoryContent) GetContent() (string, error) { var encoding string if r.Encoding != nil { encoding = *r.Encoding } switch encoding { case "base64": c, err := base64.StdEncoding.DecodeString(*r.Content) return string(c), err case "": if r.Content == nil { return "", nil } return *r.Content, nil default: return "", fmt.Errorf("unsupported content encoding: %v", encoding) } }
go
func (r *RepositoryContent) GetContent() (string, error) { var encoding string if r.Encoding != nil { encoding = *r.Encoding } switch encoding { case "base64": c, err := base64.StdEncoding.DecodeString(*r.Content) return string(c), err case "": if r.Content == nil { return "", nil } return *r.Content, nil default: return "", fmt.Errorf("unsupported content encoding: %v", encoding) } }
[ "func", "(", "r", "*", "RepositoryContent", ")", "GetContent", "(", ")", "(", "string", ",", "error", ")", "{", "var", "encoding", "string", "\n", "if", "r", ".", "Encoding", "!=", "nil", "{", "encoding", "=", "*", "r", ".", "Encoding", "\n", "}", ...
// GetContent returns the content of r, decoding it if necessary.
[ "GetContent", "returns", "the", "content", "of", "r", "decoding", "it", "if", "necessary", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/repos_contents.go#L71-L89
160,412
google/go-github
github/repos_contents.go
DownloadContents
func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opt *RepositoryContentGetOptions) (io.ReadCloser, error) { dir := path.Dir(filepath) filename := path.Base(filepath) _, dirContents, _, err := s.GetContents(ctx, owner, repo, dir, opt) if err != nil { return nil, err } for _, contents := range dirContents { if *contents.Name == filename { if contents.DownloadURL == nil || *contents.DownloadURL == "" { return nil, fmt.Errorf("No download link found for %s", filepath) } resp, err := s.client.client.Get(*contents.DownloadURL) if err != nil { return nil, err } return resp.Body, nil } } return nil, fmt.Errorf("No file named %s found in %s", filename, dir) }
go
func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opt *RepositoryContentGetOptions) (io.ReadCloser, error) { dir := path.Dir(filepath) filename := path.Base(filepath) _, dirContents, _, err := s.GetContents(ctx, owner, repo, dir, opt) if err != nil { return nil, err } for _, contents := range dirContents { if *contents.Name == filename { if contents.DownloadURL == nil || *contents.DownloadURL == "" { return nil, fmt.Errorf("No download link found for %s", filepath) } resp, err := s.client.client.Get(*contents.DownloadURL) if err != nil { return nil, err } return resp.Body, nil } } return nil, fmt.Errorf("No file named %s found in %s", filename, dir) }
[ "func", "(", "s", "*", "RepositoriesService", ")", "DownloadContents", "(", "ctx", "context", ".", "Context", ",", "owner", ",", "repo", ",", "filepath", "string", ",", "opt", "*", "RepositoryContentGetOptions", ")", "(", "io", ".", "ReadCloser", ",", "error...
// DownloadContents returns an io.ReadCloser that reads the contents of the // specified file. This function will work with files of any size, as opposed // to GetContents which is limited to 1 Mb files. It is the caller's // responsibility to close the ReadCloser.
[ "DownloadContents", "returns", "an", "io", ".", "ReadCloser", "that", "reads", "the", "contents", "of", "the", "specified", "file", ".", "This", "function", "will", "work", "with", "files", "of", "any", "size", "as", "opposed", "to", "GetContents", "which", ...
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/repos_contents.go#L116-L136
160,413
google/go-github
github/timestamp.go
UnmarshalJSON
func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { str := string(data) i, err := strconv.ParseInt(str, 10, 64) if err == nil { t.Time = time.Unix(i, 0) } else { t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) } return }
go
func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { str := string(data) i, err := strconv.ParseInt(str, 10, 64) if err == nil { t.Time = time.Unix(i, 0) } else { t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) } return }
[ "func", "(", "t", "*", "Timestamp", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "(", "err", "error", ")", "{", "str", ":=", "string", "(", "data", ")", "\n", "i", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "str", ",", "10", ...
// UnmarshalJSON implements the json.Unmarshaler interface. // Time is expected in RFC3339 or Unix format.
[ "UnmarshalJSON", "implements", "the", "json", ".", "Unmarshaler", "interface", ".", "Time", "is", "expected", "in", "RFC3339", "or", "Unix", "format", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/timestamp.go#L27-L36
160,414
google/go-github
github/timestamp.go
Equal
func (t Timestamp) Equal(u Timestamp) bool { return t.Time.Equal(u.Time) }
go
func (t Timestamp) Equal(u Timestamp) bool { return t.Time.Equal(u.Time) }
[ "func", "(", "t", "Timestamp", ")", "Equal", "(", "u", "Timestamp", ")", "bool", "{", "return", "t", ".", "Time", ".", "Equal", "(", "u", ".", "Time", ")", "\n", "}" ]
// Equal reports whether t and u are equal based on time.Equal
[ "Equal", "reports", "whether", "t", "and", "u", "are", "equal", "based", "on", "time", ".", "Equal" ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/timestamp.go#L39-L41
160,415
google/go-github
example/simple/main.go
FetchOrganizations
func FetchOrganizations(username string) ([]*github.Organization, error) { client := github.NewClient(nil) orgs, _, err := client.Organizations.List(context.Background(), username, nil) return orgs, err }
go
func FetchOrganizations(username string) ([]*github.Organization, error) { client := github.NewClient(nil) orgs, _, err := client.Organizations.List(context.Background(), username, nil) return orgs, err }
[ "func", "FetchOrganizations", "(", "username", "string", ")", "(", "[", "]", "*", "github", ".", "Organization", ",", "error", ")", "{", "client", ":=", "github", ".", "NewClient", "(", "nil", ")", "\n", "orgs", ",", "_", ",", "err", ":=", "client", ...
// Fetch all the public organizations' membership of a user. //
[ "Fetch", "all", "the", "public", "organizations", "membership", "of", "a", "user", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/example/simple/main.go#L20-L24
160,416
google/go-github
github/migrations_source_import.go
CommitAuthors
func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } // TODO: remove custom Accept header when this API fully launches req.Header.Set("Accept", mediaTypeImportPreview) var authors []*SourceImportAuthor resp, err := s.client.Do(ctx, req, &authors) if err != nil { return nil, resp, err } return authors, resp, nil }
go
func (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/import/authors", owner, repo) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } // TODO: remove custom Accept header when this API fully launches req.Header.Set("Accept", mediaTypeImportPreview) var authors []*SourceImportAuthor resp, err := s.client.Do(ctx, req, &authors) if err != nil { return nil, resp, err } return authors, resp, nil }
[ "func", "(", "s", "*", "MigrationService", ")", "CommitAuthors", "(", "ctx", "context", ".", "Context", ",", "owner", ",", "repo", "string", ")", "(", "[", "]", "*", "SourceImportAuthor", ",", "*", "Response", ",", "error", ")", "{", "u", ":=", "fmt", ...
// CommitAuthors gets the authors mapped from the original repository. // // Each type of source control system represents authors in a different way. // For example, a Git commit author has a display name and an email address, // but a Subversion commit author just has a username. The GitHub Importer will // make the author information valid, but the author might not be correct. For // example, it will change the bare Subversion username "hubot" into something // like "hubot <hubot@12341234-abab-fefe-8787-fedcba987654>". // // This method and MapCommitAuthor allow you to provide correct Git author // information. // // GitHub API docs: https://developer.github.com/v3/migration/source_imports/#get-commit-authors
[ "CommitAuthors", "gets", "the", "authors", "mapped", "from", "the", "original", "repository", ".", "Each", "type", "of", "source", "control", "system", "represents", "authors", "in", "a", "different", "way", ".", "For", "example", "a", "Git", "commit", "author...
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/migrations_source_import.go#L226-L243
160,417
google/go-github
github/github.go
NewUploadRequest
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error) { if !strings.HasSuffix(c.UploadURL.Path, "/") { return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL) } u, err := c.UploadURL.Parse(urlStr) if err != nil { return nil, err } req, err := http.NewRequest("POST", u.String(), reader) if err != nil { return nil, err } req.ContentLength = size if mediaType == "" { mediaType = defaultMediaType } req.Header.Set("Content-Type", mediaType) req.Header.Set("Accept", mediaTypeV3) req.Header.Set("User-Agent", c.UserAgent) return req, nil }
go
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error) { if !strings.HasSuffix(c.UploadURL.Path, "/") { return nil, fmt.Errorf("UploadURL must have a trailing slash, but %q does not", c.UploadURL) } u, err := c.UploadURL.Parse(urlStr) if err != nil { return nil, err } req, err := http.NewRequest("POST", u.String(), reader) if err != nil { return nil, err } req.ContentLength = size if mediaType == "" { mediaType = defaultMediaType } req.Header.Set("Content-Type", mediaType) req.Header.Set("Accept", mediaTypeV3) req.Header.Set("User-Agent", c.UserAgent) return req, nil }
[ "func", "(", "c", "*", "Client", ")", "NewUploadRequest", "(", "urlStr", "string", ",", "reader", "io", ".", "Reader", ",", "size", "int64", ",", "mediaType", "string", ")", "(", "*", "http", ".", "Request", ",", "error", ")", "{", "if", "!", "string...
// NewUploadRequest creates an upload request. A relative URL can be provided in // urlStr, in which case it is resolved relative to the UploadURL of the Client. // Relative URLs should always be specified without a preceding slash.
[ "NewUploadRequest", "creates", "an", "upload", "request", ".", "A", "relative", "URL", "can", "be", "provided", "in", "urlStr", "in", "which", "case", "it", "is", "resolved", "relative", "to", "the", "UploadURL", "of", "the", "Client", ".", "Relative", "URLs...
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github.go#L354-L376
160,418
google/go-github
github/github.go
newResponse
func newResponse(r *http.Response) *Response { response := &Response{Response: r} response.populatePageValues() response.Rate = parseRate(r) return response }
go
func newResponse(r *http.Response) *Response { response := &Response{Response: r} response.populatePageValues() response.Rate = parseRate(r) return response }
[ "func", "newResponse", "(", "r", "*", "http", ".", "Response", ")", "*", "Response", "{", "response", ":=", "&", "Response", "{", "Response", ":", "r", "}", "\n", "response", ".", "populatePageValues", "(", ")", "\n", "response", ".", "Rate", "=", "par...
// newResponse creates a new Response for the provided http.Response. // r must not be nil.
[ "newResponse", "creates", "a", "new", "Response", "for", "the", "provided", "http", ".", "Response", ".", "r", "must", "not", "be", "nil", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github.go#L401-L406
160,419
google/go-github
github/github.go
populatePageValues
func (r *Response) populatePageValues() { if links, ok := r.Response.Header["Link"]; ok && len(links) > 0 { for _, link := range strings.Split(links[0], ",") { segments := strings.Split(strings.TrimSpace(link), ";") // link must at least have href and rel if len(segments) < 2 { continue } // ensure href is properly formatted if !strings.HasPrefix(segments[0], "<") || !strings.HasSuffix(segments[0], ">") { continue } // try to pull out page parameter url, err := url.Parse(segments[0][1 : len(segments[0])-1]) if err != nil { continue } page := url.Query().Get("page") if page == "" { continue } for _, segment := range segments[1:] { switch strings.TrimSpace(segment) { case `rel="next"`: r.NextPage, _ = strconv.Atoi(page) case `rel="prev"`: r.PrevPage, _ = strconv.Atoi(page) case `rel="first"`: r.FirstPage, _ = strconv.Atoi(page) case `rel="last"`: r.LastPage, _ = strconv.Atoi(page) } } } } }
go
func (r *Response) populatePageValues() { if links, ok := r.Response.Header["Link"]; ok && len(links) > 0 { for _, link := range strings.Split(links[0], ",") { segments := strings.Split(strings.TrimSpace(link), ";") // link must at least have href and rel if len(segments) < 2 { continue } // ensure href is properly formatted if !strings.HasPrefix(segments[0], "<") || !strings.HasSuffix(segments[0], ">") { continue } // try to pull out page parameter url, err := url.Parse(segments[0][1 : len(segments[0])-1]) if err != nil { continue } page := url.Query().Get("page") if page == "" { continue } for _, segment := range segments[1:] { switch strings.TrimSpace(segment) { case `rel="next"`: r.NextPage, _ = strconv.Atoi(page) case `rel="prev"`: r.PrevPage, _ = strconv.Atoi(page) case `rel="first"`: r.FirstPage, _ = strconv.Atoi(page) case `rel="last"`: r.LastPage, _ = strconv.Atoi(page) } } } } }
[ "func", "(", "r", "*", "Response", ")", "populatePageValues", "(", ")", "{", "if", "links", ",", "ok", ":=", "r", ".", "Response", ".", "Header", "[", "\"", "\"", "]", ";", "ok", "&&", "len", "(", "links", ")", ">", "0", "{", "for", "_", ",", ...
// populatePageValues parses the HTTP Link response headers and populates the // various pagination link values in the Response.
[ "populatePageValues", "parses", "the", "HTTP", "Link", "response", "headers", "and", "populates", "the", "various", "pagination", "link", "values", "in", "the", "Response", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github.go#L410-L450
160,420
google/go-github
github/github.go
parseRate
func parseRate(r *http.Response) Rate { var rate Rate if limit := r.Header.Get(headerRateLimit); limit != "" { rate.Limit, _ = strconv.Atoi(limit) } if remaining := r.Header.Get(headerRateRemaining); remaining != "" { rate.Remaining, _ = strconv.Atoi(remaining) } if reset := r.Header.Get(headerRateReset); reset != "" { if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { rate.Reset = Timestamp{time.Unix(v, 0)} } } return rate }
go
func parseRate(r *http.Response) Rate { var rate Rate if limit := r.Header.Get(headerRateLimit); limit != "" { rate.Limit, _ = strconv.Atoi(limit) } if remaining := r.Header.Get(headerRateRemaining); remaining != "" { rate.Remaining, _ = strconv.Atoi(remaining) } if reset := r.Header.Get(headerRateReset); reset != "" { if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 { rate.Reset = Timestamp{time.Unix(v, 0)} } } return rate }
[ "func", "parseRate", "(", "r", "*", "http", ".", "Response", ")", "Rate", "{", "var", "rate", "Rate", "\n", "if", "limit", ":=", "r", ".", "Header", ".", "Get", "(", "headerRateLimit", ")", ";", "limit", "!=", "\"", "\"", "{", "rate", ".", "Limit",...
// parseRate parses the rate related headers.
[ "parseRate", "parses", "the", "rate", "related", "headers", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github.go#L453-L467
160,421
google/go-github
github/github.go
RateLimits
func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) { req, err := c.NewRequest("GET", "rate_limit", nil) if err != nil { return nil, nil, err } response := new(struct { Resources *RateLimits `json:"resources"` }) resp, err := c.Do(ctx, req, response) if err != nil { return nil, nil, err } if response.Resources != nil { c.rateMu.Lock() if response.Resources.Core != nil { c.rateLimits[coreCategory] = *response.Resources.Core } if response.Resources.Search != nil { c.rateLimits[searchCategory] = *response.Resources.Search } c.rateMu.Unlock() } return response.Resources, resp, nil }
go
func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) { req, err := c.NewRequest("GET", "rate_limit", nil) if err != nil { return nil, nil, err } response := new(struct { Resources *RateLimits `json:"resources"` }) resp, err := c.Do(ctx, req, response) if err != nil { return nil, nil, err } if response.Resources != nil { c.rateMu.Lock() if response.Resources.Core != nil { c.rateLimits[coreCategory] = *response.Resources.Core } if response.Resources.Search != nil { c.rateLimits[searchCategory] = *response.Resources.Search } c.rateMu.Unlock() } return response.Resources, resp, nil }
[ "func", "(", "c", "*", "Client", ")", "RateLimits", "(", "ctx", "context", ".", "Context", ")", "(", "*", "RateLimits", ",", "*", "Response", ",", "error", ")", "{", "req", ",", "err", ":=", "c", ".", "NewRequest", "(", "\"", "\"", ",", "\"", "\"...
// RateLimits returns the rate limits for the current client.
[ "RateLimits", "returns", "the", "rate", "limits", "for", "the", "current", "client", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github.go#L836-L862
160,422
google/go-github
github/messages.go
genMAC
func genMAC(message, key []byte, hashFunc func() hash.Hash) []byte { mac := hmac.New(hashFunc, key) mac.Write(message) return mac.Sum(nil) }
go
func genMAC(message, key []byte, hashFunc func() hash.Hash) []byte { mac := hmac.New(hashFunc, key) mac.Write(message) return mac.Sum(nil) }
[ "func", "genMAC", "(", "message", ",", "key", "[", "]", "byte", ",", "hashFunc", "func", "(", ")", "hash", ".", "Hash", ")", "[", "]", "byte", "{", "mac", ":=", "hmac", ".", "New", "(", "hashFunc", ",", "key", ")", "\n", "mac", ".", "Write", "(...
// genMAC generates the HMAC signature for a message provided the secret key // and hashFunc.
[ "genMAC", "generates", "the", "HMAC", "signature", "for", "a", "message", "provided", "the", "secret", "key", "and", "hashFunc", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/messages.go#L89-L93
160,423
google/go-github
github/messages.go
checkMAC
func checkMAC(message, messageMAC, key []byte, hashFunc func() hash.Hash) bool { expectedMAC := genMAC(message, key, hashFunc) return hmac.Equal(messageMAC, expectedMAC) }
go
func checkMAC(message, messageMAC, key []byte, hashFunc func() hash.Hash) bool { expectedMAC := genMAC(message, key, hashFunc) return hmac.Equal(messageMAC, expectedMAC) }
[ "func", "checkMAC", "(", "message", ",", "messageMAC", ",", "key", "[", "]", "byte", ",", "hashFunc", "func", "(", ")", "hash", ".", "Hash", ")", "bool", "{", "expectedMAC", ":=", "genMAC", "(", "message", ",", "key", ",", "hashFunc", ")", "\n", "ret...
// checkMAC reports whether messageMAC is a valid HMAC tag for message.
[ "checkMAC", "reports", "whether", "messageMAC", "is", "a", "valid", "HMAC", "tag", "for", "message", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/messages.go#L96-L99
160,424
google/go-github
github/messages.go
messageMAC
func messageMAC(signature string) ([]byte, func() hash.Hash, error) { if signature == "" { return nil, nil, errors.New("missing signature") } sigParts := strings.SplitN(signature, "=", 2) if len(sigParts) != 2 { return nil, nil, fmt.Errorf("error parsing signature %q", signature) } var hashFunc func() hash.Hash switch sigParts[0] { case sha1Prefix: hashFunc = sha1.New case sha256Prefix: hashFunc = sha256.New case sha512Prefix: hashFunc = sha512.New default: return nil, nil, fmt.Errorf("unknown hash type prefix: %q", sigParts[0]) } buf, err := hex.DecodeString(sigParts[1]) if err != nil { return nil, nil, fmt.Errorf("error decoding signature %q: %v", signature, err) } return buf, hashFunc, nil }
go
func messageMAC(signature string) ([]byte, func() hash.Hash, error) { if signature == "" { return nil, nil, errors.New("missing signature") } sigParts := strings.SplitN(signature, "=", 2) if len(sigParts) != 2 { return nil, nil, fmt.Errorf("error parsing signature %q", signature) } var hashFunc func() hash.Hash switch sigParts[0] { case sha1Prefix: hashFunc = sha1.New case sha256Prefix: hashFunc = sha256.New case sha512Prefix: hashFunc = sha512.New default: return nil, nil, fmt.Errorf("unknown hash type prefix: %q", sigParts[0]) } buf, err := hex.DecodeString(sigParts[1]) if err != nil { return nil, nil, fmt.Errorf("error decoding signature %q: %v", signature, err) } return buf, hashFunc, nil }
[ "func", "messageMAC", "(", "signature", "string", ")", "(", "[", "]", "byte", ",", "func", "(", ")", "hash", ".", "Hash", ",", "error", ")", "{", "if", "signature", "==", "\"", "\"", "{", "return", "nil", ",", "nil", ",", "errors", ".", "New", "(...
// messageMAC returns the hex-decoded HMAC tag from the signature and its // corresponding hash function.
[ "messageMAC", "returns", "the", "hex", "-", "decoded", "HMAC", "tag", "from", "the", "signature", "and", "its", "corresponding", "hash", "function", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/messages.go#L103-L129
160,425
google/go-github
example/commitpr/main.go
getRef
func getRef() (ref *github.Reference, err error) { if ref, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, "refs/heads/"+*commitBranch); err == nil { return ref, nil } // We consider that an error means the branch has not been found and needs to // be created. if *commitBranch == *baseBranch { return nil, errors.New("The commit branch does not exist but `-base-branch` is the same as `-commit-branch`") } if *baseBranch == "" { return nil, errors.New("The `-base-branch` should not be set to an empty string when the branch specified by `-commit-branch` does not exists") } var baseRef *github.Reference if baseRef, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, "refs/heads/"+*baseBranch); err != nil { return nil, err } newRef := &github.Reference{Ref: github.String("refs/heads/" + *commitBranch), Object: &github.GitObject{SHA: baseRef.Object.SHA}} ref, _, err = client.Git.CreateRef(ctx, *sourceOwner, *sourceRepo, newRef) return ref, err }
go
func getRef() (ref *github.Reference, err error) { if ref, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, "refs/heads/"+*commitBranch); err == nil { return ref, nil } // We consider that an error means the branch has not been found and needs to // be created. if *commitBranch == *baseBranch { return nil, errors.New("The commit branch does not exist but `-base-branch` is the same as `-commit-branch`") } if *baseBranch == "" { return nil, errors.New("The `-base-branch` should not be set to an empty string when the branch specified by `-commit-branch` does not exists") } var baseRef *github.Reference if baseRef, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, "refs/heads/"+*baseBranch); err != nil { return nil, err } newRef := &github.Reference{Ref: github.String("refs/heads/" + *commitBranch), Object: &github.GitObject{SHA: baseRef.Object.SHA}} ref, _, err = client.Git.CreateRef(ctx, *sourceOwner, *sourceRepo, newRef) return ref, err }
[ "func", "getRef", "(", ")", "(", "ref", "*", "github", ".", "Reference", ",", "err", "error", ")", "{", "if", "ref", ",", "_", ",", "err", "=", "client", ".", "Git", ".", "GetRef", "(", "ctx", ",", "*", "sourceOwner", ",", "*", "sourceRepo", ",",...
// getRef returns the commit branch reference object if it exists or creates it // from the base branch before returning it.
[ "getRef", "returns", "the", "commit", "branch", "reference", "object", "if", "it", "exists", "or", "creates", "it", "from", "the", "base", "branch", "before", "returning", "it", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/example/commitpr/main.go#L62-L84
160,426
google/go-github
example/commitpr/main.go
getTree
func getTree(ref *github.Reference) (tree *github.Tree, err error) { // Create a tree with what to commit. entries := []github.TreeEntry{} // Load each file into the tree. for _, fileArg := range strings.Split(*sourceFiles, ",") { file, content, err := getFileContent(fileArg) if err != nil { return nil, err } entries = append(entries, github.TreeEntry{Path: github.String(file), Type: github.String("blob"), Content: github.String(string(content)), Mode: github.String("100644")}) } tree, _, err = client.Git.CreateTree(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA, entries) return tree, err }
go
func getTree(ref *github.Reference) (tree *github.Tree, err error) { // Create a tree with what to commit. entries := []github.TreeEntry{} // Load each file into the tree. for _, fileArg := range strings.Split(*sourceFiles, ",") { file, content, err := getFileContent(fileArg) if err != nil { return nil, err } entries = append(entries, github.TreeEntry{Path: github.String(file), Type: github.String("blob"), Content: github.String(string(content)), Mode: github.String("100644")}) } tree, _, err = client.Git.CreateTree(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA, entries) return tree, err }
[ "func", "getTree", "(", "ref", "*", "github", ".", "Reference", ")", "(", "tree", "*", "github", ".", "Tree", ",", "err", "error", ")", "{", "// Create a tree with what to commit.", "entries", ":=", "[", "]", "github", ".", "TreeEntry", "{", "}", "\n\n", ...
// getTree generates the tree to commit based on the given files and the commit // of the ref you got in getRef.
[ "getTree", "generates", "the", "tree", "to", "commit", "based", "on", "the", "given", "files", "and", "the", "commit", "of", "the", "ref", "you", "got", "in", "getRef", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/example/commitpr/main.go#L88-L103
160,427
google/go-github
example/commitpr/main.go
getFileContent
func getFileContent(fileArg string) (targetName string, b []byte, err error) { var localFile string files := strings.Split(fileArg, ":") switch { case len(files) < 1: return "", nil, errors.New("empty `-files` parameter") case len(files) == 1: localFile = files[0] targetName = files[0] default: localFile = files[0] targetName = files[1] } b, err = ioutil.ReadFile(localFile) return targetName, b, err }
go
func getFileContent(fileArg string) (targetName string, b []byte, err error) { var localFile string files := strings.Split(fileArg, ":") switch { case len(files) < 1: return "", nil, errors.New("empty `-files` parameter") case len(files) == 1: localFile = files[0] targetName = files[0] default: localFile = files[0] targetName = files[1] } b, err = ioutil.ReadFile(localFile) return targetName, b, err }
[ "func", "getFileContent", "(", "fileArg", "string", ")", "(", "targetName", "string", ",", "b", "[", "]", "byte", ",", "err", "error", ")", "{", "var", "localFile", "string", "\n", "files", ":=", "strings", ".", "Split", "(", "fileArg", ",", "\"", "\""...
// getFileContent loads the local content of a file and return the target name // of the file in the target repository and its contents.
[ "getFileContent", "loads", "the", "local", "content", "of", "a", "file", "and", "return", "the", "target", "name", "of", "the", "file", "in", "the", "target", "repository", "and", "its", "contents", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/example/commitpr/main.go#L107-L123
160,428
google/go-github
example/commitpr/main.go
pushCommit
func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { // Get the parent commit to attach the commit to. parent, _, err := client.Repositories.GetCommit(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA) if err != nil { return err } // This is not always populated, but is needed. parent.Commit.SHA = parent.SHA // Create the commit using the tree. date := time.Now() author := &github.CommitAuthor{Date: &date, Name: authorName, Email: authorEmail} commit := &github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []github.Commit{*parent.Commit}} newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit) if err != nil { return err } // Attach the commit to the master branch. ref.Object.SHA = newCommit.SHA _, _, err = client.Git.UpdateRef(ctx, *sourceOwner, *sourceRepo, ref, false) return err }
go
func pushCommit(ref *github.Reference, tree *github.Tree) (err error) { // Get the parent commit to attach the commit to. parent, _, err := client.Repositories.GetCommit(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA) if err != nil { return err } // This is not always populated, but is needed. parent.Commit.SHA = parent.SHA // Create the commit using the tree. date := time.Now() author := &github.CommitAuthor{Date: &date, Name: authorName, Email: authorEmail} commit := &github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []github.Commit{*parent.Commit}} newCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit) if err != nil { return err } // Attach the commit to the master branch. ref.Object.SHA = newCommit.SHA _, _, err = client.Git.UpdateRef(ctx, *sourceOwner, *sourceRepo, ref, false) return err }
[ "func", "pushCommit", "(", "ref", "*", "github", ".", "Reference", ",", "tree", "*", "github", ".", "Tree", ")", "(", "err", "error", ")", "{", "// Get the parent commit to attach the commit to.", "parent", ",", "_", ",", "err", ":=", "client", ".", "Reposit...
// createCommit creates the commit in the given reference using the given tree.
[ "createCommit", "creates", "the", "commit", "in", "the", "given", "reference", "using", "the", "given", "tree", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/example/commitpr/main.go#L126-L148
160,429
google/go-github
github/misc.go
Octocat
func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { u = fmt.Sprintf("%s?s=%s", u, url.QueryEscape(message)) } req, err := c.NewRequest("GET", u, nil) if err != nil { return "", nil, err } buf := new(bytes.Buffer) resp, err := c.Do(ctx, req, buf) if err != nil { return "", resp, err } return buf.String(), resp, nil }
go
func (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) { u := "octocat" if message != "" { u = fmt.Sprintf("%s?s=%s", u, url.QueryEscape(message)) } req, err := c.NewRequest("GET", u, nil) if err != nil { return "", nil, err } buf := new(bytes.Buffer) resp, err := c.Do(ctx, req, buf) if err != nil { return "", resp, err } return buf.String(), resp, nil }
[ "func", "(", "c", "*", "Client", ")", "Octocat", "(", "ctx", "context", ".", "Context", ",", "message", "string", ")", "(", "string", ",", "*", "Response", ",", "error", ")", "{", "u", ":=", "\"", "\"", "\n", "if", "message", "!=", "\"", "\"", "{...
// Octocat returns an ASCII art octocat with the specified message in a speech // bubble. If message is empty, a random zen phrase is used.
[ "Octocat", "returns", "an", "ASCII", "art", "octocat", "with", "the", "specified", "message", "in", "a", "speech", "bubble", ".", "If", "message", "is", "empty", "a", "random", "zen", "phrase", "is", "used", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/misc.go#L189-L207
160,430
google/go-github
github/github-accessors.go
GetRetryAfter
func (a *AbuseRateLimitError) GetRetryAfter() time.Duration { if a == nil || a.RetryAfter == nil { return 0 } return *a.RetryAfter }
go
func (a *AbuseRateLimitError) GetRetryAfter() time.Duration { if a == nil || a.RetryAfter == nil { return 0 } return *a.RetryAfter }
[ "func", "(", "a", "*", "AbuseRateLimitError", ")", "GetRetryAfter", "(", ")", "time", ".", "Duration", "{", "if", "a", "==", "nil", "||", "a", ".", "RetryAfter", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "a", ".", "RetryAfter",...
// GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise.
[ "GetRetryAfter", "returns", "the", "RetryAfter", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L16-L21
160,431
google/go-github
github/github-accessors.go
GetVerifiablePasswordAuthentication
func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { if a == nil || a.VerifiablePasswordAuthentication == nil { return false } return *a.VerifiablePasswordAuthentication }
go
func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { if a == nil || a.VerifiablePasswordAuthentication == nil { return false } return *a.VerifiablePasswordAuthentication }
[ "func", "(", "a", "*", "APIMeta", ")", "GetVerifiablePasswordAuthentication", "(", ")", "bool", "{", "if", "a", "==", "nil", "||", "a", ".", "VerifiablePasswordAuthentication", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "a", ".", ...
// GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise.
[ "GetVerifiablePasswordAuthentication", "returns", "the", "VerifiablePasswordAuthentication", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L112-L117
160,432
google/go-github
github/github-accessors.go
GetExternalURL
func (a *App) GetExternalURL() string { if a == nil || a.ExternalURL == nil { return "" } return *a.ExternalURL }
go
func (a *App) GetExternalURL() string { if a == nil || a.ExternalURL == nil { return "" } return *a.ExternalURL }
[ "func", "(", "a", "*", "App", ")", "GetExternalURL", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "ExternalURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "ExternalURL", "\n", "}" ]
// GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.
[ "GetExternalURL", "returns", "the", "ExternalURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L136-L141
160,433
google/go-github
github/github-accessors.go
GetHashedToken
func (a *Authorization) GetHashedToken() string { if a == nil || a.HashedToken == nil { return "" } return *a.HashedToken }
go
func (a *Authorization) GetHashedToken() string { if a == nil || a.HashedToken == nil { return "" } return *a.HashedToken }
[ "func", "(", "a", "*", "Authorization", ")", "GetHashedToken", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "HashedToken", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "HashedToken", "\n", "}...
// GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.
[ "GetHashedToken", "returns", "the", "HashedToken", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L240-L245
160,434
google/go-github
github/github-accessors.go
GetTokenLastEight
func (a *Authorization) GetTokenLastEight() string { if a == nil || a.TokenLastEight == nil { return "" } return *a.TokenLastEight }
go
func (a *Authorization) GetTokenLastEight() string { if a == nil || a.TokenLastEight == nil { return "" } return *a.TokenLastEight }
[ "func", "(", "a", "*", "Authorization", ")", "GetTokenLastEight", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "TokenLastEight", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "TokenLastEight", "...
// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.
[ "GetTokenLastEight", "returns", "the", "TokenLastEight", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L280-L285
160,435
google/go-github
github/github-accessors.go
GetClientSecret
func (a *AuthorizationRequest) GetClientSecret() string { if a == nil || a.ClientSecret == nil { return "" } return *a.ClientSecret }
go
func (a *AuthorizationRequest) GetClientSecret() string { if a == nil || a.ClientSecret == nil { return "" } return *a.ClientSecret }
[ "func", "(", "a", "*", "AuthorizationRequest", ")", "GetClientSecret", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "ClientSecret", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "ClientSecret", ...
// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.
[ "GetClientSecret", "returns", "the", "ClientSecret", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L344-L349
160,436
google/go-github
github/github-accessors.go
GetSetting
func (a *AutoTriggerCheck) GetSetting() bool { if a == nil || a.Setting == nil { return false } return *a.Setting }
go
func (a *AutoTriggerCheck) GetSetting() bool { if a == nil || a.Setting == nil { return false } return *a.Setting }
[ "func", "(", "a", "*", "AutoTriggerCheck", ")", "GetSetting", "(", ")", "bool", "{", "if", "a", "==", "nil", "||", "a", ".", "Setting", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "a", ".", "Setting", "\n", "}" ]
// GetSetting returns the Setting field if it's non-nil, zero value otherwise.
[ "GetSetting", "returns", "the", "Setting", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L408-L413
160,437
google/go-github
github/github-accessors.go
GetProtected
func (b *Branch) GetProtected() bool { if b == nil || b.Protected == nil { return false } return *b.Protected }
go
func (b *Branch) GetProtected() bool { if b == nil || b.Protected == nil { return false } return *b.Protected }
[ "func", "(", "b", "*", "Branch", ")", "GetProtected", "(", ")", "bool", "{", "if", "b", "==", "nil", "||", "b", ".", "Protected", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "b", ".", "Protected", "\n", "}" ]
// GetProtected returns the Protected field if it's non-nil, zero value otherwise.
[ "GetProtected", "returns", "the", "Protected", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L480-L485
160,438
google/go-github
github/github-accessors.go
GetAnnotationLevel
func (c *CheckRunAnnotation) GetAnnotationLevel() string { if c == nil || c.AnnotationLevel == nil { return "" } return *c.AnnotationLevel }
go
func (c *CheckRunAnnotation) GetAnnotationLevel() string { if c == nil || c.AnnotationLevel == nil { return "" } return *c.AnnotationLevel }
[ "func", "(", "c", "*", "CheckRunAnnotation", ")", "GetAnnotationLevel", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "AnnotationLevel", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "AnnotationLev...
// GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise.
[ "GetAnnotationLevel", "returns", "the", "AnnotationLevel", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L608-L613
160,439
google/go-github
github/github-accessors.go
GetBlobHRef
func (c *CheckRunAnnotation) GetBlobHRef() string { if c == nil || c.BlobHRef == nil { return "" } return *c.BlobHRef }
go
func (c *CheckRunAnnotation) GetBlobHRef() string { if c == nil || c.BlobHRef == nil { return "" } return *c.BlobHRef }
[ "func", "(", "c", "*", "CheckRunAnnotation", ")", "GetBlobHRef", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "BlobHRef", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "BlobHRef", "\n", "}" ]
// GetBlobHRef returns the BlobHRef field if it's non-nil, zero value otherwise.
[ "GetBlobHRef", "returns", "the", "BlobHRef", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L616-L621
160,440
google/go-github
github/github-accessors.go
GetEndLine
func (c *CheckRunAnnotation) GetEndLine() int { if c == nil || c.EndLine == nil { return 0 } return *c.EndLine }
go
func (c *CheckRunAnnotation) GetEndLine() int { if c == nil || c.EndLine == nil { return 0 } return *c.EndLine }
[ "func", "(", "c", "*", "CheckRunAnnotation", ")", "GetEndLine", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "EndLine", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "EndLine", "\n", "}" ]
// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.
[ "GetEndLine", "returns", "the", "EndLine", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L624-L629
160,441
google/go-github
github/github-accessors.go
GetRawDetails
func (c *CheckRunAnnotation) GetRawDetails() string { if c == nil || c.RawDetails == nil { return "" } return *c.RawDetails }
go
func (c *CheckRunAnnotation) GetRawDetails() string { if c == nil || c.RawDetails == nil { return "" } return *c.RawDetails }
[ "func", "(", "c", "*", "CheckRunAnnotation", ")", "GetRawDetails", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "RawDetails", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "RawDetails", "\n", ...
// GetRawDetails returns the RawDetails field if it's non-nil, zero value otherwise.
[ "GetRawDetails", "returns", "the", "RawDetails", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L648-L653
160,442
google/go-github
github/github-accessors.go
GetStartLine
func (c *CheckRunAnnotation) GetStartLine() int { if c == nil || c.StartLine == nil { return 0 } return *c.StartLine }
go
func (c *CheckRunAnnotation) GetStartLine() int { if c == nil || c.StartLine == nil { return 0 } return *c.StartLine }
[ "func", "(", "c", "*", "CheckRunAnnotation", ")", "GetStartLine", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "StartLine", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "StartLine", "\n", "}" ]
// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.
[ "GetStartLine", "returns", "the", "StartLine", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L656-L661
160,443
google/go-github
github/github-accessors.go
GetAlt
func (c *CheckRunImage) GetAlt() string { if c == nil || c.Alt == nil { return "" } return *c.Alt }
go
func (c *CheckRunImage) GetAlt() string { if c == nil || c.Alt == nil { return "" } return *c.Alt }
[ "func", "(", "c", "*", "CheckRunImage", ")", "GetAlt", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "Alt", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "Alt", "\n", "}" ]
// GetAlt returns the Alt field if it's non-nil, zero value otherwise.
[ "GetAlt", "returns", "the", "Alt", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L728-L733
160,444
google/go-github
github/github-accessors.go
GetCaption
func (c *CheckRunImage) GetCaption() string { if c == nil || c.Caption == nil { return "" } return *c.Caption }
go
func (c *CheckRunImage) GetCaption() string { if c == nil || c.Caption == nil { return "" } return *c.Caption }
[ "func", "(", "c", "*", "CheckRunImage", ")", "GetCaption", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "Caption", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "Caption", "\n", "}" ]
// GetCaption returns the Caption field if it's non-nil, zero value otherwise.
[ "GetCaption", "returns", "the", "Caption", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L736-L741
160,445
google/go-github
github/github-accessors.go
GetImageURL
func (c *CheckRunImage) GetImageURL() string { if c == nil || c.ImageURL == nil { return "" } return *c.ImageURL }
go
func (c *CheckRunImage) GetImageURL() string { if c == nil || c.ImageURL == nil { return "" } return *c.ImageURL }
[ "func", "(", "c", "*", "CheckRunImage", ")", "GetImageURL", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "ImageURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "ImageURL", "\n", "}" ]
// GetImageURL returns the ImageURL field if it's non-nil, zero value otherwise.
[ "GetImageURL", "returns", "the", "ImageURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L744-L749
160,446
google/go-github
github/github-accessors.go
GetAnnotationsCount
func (c *CheckRunOutput) GetAnnotationsCount() int { if c == nil || c.AnnotationsCount == nil { return 0 } return *c.AnnotationsCount }
go
func (c *CheckRunOutput) GetAnnotationsCount() int { if c == nil || c.AnnotationsCount == nil { return 0 } return *c.AnnotationsCount }
[ "func", "(", "c", "*", "CheckRunOutput", ")", "GetAnnotationsCount", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "AnnotationsCount", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "AnnotationsCount", "\n", ...
// GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise.
[ "GetAnnotationsCount", "returns", "the", "AnnotationsCount", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L752-L757
160,447
google/go-github
github/github-accessors.go
GetAnnotationsURL
func (c *CheckRunOutput) GetAnnotationsURL() string { if c == nil || c.AnnotationsURL == nil { return "" } return *c.AnnotationsURL }
go
func (c *CheckRunOutput) GetAnnotationsURL() string { if c == nil || c.AnnotationsURL == nil { return "" } return *c.AnnotationsURL }
[ "func", "(", "c", "*", "CheckRunOutput", ")", "GetAnnotationsURL", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "AnnotationsURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "AnnotationsURL", ...
// GetAnnotationsURL returns the AnnotationsURL field if it's non-nil, zero value otherwise.
[ "GetAnnotationsURL", "returns", "the", "AnnotationsURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L760-L765
160,448
google/go-github
github/github-accessors.go
GetAfterSHA
func (c *CheckSuite) GetAfterSHA() string { if c == nil || c.AfterSHA == nil { return "" } return *c.AfterSHA }
go
func (c *CheckSuite) GetAfterSHA() string { if c == nil || c.AfterSHA == nil { return "" } return *c.AfterSHA }
[ "func", "(", "c", "*", "CheckSuite", ")", "GetAfterSHA", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "AfterSHA", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "AfterSHA", "\n", "}" ]
// GetAfterSHA returns the AfterSHA field if it's non-nil, zero value otherwise.
[ "GetAfterSHA", "returns", "the", "AfterSHA", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L792-L797
160,449
google/go-github
github/github-accessors.go
GetBeforeSHA
func (c *CheckSuite) GetBeforeSHA() string { if c == nil || c.BeforeSHA == nil { return "" } return *c.BeforeSHA }
go
func (c *CheckSuite) GetBeforeSHA() string { if c == nil || c.BeforeSHA == nil { return "" } return *c.BeforeSHA }
[ "func", "(", "c", "*", "CheckSuite", ")", "GetBeforeSHA", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "BeforeSHA", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "BeforeSHA", "\n", "}" ]
// GetBeforeSHA returns the BeforeSHA field if it's non-nil, zero value otherwise.
[ "GetBeforeSHA", "returns", "the", "BeforeSHA", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L808-L813
160,450
google/go-github
github/github-accessors.go
GetTotalCommitComments
func (c *CommentStats) GetTotalCommitComments() int { if c == nil || c.TotalCommitComments == nil { return 0 } return *c.TotalCommitComments }
go
func (c *CommentStats) GetTotalCommitComments() int { if c == nil || c.TotalCommitComments == nil { return 0 } return *c.TotalCommitComments }
[ "func", "(", "c", "*", "CommentStats", ")", "GetTotalCommitComments", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "TotalCommitComments", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "TotalCommitComments", ...
// GetTotalCommitComments returns the TotalCommitComments field if it's non-nil, zero value otherwise.
[ "GetTotalCommitComments", "returns", "the", "TotalCommitComments", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1088-L1093
160,451
google/go-github
github/github-accessors.go
GetTotalGistComments
func (c *CommentStats) GetTotalGistComments() int { if c == nil || c.TotalGistComments == nil { return 0 } return *c.TotalGistComments }
go
func (c *CommentStats) GetTotalGistComments() int { if c == nil || c.TotalGistComments == nil { return 0 } return *c.TotalGistComments }
[ "func", "(", "c", "*", "CommentStats", ")", "GetTotalGistComments", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "TotalGistComments", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "TotalGistComments", "\n",...
// GetTotalGistComments returns the TotalGistComments field if it's non-nil, zero value otherwise.
[ "GetTotalGistComments", "returns", "the", "TotalGistComments", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1096-L1101
160,452
google/go-github
github/github-accessors.go
GetTotalIssueComments
func (c *CommentStats) GetTotalIssueComments() int { if c == nil || c.TotalIssueComments == nil { return 0 } return *c.TotalIssueComments }
go
func (c *CommentStats) GetTotalIssueComments() int { if c == nil || c.TotalIssueComments == nil { return 0 } return *c.TotalIssueComments }
[ "func", "(", "c", "*", "CommentStats", ")", "GetTotalIssueComments", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "TotalIssueComments", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "TotalIssueComments", "\...
// GetTotalIssueComments returns the TotalIssueComments field if it's non-nil, zero value otherwise.
[ "GetTotalIssueComments", "returns", "the", "TotalIssueComments", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1104-L1109
160,453
google/go-github
github/github-accessors.go
GetTotalPullRequestComments
func (c *CommentStats) GetTotalPullRequestComments() int { if c == nil || c.TotalPullRequestComments == nil { return 0 } return *c.TotalPullRequestComments }
go
func (c *CommentStats) GetTotalPullRequestComments() int { if c == nil || c.TotalPullRequestComments == nil { return 0 } return *c.TotalPullRequestComments }
[ "func", "(", "c", "*", "CommentStats", ")", "GetTotalPullRequestComments", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "TotalPullRequestComments", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "TotalPullRequ...
// GetTotalPullRequestComments returns the TotalPullRequestComments field if it's non-nil, zero value otherwise.
[ "GetTotalPullRequestComments", "returns", "the", "TotalPullRequestComments", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1112-L1117
160,454
google/go-github
github/github-accessors.go
GetCommentCount
func (c *Commit) GetCommentCount() int { if c == nil || c.CommentCount == nil { return 0 } return *c.CommentCount }
go
func (c *Commit) GetCommentCount() int { if c == nil || c.CommentCount == nil { return 0 } return *c.CommentCount }
[ "func", "(", "c", "*", "Commit", ")", "GetCommentCount", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "CommentCount", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "CommentCount", "\n", "}" ]
// GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.
[ "GetCommentCount", "returns", "the", "CommentCount", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1128-L1133
160,455
google/go-github
github/github-accessors.go
GetDate
func (c *CommitAuthor) GetDate() time.Time { if c == nil || c.Date == nil { return time.Time{} } return *c.Date }
go
func (c *CommitAuthor) GetDate() time.Time { if c == nil || c.Date == nil { return time.Time{} } return *c.Date }
[ "func", "(", "c", "*", "CommitAuthor", ")", "GetDate", "(", ")", "time", ".", "Time", "{", "if", "c", "==", "nil", "||", "c", ".", "Date", "==", "nil", "{", "return", "time", ".", "Time", "{", "}", "\n", "}", "\n", "return", "*", "c", ".", "D...
// GetDate returns the Date field if it's non-nil, zero value otherwise.
[ "GetDate", "returns", "the", "Date", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1208-L1213
160,456
google/go-github
github/github-accessors.go
GetBlobURL
func (c *CommitFile) GetBlobURL() string { if c == nil || c.BlobURL == nil { return "" } return *c.BlobURL }
go
func (c *CommitFile) GetBlobURL() string { if c == nil || c.BlobURL == nil { return "" } return *c.BlobURL }
[ "func", "(", "c", "*", "CommitFile", ")", "GetBlobURL", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "BlobURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "BlobURL", "\n", "}" ]
// GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.
[ "GetBlobURL", "returns", "the", "BlobURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1288-L1293
160,457
google/go-github
github/github-accessors.go
GetChanges
func (c *CommitFile) GetChanges() int { if c == nil || c.Changes == nil { return 0 } return *c.Changes }
go
func (c *CommitFile) GetChanges() int { if c == nil || c.Changes == nil { return 0 } return *c.Changes }
[ "func", "(", "c", "*", "CommitFile", ")", "GetChanges", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "Changes", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "Changes", "\n", "}" ]
// GetChanges returns the Changes field if it's non-nil, zero value otherwise.
[ "GetChanges", "returns", "the", "Changes", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1296-L1301
160,458
google/go-github
github/github-accessors.go
GetPatch
func (c *CommitFile) GetPatch() string { if c == nil || c.Patch == nil { return "" } return *c.Patch }
go
func (c *CommitFile) GetPatch() string { if c == nil || c.Patch == nil { return "" } return *c.Patch }
[ "func", "(", "c", "*", "CommitFile", ")", "GetPatch", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "Patch", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "Patch", "\n", "}" ]
// GetPatch returns the Patch field if it's non-nil, zero value otherwise.
[ "GetPatch", "returns", "the", "Patch", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1328-L1333
160,459
google/go-github
github/github-accessors.go
GetPreviousFilename
func (c *CommitFile) GetPreviousFilename() string { if c == nil || c.PreviousFilename == nil { return "" } return *c.PreviousFilename }
go
func (c *CommitFile) GetPreviousFilename() string { if c == nil || c.PreviousFilename == nil { return "" } return *c.PreviousFilename }
[ "func", "(", "c", "*", "CommitFile", ")", "GetPreviousFilename", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "PreviousFilename", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "PreviousFilename", ...
// GetPreviousFilename returns the PreviousFilename field if it's non-nil, zero value otherwise.
[ "GetPreviousFilename", "returns", "the", "PreviousFilename", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1336-L1341
160,460
google/go-github
github/github-accessors.go
GetAheadBy
func (c *CommitsComparison) GetAheadBy() int { if c == nil || c.AheadBy == nil { return 0 } return *c.AheadBy }
go
func (c *CommitsComparison) GetAheadBy() int { if c == nil || c.AheadBy == nil { return 0 } return *c.AheadBy }
[ "func", "(", "c", "*", "CommitsComparison", ")", "GetAheadBy", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "AheadBy", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "AheadBy", "\n", "}" ]
// GetAheadBy returns the AheadBy field if it's non-nil, zero value otherwise.
[ "GetAheadBy", "returns", "the", "AheadBy", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1440-L1445
160,461
google/go-github
github/github-accessors.go
GetBehindBy
func (c *CommitsComparison) GetBehindBy() int { if c == nil || c.BehindBy == nil { return 0 } return *c.BehindBy }
go
func (c *CommitsComparison) GetBehindBy() int { if c == nil || c.BehindBy == nil { return 0 } return *c.BehindBy }
[ "func", "(", "c", "*", "CommitsComparison", ")", "GetBehindBy", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "BehindBy", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "BehindBy", "\n", "}" ]
// GetBehindBy returns the BehindBy field if it's non-nil, zero value otherwise.
[ "GetBehindBy", "returns", "the", "BehindBy", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1456-L1461
160,462
google/go-github
github/github-accessors.go
GetPermalinkURL
func (c *CommitsComparison) GetPermalinkURL() string { if c == nil || c.PermalinkURL == nil { return "" } return *c.PermalinkURL }
go
func (c *CommitsComparison) GetPermalinkURL() string { if c == nil || c.PermalinkURL == nil { return "" } return *c.PermalinkURL }
[ "func", "(", "c", "*", "CommitsComparison", ")", "GetPermalinkURL", "(", ")", "string", "{", "if", "c", "==", "nil", "||", "c", ".", "PermalinkURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "PermalinkURL", "\n...
// GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.
[ "GetPermalinkURL", "returns", "the", "PermalinkURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1496-L1501
160,463
google/go-github
github/github-accessors.go
GetTotalCommits
func (c *CommitsComparison) GetTotalCommits() int { if c == nil || c.TotalCommits == nil { return 0 } return *c.TotalCommits }
go
func (c *CommitsComparison) GetTotalCommits() int { if c == nil || c.TotalCommits == nil { return 0 } return *c.TotalCommits }
[ "func", "(", "c", "*", "CommitsComparison", ")", "GetTotalCommits", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "TotalCommits", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "TotalCommits", "\n", "}" ]
// GetTotalCommits returns the TotalCommits field if it's non-nil, zero value otherwise.
[ "GetTotalCommits", "returns", "the", "TotalCommits", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1512-L1517
160,464
google/go-github
github/github-accessors.go
GetHealthPercentage
func (c *CommunityHealthMetrics) GetHealthPercentage() int { if c == nil || c.HealthPercentage == nil { return 0 } return *c.HealthPercentage }
go
func (c *CommunityHealthMetrics) GetHealthPercentage() int { if c == nil || c.HealthPercentage == nil { return 0 } return *c.HealthPercentage }
[ "func", "(", "c", "*", "CommunityHealthMetrics", ")", "GetHealthPercentage", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "HealthPercentage", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "HealthPercentage", ...
// GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise.
[ "GetHealthPercentage", "returns", "the", "HealthPercentage", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1624-L1629
160,465
google/go-github
github/github-accessors.go
GetContributions
func (c *Contributor) GetContributions() int { if c == nil || c.Contributions == nil { return 0 } return *c.Contributions }
go
func (c *Contributor) GetContributions() int { if c == nil || c.Contributions == nil { return 0 } return *c.Contributions }
[ "func", "(", "c", "*", "Contributor", ")", "GetContributions", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "Contributions", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "Contributions", "\n", "}" ]
// GetContributions returns the Contributions field if it's non-nil, zero value otherwise.
[ "GetContributions", "returns", "the", "Contributions", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1648-L1653
160,466
google/go-github
github/github-accessors.go
GetInviteeID
func (c *CreateOrgInvitationOptions) GetInviteeID() int64 { if c == nil || c.InviteeID == nil { return 0 } return *c.InviteeID }
go
func (c *CreateOrgInvitationOptions) GetInviteeID() int64 { if c == nil || c.InviteeID == nil { return 0 } return *c.InviteeID }
[ "func", "(", "c", "*", "CreateOrgInvitationOptions", ")", "GetInviteeID", "(", ")", "int64", "{", "if", "c", "==", "nil", "||", "c", ".", "InviteeID", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "InviteeID", "\n", "}" ]
// GetInviteeID returns the InviteeID field if it's non-nil, zero value otherwise.
[ "GetInviteeID", "returns", "the", "InviteeID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L1936-L1941
160,467
google/go-github
github/github-accessors.go
GetAutoMerge
func (d *DeploymentRequest) GetAutoMerge() bool { if d == nil || d.AutoMerge == nil { return false } return *d.AutoMerge }
go
func (d *DeploymentRequest) GetAutoMerge() bool { if d == nil || d.AutoMerge == nil { return false } return *d.AutoMerge }
[ "func", "(", "d", "*", "DeploymentRequest", ")", "GetAutoMerge", "(", ")", "bool", "{", "if", "d", "==", "nil", "||", "d", ".", "AutoMerge", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "d", ".", "AutoMerge", "\n", "}" ]
// GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise.
[ "GetAutoMerge", "returns", "the", "AutoMerge", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2152-L2157
160,468
google/go-github
github/github-accessors.go
GetProductionEnvironment
func (d *DeploymentRequest) GetProductionEnvironment() bool { if d == nil || d.ProductionEnvironment == nil { return false } return *d.ProductionEnvironment }
go
func (d *DeploymentRequest) GetProductionEnvironment() bool { if d == nil || d.ProductionEnvironment == nil { return false } return *d.ProductionEnvironment }
[ "func", "(", "d", "*", "DeploymentRequest", ")", "GetProductionEnvironment", "(", ")", "bool", "{", "if", "d", "==", "nil", "||", "d", ".", "ProductionEnvironment", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "d", ".", "Productio...
// GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise.
[ "GetProductionEnvironment", "returns", "the", "ProductionEnvironment", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2184-L2189
160,469
google/go-github
github/github-accessors.go
GetRequiredContexts
func (d *DeploymentRequest) GetRequiredContexts() []string { if d == nil || d.RequiredContexts == nil { return nil } return *d.RequiredContexts }
go
func (d *DeploymentRequest) GetRequiredContexts() []string { if d == nil || d.RequiredContexts == nil { return nil } return *d.RequiredContexts }
[ "func", "(", "d", "*", "DeploymentRequest", ")", "GetRequiredContexts", "(", ")", "[", "]", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "RequiredContexts", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "*", "d", ".", "Requi...
// GetRequiredContexts returns the RequiredContexts field if it's non-nil, zero value otherwise.
[ "GetRequiredContexts", "returns", "the", "RequiredContexts", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2200-L2205
160,470
google/go-github
github/github-accessors.go
GetTransientEnvironment
func (d *DeploymentRequest) GetTransientEnvironment() bool { if d == nil || d.TransientEnvironment == nil { return false } return *d.TransientEnvironment }
go
func (d *DeploymentRequest) GetTransientEnvironment() bool { if d == nil || d.TransientEnvironment == nil { return false } return *d.TransientEnvironment }
[ "func", "(", "d", "*", "DeploymentRequest", ")", "GetTransientEnvironment", "(", ")", "bool", "{", "if", "d", "==", "nil", "||", "d", ".", "TransientEnvironment", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "d", ".", "TransientEn...
// GetTransientEnvironment returns the TransientEnvironment field if it's non-nil, zero value otherwise.
[ "GetTransientEnvironment", "returns", "the", "TransientEnvironment", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2216-L2221
160,471
google/go-github
github/github-accessors.go
GetDeploymentURL
func (d *DeploymentStatus) GetDeploymentURL() string { if d == nil || d.DeploymentURL == nil { return "" } return *d.DeploymentURL }
go
func (d *DeploymentStatus) GetDeploymentURL() string { if d == nil || d.DeploymentURL == nil { return "" } return *d.DeploymentURL }
[ "func", "(", "d", "*", "DeploymentStatus", ")", "GetDeploymentURL", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "DeploymentURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "DeploymentURL", "...
// GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise.
[ "GetDeploymentURL", "returns", "the", "DeploymentURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2240-L2245
160,472
google/go-github
github/github-accessors.go
GetAutoInactive
func (d *DeploymentStatusRequest) GetAutoInactive() bool { if d == nil || d.AutoInactive == nil { return false } return *d.AutoInactive }
go
func (d *DeploymentStatusRequest) GetAutoInactive() bool { if d == nil || d.AutoInactive == nil { return false } return *d.AutoInactive }
[ "func", "(", "d", "*", "DeploymentStatusRequest", ")", "GetAutoInactive", "(", ")", "bool", "{", "if", "d", "==", "nil", "||", "d", ".", "AutoInactive", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "d", ".", "AutoInactive", "\n"...
// GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise.
[ "GetAutoInactive", "returns", "the", "AutoInactive", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2344-L2349
160,473
google/go-github
github/github-accessors.go
GetEnvironmentURL
func (d *DeploymentStatusRequest) GetEnvironmentURL() string { if d == nil || d.EnvironmentURL == nil { return "" } return *d.EnvironmentURL }
go
func (d *DeploymentStatusRequest) GetEnvironmentURL() string { if d == nil || d.EnvironmentURL == nil { return "" } return *d.EnvironmentURL }
[ "func", "(", "d", "*", "DeploymentStatusRequest", ")", "GetEnvironmentURL", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "EnvironmentURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "Environmen...
// GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.
[ "GetEnvironmentURL", "returns", "the", "EnvironmentURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2368-L2373
160,474
google/go-github
github/github-accessors.go
GetLogURL
func (d *DeploymentStatusRequest) GetLogURL() string { if d == nil || d.LogURL == nil { return "" } return *d.LogURL }
go
func (d *DeploymentStatusRequest) GetLogURL() string { if d == nil || d.LogURL == nil { return "" } return *d.LogURL }
[ "func", "(", "d", "*", "DeploymentStatusRequest", ")", "GetLogURL", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "LogURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "LogURL", "\n", "}" ]
// GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.
[ "GetLogURL", "returns", "the", "LogURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2376-L2381
160,475
google/go-github
github/github-accessors.go
GetDiscussionURL
func (d *DiscussionComment) GetDiscussionURL() string { if d == nil || d.DiscussionURL == nil { return "" } return *d.DiscussionURL }
go
func (d *DiscussionComment) GetDiscussionURL() string { if d == nil || d.DiscussionURL == nil { return "" } return *d.DiscussionURL }
[ "func", "(", "d", "*", "DiscussionComment", ")", "GetDiscussionURL", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "DiscussionURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "DiscussionURL", ...
// GetDiscussionURL returns the DiscussionURL field if it's non-nil, zero value otherwise.
[ "GetDiscussionURL", "returns", "the", "DiscussionURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2432-L2437
160,476
google/go-github
github/github-accessors.go
GetTeams
func (d *DismissalRestrictionsRequest) GetTeams() []string { if d == nil || d.Teams == nil { return nil } return *d.Teams }
go
func (d *DismissalRestrictionsRequest) GetTeams() []string { if d == nil || d.Teams == nil { return nil } return *d.Teams }
[ "func", "(", "d", "*", "DismissalRestrictionsRequest", ")", "GetTeams", "(", ")", "[", "]", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "Teams", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "*", "d", ".", "Teams", "\n", ...
// GetTeams returns the Teams field if it's non-nil, zero value otherwise.
[ "GetTeams", "returns", "the", "Teams", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2496-L2501
160,477
google/go-github
github/github-accessors.go
GetUsers
func (d *DismissalRestrictionsRequest) GetUsers() []string { if d == nil || d.Users == nil { return nil } return *d.Users }
go
func (d *DismissalRestrictionsRequest) GetUsers() []string { if d == nil || d.Users == nil { return nil } return *d.Users }
[ "func", "(", "d", "*", "DismissalRestrictionsRequest", ")", "GetUsers", "(", ")", "[", "]", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "Users", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "return", "*", "d", ".", "Users", "\n", ...
// GetUsers returns the Users field if it's non-nil, zero value otherwise.
[ "GetUsers", "returns", "the", "Users", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2504-L2509
160,478
google/go-github
github/github-accessors.go
GetDismissalCommitID
func (d *DismissedReview) GetDismissalCommitID() string { if d == nil || d.DismissalCommitID == nil { return "" } return *d.DismissalCommitID }
go
func (d *DismissedReview) GetDismissalCommitID() string { if d == nil || d.DismissalCommitID == nil { return "" } return *d.DismissalCommitID }
[ "func", "(", "d", "*", "DismissedReview", ")", "GetDismissalCommitID", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "DismissalCommitID", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "DismissalCom...
// GetDismissalCommitID returns the DismissalCommitID field if it's non-nil, zero value otherwise.
[ "GetDismissalCommitID", "returns", "the", "DismissalCommitID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2512-L2517
160,479
google/go-github
github/github-accessors.go
GetDismissalMessage
func (d *DismissedReview) GetDismissalMessage() string { if d == nil || d.DismissalMessage == nil { return "" } return *d.DismissalMessage }
go
func (d *DismissedReview) GetDismissalMessage() string { if d == nil || d.DismissalMessage == nil { return "" } return *d.DismissalMessage }
[ "func", "(", "d", "*", "DismissedReview", ")", "GetDismissalMessage", "(", ")", "string", "{", "if", "d", "==", "nil", "||", "d", ".", "DismissalMessage", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "d", ".", "DismissalMessa...
// GetDismissalMessage returns the DismissalMessage field if it's non-nil, zero value otherwise.
[ "GetDismissalMessage", "returns", "the", "DismissalMessage", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2520-L2525
160,480
google/go-github
github/github-accessors.go
GetReviewID
func (d *DismissedReview) GetReviewID() int64 { if d == nil || d.ReviewID == nil { return 0 } return *d.ReviewID }
go
func (d *DismissedReview) GetReviewID() int64 { if d == nil || d.ReviewID == nil { return 0 } return *d.ReviewID }
[ "func", "(", "d", "*", "DismissedReview", ")", "GetReviewID", "(", ")", "int64", "{", "if", "d", "==", "nil", "||", "d", ".", "ReviewID", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "d", ".", "ReviewID", "\n", "}" ]
// GetReviewID returns the ReviewID field if it's non-nil, zero value otherwise.
[ "GetReviewID", "returns", "the", "ReviewID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2528-L2533
160,481
google/go-github
github/github-accessors.go
GetRawPayload
func (e *Event) GetRawPayload() json.RawMessage { if e == nil || e.RawPayload == nil { return json.RawMessage{} } return *e.RawPayload }
go
func (e *Event) GetRawPayload() json.RawMessage { if e == nil || e.RawPayload == nil { return json.RawMessage{} } return *e.RawPayload }
[ "func", "(", "e", "*", "Event", ")", "GetRawPayload", "(", ")", "json", ".", "RawMessage", "{", "if", "e", "==", "nil", "||", "e", ".", "RawPayload", "==", "nil", "{", "return", "json", ".", "RawMessage", "{", "}", "\n", "}", "\n", "return", "*", ...
// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.
[ "GetRawPayload", "returns", "the", "RawPayload", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2608-L2613
160,482
google/go-github
github/github-accessors.go
GetCurrentUserActorURL
func (f *Feeds) GetCurrentUserActorURL() string { if f == nil || f.CurrentUserActorURL == nil { return "" } return *f.CurrentUserActorURL }
go
func (f *Feeds) GetCurrentUserActorURL() string { if f == nil || f.CurrentUserActorURL == nil { return "" } return *f.CurrentUserActorURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetCurrentUserActorURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "CurrentUserActorURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "CurrentUserActorUR...
// GetCurrentUserActorURL returns the CurrentUserActorURL field if it's non-nil, zero value otherwise.
[ "GetCurrentUserActorURL", "returns", "the", "CurrentUserActorURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2648-L2653
160,483
google/go-github
github/github-accessors.go
GetCurrentUserOrganizationURL
func (f *Feeds) GetCurrentUserOrganizationURL() string { if f == nil || f.CurrentUserOrganizationURL == nil { return "" } return *f.CurrentUserOrganizationURL }
go
func (f *Feeds) GetCurrentUserOrganizationURL() string { if f == nil || f.CurrentUserOrganizationURL == nil { return "" } return *f.CurrentUserOrganizationURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetCurrentUserOrganizationURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "CurrentUserOrganizationURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "Curr...
// GetCurrentUserOrganizationURL returns the CurrentUserOrganizationURL field if it's non-nil, zero value otherwise.
[ "GetCurrentUserOrganizationURL", "returns", "the", "CurrentUserOrganizationURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2656-L2661
160,484
google/go-github
github/github-accessors.go
GetCurrentUserPublicURL
func (f *Feeds) GetCurrentUserPublicURL() string { if f == nil || f.CurrentUserPublicURL == nil { return "" } return *f.CurrentUserPublicURL }
go
func (f *Feeds) GetCurrentUserPublicURL() string { if f == nil || f.CurrentUserPublicURL == nil { return "" } return *f.CurrentUserPublicURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetCurrentUserPublicURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "CurrentUserPublicURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "CurrentUserPubli...
// GetCurrentUserPublicURL returns the CurrentUserPublicURL field if it's non-nil, zero value otherwise.
[ "GetCurrentUserPublicURL", "returns", "the", "CurrentUserPublicURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2664-L2669
160,485
google/go-github
github/github-accessors.go
GetCurrentUserURL
func (f *Feeds) GetCurrentUserURL() string { if f == nil || f.CurrentUserURL == nil { return "" } return *f.CurrentUserURL }
go
func (f *Feeds) GetCurrentUserURL() string { if f == nil || f.CurrentUserURL == nil { return "" } return *f.CurrentUserURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetCurrentUserURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "CurrentUserURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "CurrentUserURL", "\n", "...
// GetCurrentUserURL returns the CurrentUserURL field if it's non-nil, zero value otherwise.
[ "GetCurrentUserURL", "returns", "the", "CurrentUserURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2672-L2677
160,486
google/go-github
github/github-accessors.go
GetTimelineURL
func (f *Feeds) GetTimelineURL() string { if f == nil || f.TimelineURL == nil { return "" } return *f.TimelineURL }
go
func (f *Feeds) GetTimelineURL() string { if f == nil || f.TimelineURL == nil { return "" } return *f.TimelineURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetTimelineURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "TimelineURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "TimelineURL", "\n", "}" ]
// GetTimelineURL returns the TimelineURL field if it's non-nil, zero value otherwise.
[ "GetTimelineURL", "returns", "the", "TimelineURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2680-L2685
160,487
google/go-github
github/github-accessors.go
GetUserURL
func (f *Feeds) GetUserURL() string { if f == nil || f.UserURL == nil { return "" } return *f.UserURL }
go
func (f *Feeds) GetUserURL() string { if f == nil || f.UserURL == nil { return "" } return *f.UserURL }
[ "func", "(", "f", "*", "Feeds", ")", "GetUserURL", "(", ")", "string", "{", "if", "f", "==", "nil", "||", "f", ".", "UserURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "f", ".", "UserURL", "\n", "}" ]
// GetUserURL returns the UserURL field if it's non-nil, zero value otherwise.
[ "GetUserURL", "returns", "the", "UserURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2688-L2693
160,488
google/go-github
github/github-accessors.go
GetGitPullURL
func (g *Gist) GetGitPullURL() string { if g == nil || g.GitPullURL == nil { return "" } return *g.GitPullURL }
go
func (g *Gist) GetGitPullURL() string { if g == nil || g.GitPullURL == nil { return "" } return *g.GitPullURL }
[ "func", "(", "g", "*", "Gist", ")", "GetGitPullURL", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "GitPullURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "g", ".", "GitPullURL", "\n", "}" ]
// GetGitPullURL returns the GitPullURL field if it's non-nil, zero value otherwise.
[ "GetGitPullURL", "returns", "the", "GitPullURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2752-L2757
160,489
google/go-github
github/github-accessors.go
GetGitPushURL
func (g *Gist) GetGitPushURL() string { if g == nil || g.GitPushURL == nil { return "" } return *g.GitPushURL }
go
func (g *Gist) GetGitPushURL() string { if g == nil || g.GitPushURL == nil { return "" } return *g.GitPushURL }
[ "func", "(", "g", "*", "Gist", ")", "GetGitPushURL", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "GitPushURL", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "g", ".", "GitPushURL", "\n", "}" ]
// GetGitPushURL returns the GitPushURL field if it's non-nil, zero value otherwise.
[ "GetGitPushURL", "returns", "the", "GitPushURL", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2760-L2765
160,490
google/go-github
github/github-accessors.go
GetCommittedAt
func (g *GistCommit) GetCommittedAt() Timestamp { if g == nil || g.CommittedAt == nil { return Timestamp{} } return *g.CommittedAt }
go
func (g *GistCommit) GetCommittedAt() Timestamp { if g == nil || g.CommittedAt == nil { return Timestamp{} } return *g.CommittedAt }
[ "func", "(", "g", "*", "GistCommit", ")", "GetCommittedAt", "(", ")", "Timestamp", "{", "if", "g", "==", "nil", "||", "g", ".", "CommittedAt", "==", "nil", "{", "return", "Timestamp", "{", "}", "\n", "}", "\n", "return", "*", "g", ".", "CommittedAt",...
// GetCommittedAt returns the CommittedAt field if it's non-nil, zero value otherwise.
[ "GetCommittedAt", "returns", "the", "CommittedAt", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2864-L2869
160,491
google/go-github
github/github-accessors.go
GetVersion
func (g *GistCommit) GetVersion() string { if g == nil || g.Version == nil { return "" } return *g.Version }
go
func (g *GistCommit) GetVersion() string { if g == nil || g.Version == nil { return "" } return *g.Version }
[ "func", "(", "g", "*", "GistCommit", ")", "GetVersion", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "Version", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "g", ".", "Version", "\n", "}" ]
// GetVersion returns the Version field if it's non-nil, zero value otherwise.
[ "GetVersion", "returns", "the", "Version", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L2896-L2901
160,492
google/go-github
github/github-accessors.go
GetTotalGists
func (g *GistStats) GetTotalGists() int { if g == nil || g.TotalGists == nil { return 0 } return *g.TotalGists }
go
func (g *GistStats) GetTotalGists() int { if g == nil || g.TotalGists == nil { return 0 } return *g.TotalGists }
[ "func", "(", "g", "*", "GistStats", ")", "GetTotalGists", "(", ")", "int", "{", "if", "g", "==", "nil", "||", "g", ".", "TotalGists", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "g", ".", "TotalGists", "\n", "}" ]
// GetTotalGists returns the TotalGists field if it's non-nil, zero value otherwise.
[ "GetTotalGists", "returns", "the", "TotalGists", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3016-L3021
160,493
google/go-github
github/github-accessors.go
GetSource
func (g *Gitignore) GetSource() string { if g == nil || g.Source == nil { return "" } return *g.Source }
go
func (g *Gitignore) GetSource() string { if g == nil || g.Source == nil { return "" } return *g.Source }
[ "func", "(", "g", "*", "Gitignore", ")", "GetSource", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "Source", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "g", ".", "Source", "\n", "}" ]
// GetSource returns the Source field if it's non-nil, zero value otherwise.
[ "GetSource", "returns", "the", "Source", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3048-L3053
160,494
google/go-github
github/github-accessors.go
GetCanCertify
func (g *GPGKey) GetCanCertify() bool { if g == nil || g.CanCertify == nil { return false } return *g.CanCertify }
go
func (g *GPGKey) GetCanCertify() bool { if g == nil || g.CanCertify == nil { return false } return *g.CanCertify }
[ "func", "(", "g", "*", "GPGKey", ")", "GetCanCertify", "(", ")", "bool", "{", "if", "g", "==", "nil", "||", "g", ".", "CanCertify", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "g", ".", "CanCertify", "\n", "}" ]
// GetCanCertify returns the CanCertify field if it's non-nil, zero value otherwise.
[ "GetCanCertify", "returns", "the", "CanCertify", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3120-L3125
160,495
google/go-github
github/github-accessors.go
GetCanEncryptComms
func (g *GPGKey) GetCanEncryptComms() bool { if g == nil || g.CanEncryptComms == nil { return false } return *g.CanEncryptComms }
go
func (g *GPGKey) GetCanEncryptComms() bool { if g == nil || g.CanEncryptComms == nil { return false } return *g.CanEncryptComms }
[ "func", "(", "g", "*", "GPGKey", ")", "GetCanEncryptComms", "(", ")", "bool", "{", "if", "g", "==", "nil", "||", "g", ".", "CanEncryptComms", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "g", ".", "CanEncryptComms", "\n", "}" ...
// GetCanEncryptComms returns the CanEncryptComms field if it's non-nil, zero value otherwise.
[ "GetCanEncryptComms", "returns", "the", "CanEncryptComms", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3128-L3133
160,496
google/go-github
github/github-accessors.go
GetCanEncryptStorage
func (g *GPGKey) GetCanEncryptStorage() bool { if g == nil || g.CanEncryptStorage == nil { return false } return *g.CanEncryptStorage }
go
func (g *GPGKey) GetCanEncryptStorage() bool { if g == nil || g.CanEncryptStorage == nil { return false } return *g.CanEncryptStorage }
[ "func", "(", "g", "*", "GPGKey", ")", "GetCanEncryptStorage", "(", ")", "bool", "{", "if", "g", "==", "nil", "||", "g", ".", "CanEncryptStorage", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "g", ".", "CanEncryptStorage", "\n", ...
// GetCanEncryptStorage returns the CanEncryptStorage field if it's non-nil, zero value otherwise.
[ "GetCanEncryptStorage", "returns", "the", "CanEncryptStorage", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3136-L3141
160,497
google/go-github
github/github-accessors.go
GetCanSign
func (g *GPGKey) GetCanSign() bool { if g == nil || g.CanSign == nil { return false } return *g.CanSign }
go
func (g *GPGKey) GetCanSign() bool { if g == nil || g.CanSign == nil { return false } return *g.CanSign }
[ "func", "(", "g", "*", "GPGKey", ")", "GetCanSign", "(", ")", "bool", "{", "if", "g", "==", "nil", "||", "g", ".", "CanSign", "==", "nil", "{", "return", "false", "\n", "}", "\n", "return", "*", "g", ".", "CanSign", "\n", "}" ]
// GetCanSign returns the CanSign field if it's non-nil, zero value otherwise.
[ "GetCanSign", "returns", "the", "CanSign", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3144-L3149
160,498
google/go-github
github/github-accessors.go
GetKeyID
func (g *GPGKey) GetKeyID() string { if g == nil || g.KeyID == nil { return "" } return *g.KeyID }
go
func (g *GPGKey) GetKeyID() string { if g == nil || g.KeyID == nil { return "" } return *g.KeyID }
[ "func", "(", "g", "*", "GPGKey", ")", "GetKeyID", "(", ")", "string", "{", "if", "g", "==", "nil", "||", "g", ".", "KeyID", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "g", ".", "KeyID", "\n", "}" ]
// GetKeyID returns the KeyID field if it's non-nil, zero value otherwise.
[ "GetKeyID", "returns", "the", "KeyID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3176-L3181
160,499
google/go-github
github/github-accessors.go
GetPrimaryKeyID
func (g *GPGKey) GetPrimaryKeyID() int64 { if g == nil || g.PrimaryKeyID == nil { return 0 } return *g.PrimaryKeyID }
go
func (g *GPGKey) GetPrimaryKeyID() int64 { if g == nil || g.PrimaryKeyID == nil { return 0 } return *g.PrimaryKeyID }
[ "func", "(", "g", "*", "GPGKey", ")", "GetPrimaryKeyID", "(", ")", "int64", "{", "if", "g", "==", "nil", "||", "g", ".", "PrimaryKeyID", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "g", ".", "PrimaryKeyID", "\n", "}" ]
// GetPrimaryKeyID returns the PrimaryKeyID field if it's non-nil, zero value otherwise.
[ "GetPrimaryKeyID", "returns", "the", "PrimaryKeyID", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "." ]
1fef44b9b427e6c43f92b2f20918e496c275393f
https://github.com/google/go-github/blob/1fef44b9b427e6c43f92b2f20918e496c275393f/github/github-accessors.go#L3184-L3189