messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestBuildRunList(t *testing.T) {\n\ttests := []struct {\n\t\tcookbookName string\n\t\trecipes []string\n\t\trunList []string\n\t}{\n\t\t{\"... | go | edit | 6 | 2 | apache-2.0 | 7693d1d2031c8e50f60ae011ac26b46d4e04af93 | rajthilakmca/chef-runner,rajthilakmca/chef-runner,mlafeldt/chef-runner,mlafeldt/chef-runner,mlafeldt/chef-runner,rajthilakmca/chef-runner | main_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dsl\n\nimport (\n\t\"goa.design/goa/v3/eval\"\n\t\"goa.design/goa/v3/expr\"\n)\n\n// Value sets the example value.\n//\n// Value must appear in Example.\n//\n// Value takes one argument: the example value.\n//\n// Example:\n//\n// Ex... | go | edit | 0 | 3 | mit | bd82db83810aa98ca78bbe742b1f95f3413a4073 | goadesign/goa | dsl/value.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bigv.io/client/cmd\"\n\t//\tbigv \"bigv.io/client/lib\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tconfigDir = flag.String(\"config\", \"\", \"Location of go-bigv's config store - defaults to ~/.go-bigv\")\n\... | go | edit | 0 | 1 | mit | cd559458673e93bbefa9659859f538bfdd9e9ef8 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | main/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"context\"\n\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/kopia/kopia/repo\"\n\t\"github.com/kopia/kopia/repo/blob\"\n)\n\nvar (\n\tblobDeleteCommand = blobCommands.Command(\"delete\", \"Show contents of blobs\").A... | go | edit | 6 | 3 | apache-2.0 | 391324115962dcfee0e12b114fc93abfbbaa0c39 | kopia/kopia,kopia/kopia,kopia/kopia,kopia/kopia | cli/command_blob_delete.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"sync\"\n\n\t\"github.com/calebamiles/github-client/comments\"\n\t\"github.com/calebamiles/github-client/commits\"\n)\n\nfunc (c *DefaultClient) processCommits(commitWithoutComments commits.CommitWithoutComments, ... | go | edit | 3 | 4 | bsd-3-clause | d562e5909e3153a00d3171b14c31adc70fd9e5d6 | calebamiles/github-client | client/internal/client/proccess_commits.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slice_test\n\nimport (\n \"testing\"\n\n \"github.com/xgfone/go-tools/slice\"\n)\n\nfunc TestSlice(t *testing.T) {\n ss := []int{1,2,3,4,5,6}\n ok := true\n out := 0\n\n ok = slice.SetValueWithDefault(&out, ss, 2, 100)... | go | edit | 0 | 6 | apache-2.0 | 35c06d35433447c7cef3de790def2b4ad3006ab6 | xgfone/go-tools | slice/slice_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage acme\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/jetstack-experimental/cert-manager/pkg/apis/certmanager/v1alpha1\"\n)\n\nfunc (a *Acme) Setup() (v1alpha1.IssuerStatus, error) {\n\tupdateStatus := a.issuer.Status.DeepCopy()\n\n\terr := a.v... | go | edit | 0 | 3 | apache-2.0 | a958f4462dad05f73a736f83ccf7ecfff79f85c0 | jetstack/cert-manager,cert-manager/cert-manager,cert-manager/cert-manager,jetstack/cert-manager,jetstack-experimental/cert-manager,jetstack-experimental/cert-manager,dippynark/cert-manager,dippynark/cert-manager,jetstack/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager,dippynark/cert-manager | pkg/issuer/acme/setup.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage statsdurl\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\t\"github.com/quipo/statsd\"\n)\n\nfunc Connect() (*statsd.StatsdClient, error) {\n\treturn ConnectToURL(os.Getenv(\"STATSD_URL\"))\n}\n\nfunc ConnectToURL(s str... | go | edit | 5 | 2 | mit | 6227aa67e6f74b9af53907d7c97d4b3f3558bd41 | seatgeek/go-statsdurl | statsdurl.go | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage probe\n\nimport (\n\t\"github.com/weaveworks/scope/report\"\n)\n\ntype topologyTagger struct{}\n\n// NewTopologyTagger tags each node with the topology that it comes from. It's\n// kind of a proof-of-concept tagger, useful primarily for... | go | edit | 0 | 3 | apache-2.0 | 90c8b6eeed58626686f31832aa3024d2859bb918 | paulbellamy/scope,alban/scope,kinvolk/scope,weaveworks/scope,weaveworks/scope,kinvolk/scope,alban/scope,alban/scope,alban/scope,kinvolk/scope,paulbellamy/scope,alban/scope,paulbellamy/scope,paulbellamy/scope,weaveworks/scope,weaveworks/scope,weaveworks/scope,paulbellamy/scope,kinvolk/scope,paulbellamy/scope,weaveworks/... | probe/topology_tagger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage backoff\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\ntype ExponentialBackoff struct {\n\tRandomizationFactor float64\n\tRetries int\n\tMaxRetries int\n\tDelay time.Duration\n\tInterval time.Dur... | go | edit | 0 | 4 | mit | e4ff0b87427e768173ebd06f1647e8b96293d60d | jeffchao/backoff | exponential.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"image\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/pixiv/go-libjpeg/jpeg\"\n)\n\nfunc main() {\n\tflag.Parse()\n\tfile := flag.Arg(0)\n\n\tio, err := os.Open(file)\n\tif err != nil {\n\t\tlog.Fatalln(\"Can'... | go | edit | 3 | 6 | bsd-3-clause | 3341d7d3b239c434223f0320edb92cc7f26f119c | pixiv/go-libjpeg,pixiv/go-libjpeg,pixiv/go-libjpeg | example/decoder/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/* This example demonstrates reading a string from input, rather than a \n * single character. Note that only the 'n' versions of getstr have been\n * implemented in goncurses to ensure buffer overflows won't exist */\n\npackage main\n\nimport ... | go | edit | 0 | 1 | bsd-3-clause | fdb36c2c6e8f3691253317620fa7c59380933dd8 | nodar-chkuaselidze/goncurses,aquarat/goncurses,snuk182/goncurses,cha87de/goncurses,bluzye/goncurses,cha87de/goncurses,nodar-chkuaselidze/goncurses,bluzye/goncurses,aquarat/goncurses,cha87de/goncurses,snuk182/goncurses | examples/getstr/getstr.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar f = flag.String(\"f\", \"\", \"Output file, else stdout.\")\nvar p = flag.String(\"p\", \"main\", \"Package.\")\n\nvar ... | go | edit | 0 | 5 | mit | b53a6ff1b02f8d63ecfc21c9f6be3d529bed5800 | mjibson/esc,mjibson/esc,mweagle/esc,slavikm/esc,mjibson/esc | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stats\n\nimport (\n\t\"testing\"\n)\n\nfunc TestCorrelation(t *testing.T) {\n\ts1 := []float64{1, 2, 3, 4, 5}\n\ts2 := []float64{10, -51.2, 8}\n\ts3 := []float64{1, 2, 3, 5, 6}\n\ts4 := []float64{}\n\n\t_, err := Correlation(s1, s2)\n\t... | go | edit | 12 | 9 | mit | 28a4ff944b59d34b868260a1e035aec7f18c3090 | montanaflynn/stats | correlation_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dos\n\n//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall.go syscall.go\n\n//sys copyFile(src string,dst string,isFailIfExist bool)(n uint32,err error) = kernel32.CopyFileW\n//sys moveFileEx(src string,dst st... | go | edit | 0 | 0 | bsd-3-clause | 7364b3a3fbbb0f29a2c670688e091e24ff67ce3d | nocd5/nyagos,tsuyoshicho/nyagos,tyochiai/nyagos,zetamatta/nyagos | dos/syscall.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\ntype LinodeClient struct {\n\tAPIKey string\n}\n\nfunc NewLinodeClient() *LinodeClient {\n\treturn NewLinodeClient()\n}\n\nfunc NewLinodeClientWithKey(apiKey string) *LinodeClient {... | go | edit | 6 | 3 | mit | eef92a73ccb3337c2b89b21e44846bd12414ebc6 | kelcecil/go-linode | api/linode.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage batchgcd\n\nimport (\n\t\"fmt\"\n\t\"github.com/ncw/gmp\"\n)\n\ntype Collision struct {\n\tModulus *gmp.Int\n\tP *gmp.Int\n\tQ *gmp.Int\n}\n\nfunc (x Collision) HavePrivate() bool {\n\treturn x.P != nil || x.Q != nil\n}\n\nf... | go | edit | 0 | 3 | mit | 75579a58deddba94b370d37276c43b921976bad9 | therealmik/batchgcd | common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\tMaxRedirects = 10\n)\n\nfunc main() {\n\tredirects := ReadCsv(\"301s.csv\")\n\n\tlog := make([]redirectResult, 0)\n\n\tfor _, info := range redirects {\n\t\tresult := CheckUrl(info)\n\t\tlog ... | go | edit | 9 | 6 | cc0-1.0 | c98c938578157fc4caafd8324d5c427bb262a57d | emeraldimp/go-redirect-checker | main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2014 The Kubernetes Authors All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ... | go | edit | 3 | 3 | apache-2.0 | 3c3183fd7a64b22c2376ac154a1dba31d0dd472b | kubernetes/cloud-provider-aws,kubernetes/cloud-provider-aws,kubernetes/cloud-provider-aws | aws_utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"os\"\n \"io/ioutil\"\n \"github.com/hashicorp/hcl/json/parser\"\n \"github.com/hashicorp/hcl/hcl/printer\"\n)\n\nfunc main() {\n input, _ := ioutil.ReadAll(os.Stdin)\n\n ast, err := parser.Parse([]byte(input))... | go | edit | 0 | 3 | mit | c5ee149d143abb930d829b19cb7a4e930cacbcd2 | kvz/json2hcl | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc TestRootAccess(t *testing.T) {\n\tresponse := httptest.NewRecorder()\n\n\tn := setUpServer()\n\n\treq, err := http.NewRequest(\"GET\", \"http://localhos... | go | edit | 6 | 4 | mit | 80aadd108b73ecda5faeaba539cb6ef32722860a | wantedly/risu,wantedly/risu,koudaiii/risu,koudaiii/risu,koudaiii/risu,wantedly/risu,koudaiii/risu,wantedly/risu | risu_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nhttp://www.apache.org/licenses/LICENSE-2.0.txt\n\n\nCopyright 2015 Intel Coporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a cop... | go | edit | 0 | 1 | apache-2.0 | eade0f9157f5efadd7ac92c93ad528f79d1c6219 | intelsdi-x/snap-plugin-publisher-rabbitmq,candysmurf/snap-plugin-publisher-rabbitmq,intelsdi-x/snap-plugin-publisher-rabbitmq,candysmurf/snap-plugin-publisher-rabbitmq,intelsdi-x/snap-plugin-publisher-rabbitmq | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage threedo\n\nimport (\n\t\"github.com/codegangsta/negroni\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc NewLogger() *negroni.Logger {\n\treturn &negroni.Logger{\n\t\tlog.New(os.Stdout, \"[http] \", log.LstdFlags),\n\t}\n}\n\n```\n\nApply this change:... | go | edit | 3 | 1 | mit | 8daa57a0bac9b0f4f7794b36638e77efcb97a33f | 3onyc/threedo-backend,3onyc/3do,3onyc/3do,3onyc/3do,3onyc/threedo-backend,3onyc/threedo-backend | http_logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"../../../drawer\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"image/png\"\n\t\"os\"\n)\n\nfunc main() {\n\tsrc := image.NewRGBA(image.Rect(0, 0, 100, 100))\n\tdrawer.Fill(src, color.RGBA{0, 255, 255, 255})\n\n\... | go | edit | 0 | 3 | bsd-3-clause | 06f2522bd7dc36280ebc4f24088036bbc4b78ac7 | ricochet2200/drawer | examples/line/line-main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport sp \"github.com/scipipe/scipipe\"\n\nconst (\n\tworkDir = \"/scipipe-data/\"\n)\n\nfunc main() {\n\tprun := sp.NewPipelineRunner()\n\n\tpeakPicker := sp.NewFromShell(\"PeakPicker\", \"PeakPickerHiRes -in {i:sample} -out {... | go | edit | 0 | 1 | mit | 26f10d607f5c3c16a6eb50fcee9543b34466e00c | scipipe/scipipe,samuell/scipipe,scipipe/scipipe | examples/k8s_openms/k8s_openms.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/mattn/go-mastodon\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc cmdFollowers(c *cli.Context) error {\n\tclient := c.App.Metadata[\"client\"].(*mastodon.Client)\n\tconf... | go | edit | 9 | 6 | mit | 25da74b864efd8eed0c7a16366adf7d9c443c16b | 178inaba/go-mastodon,mattn/go-mastodon,mattn/go-mastodon | cmd/mstdn/cmd_followers.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gondom\n\nimport (\n\t\"math/rand\"\n)\n\nconst (\n\t_rawURLLetters = \"abcdefghijklmnopqrstuvwxyz0123456789\"\n\t_rawLetters = \"abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n)\n\nfunc Make(n int, seed int64) str... | go | edit | 0 | 3 | mit | 38fc10238b06bfc065aaa3473503dab080dce7f4 | Qs-F/gondom | gondom.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os/exec\"\n)\n\nfunc init() {\n\tflag.Parse()\n}\n\nfunc main() {\n\tcommand := flag.Args()\n\tbin, args := command[0], command[1:]\n\n\tcmd := exec.Command(bin, args...)\n\n\toutp... | go | edit | 0 | 6 | mit | 407f47eb15f5d09462e3f6499ab446bbbafd2003 | justincampbell/cacheout,justincampbell/cacheout | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Financial-Times/service-status-go/buildinfo\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Build info is %+v\", buildinfo.GetBuildInfo)\n}\n\n```\n\nApply this change: Print info as an example"
},
... | go | edit | 0 | 1 | mit | eb9d68e8af2e9ae3ae8dcdaac4bd12833e8b6a31 | Financial-Times/service-status-go,Financial-Times/service-status-go | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mail\n\nimport (\n\t\"github.com/go-gomail/gomail\"\n\t\"github.com/skygeario/skygear-server/pkg/core/config\"\n)\n\nfunc NewDialer(c config.SMTPConfiguration) *gomail.Dialer {\n\tif c.Host == \"\" {\n\t\tpanic(\"mail server is not conf... | go | edit | 0 | 2 | apache-2.0 | 641819157ba9edfcb1ac7ad016d6a0c724ccc20a | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | pkg/core/mail/dialer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/guregu/kami\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc main() {\n\tkami.Get(\"/contacts/\", getContacts)\n\tkami.Serve()\n}\n\nfunc getContacts(ctx... | go | edit | 3 | 3 | mit | b455cd6d5dc8306180113c3287e9419064dedf42 | konjoot/benches,konjoot/benches,konjoot/benches | kami/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2011 Julian Phillips. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage py\n\n// #include \"utils.h\"\n// static inline int stringCheck(PyObje... | go | edit | 33 | 2 | bsd-3-clause | 5d3ab435a130d6bc73b25dec4a317877fdd0066e | qur/gopy,limetext/gopy,ericsnowcurrently/qur-gopy,ericsnowcurrently/qur-gopy,qur/gopy,qur/gopy,limetext/gopy,limetext/gopy,ericsnowcurrently/qur-gopy | lib/string.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage twofactor\n\nimport \"github.com/volatiletech/authboss\"\n\n// Page constants\nconst (\n\tPageRecovery2FA = \"recovery2fa\"\n\tPageVerify2FA = \"twofactor_verify\"\n\tPageVerifyEnd2FA = \"twofactor_verify_end\"\n)\n\n// Email consta... | go | edit | 0 | 0 | mit | 9254c094cf9006525245522e9cd209aafb9e10ae | go-authboss/authboss | otp/twofactor/twofactor.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage forgotpwdemail\n\nimport (\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/skygeario/skygear-server/pkg/auth/dependency/userprofile\"\n\n\t\"github.com/skygeario/skygear-server/pkg/core/auth/authinfo\"\n)\n\ntype C... | go | edit | 0 | 5 | apache-2.0 | 2209dde1fff59821af5baf4772a39c0b81e418f0 | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | pkg/auth/dependency/forgotpwdemail/code.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/ doc-gen generates gke-deploy's help docs.\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/GoogleCloudPlatform/cloud-builders/gke-deploy/cmd\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/cobra/doc\"\n)\n\nva... | go | edit | 0 | 2 | apache-2.0 | af04001c6542577354b9b5465ee1c94087bf0f42 | GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,GoogleClou... | gke-deploy/doc-gen/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage builder\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/openshift/origin/pkg/build/api\"\n)\n\ntype Builder interface {\n\tBuild() error\n}\n\n// imageTag returns the tag to be used for the build. If a registry has been\n// spec... | go | edit | 0 | 5 | apache-2.0 | 94ab09f8b1930b8b2d4b7b4bf925c978fcd7df0c | spohnan/origin,tdawson/origin,bowenha2/origin,quantiply-fork/origin,jpeeler/origin,smunilla/origin,rhcarvalho/origin,y0no/origin,willmtemple/origin,smarterclayton/origin,gesrat-cisco/origin,y0no/origin,pombredanne/atomic-enterprise,pkdevbox/origin,PI-Victor/origin,quantiply-fork/origin,sosiouxme/origin,joshuawilson/ori... | pkg/build/builder/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage certmon\n\nconst (\n\tCertTypeSSH = 0\n\tCertTypeX509 = 1\n)\n\n// Format of certificate notifications (server -> client):\n// certType: 32 bit uint (big-endian)\n// certLength: 64 bit uint (big-endian)\n// certData: sequence of by... | go | edit | 0 | 0 | apache-2.0 | 9f95cbb14b1c7e55ac610e500718b570858c6932 | rgooch/keymaster,rgooch/keymaster,Symantec/keymaster,Symantec/keymaster,rgooch/keymaster,Symantec/keymaster | proto/certmon/messages.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\n// Default Configurator constants that are describe a specific configuration option\nconst (\n\tLocale = \"Locale\"\n\tKeymap = \"Keymap\"\n\tWifi = \"Wifi\"\n\tInterface = \"Interface\"\n\tDNS = \"DNS\"\n\tSS... | go | edit | 0 | 0 | apache-2.0 | 255e9008cc7076652821a44191c11cb2b63175ab | xshellinc/iotit,xshellinc/iotit,xshellinc/iotit | device/config/constants.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package profile is for specific profiles\npackage profile\n\n// Local is a profile for local environments\nfunc Local() []string {\n\treturn []string{}\n}\n\n// Kubernetes is a profile for kubernetes\nfunc Kubernetes() []string {\n\treturn [... | go | edit | 0 | 1 | apache-2.0 | d1df8fe8869c388b764b23e09aadb631e6806e5c | micro/micro,micro/micro,myodc/micro,micro/micro | runtime/profile/profile.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 GoIncremental Limited. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the Licens... | go | edit | 0 | 1 | apache-2.0 | f8622a1ab5f13a195ee3c9c70a6073ae29f735bd | GoIncremental/web | environment.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage imgbase64\n\nimport (\n\t\"testing\"\n)\n\nfunc TestEncode(t *testing.T) {\n\tconst in, out = \"Hello, World!\", \"SGVsbG8sIFdvcmxkIQ==\"\n\tif x := encode([]byte(in)); string(x) != out {\n\t\tt.Errorf(\"Encode(%v) = %s, want %v\", in, ... | go | edit | 12 | 2 | mit | b5ed160140acab6513c7256c4c39077656b5a664 | polds/imgbase64 | images_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// staticcheck statically checks arguments to certain functions\npackage main // import \"honnef.co/go/staticcheck/cmd/staticcheck\"\n\nimport (\n\t\"os\"\n\n\t\"honnef.co/go/lint/lintutil\"\n\t\"honnef.co/go/staticcheck\"\n)\n\nfunc main() {\n... | go | edit | 0 | 3 | mit | ac01e7a01439743308458be07da8ee0014f9816f | dominikh/go-tools,dominikh/go-tools,dominikh/go-tools,dominikh/go-tools | staticcheck/cmd/staticcheck/staticcheck.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage channels\n\n// BlackHole implements the InChannel interface and provides an analogue for the \"Discard\" variable in\n// the ioutil package - it never blocks, and simply discards every value it reads. The number of items\n// discarded i... | go | edit | 6 | 5 | mit | 7539d28982bff69b600715c598da6ac8970eafeb | eapache/channels | black_hole.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage horizon\n\nimport (\n\t\"github.com/stellar/horizon/db\"\n\t\"github.com/stellar/horizon/txsub\"\n\t\"net/http\"\n)\n\nfunc initSubmissionSystem(app *App) {\n\tapp.submitter = &txsub.System{\n\t\tPending: txsub.NewDefaultSubmissionLis... | go | edit | 6 | 2 | apache-2.0 | 7fe479c6ebf6fcbeead03911b06fc78eb02e37c2 | masonforest/go-horizon,masonforest/go-horizon,stellar/horizon,nullstyle/go-horizon,nullstyle/go-horizon,stellar/horizon,irisli/horizon,masonforest/horizon,irisli/horizon,masonforest/horizon,irisli/horizon,masonforest/horizon,masonforest/go-horizon,nullstyle/go-horizon,stellar/horizon | src/github.com/stellar/horizon/init_txsub.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"reflect\"\n\t\"regexp\"\n\t\"testing\"\n)\n\nvar genMatcherTests = []struct {\n\tsrc string\n\tdst *regexp.Regexp\n}{\n\t{\"abc\", regexp.MustCompile(`(abc)`)},\n\n\t{\"a,b\", regexp.MustCompile(`(a|b)`)},\n\n\t{\"... | go | edit | 3 | 4 | mit | 7506d4f075fd7327161018e385ad20321d76a653 | kusabashira/msub | subvert_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n\t\"path\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(111)\n\t}\n}\n\nfunc main() {\n\n\tus... | go | edit | 0 | 4 | mit | 927ba54148fb8db9af8185e6b69b3397dec57713 | tmiller/setuidgid | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build acceptance\n\npackage app_test\n\nimport (\n\t\"net\"\n\n\t\"github.com/DATA-DOG/godog\"\n\t\"github.com/deshboard/boilerplate-grpc-service/test\"\n\t\"google.golang.org/grpc\"\n)\n\nfunc init() {\n\ttest.RegisterFeaturePath(\"../feat... | go | edit | 0 | 3 | mit | e3482c68fd96a84dfc84d40484db72e61c108941 | deshboard/boilerplate-grpc-service,deshboard/boilerplate-model-service | pkg/app/acceptance_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage s3\n\n// Options defines options for S3-based storage.\ntype Options struct {\n\t// BucketName is the name of the bucket where data is stored.\n\tBucketName string `json:\"bucket\"`\n\n\t// Prefix specifies additional string to prepend ... | go | edit | 0 | 0 | apache-2.0 | 41fb97bd457998a26e5e64a379c4b5d0d1c90f32 | kopia/kopia,kopia/kopia,kopia/kopia,kopia/kopia | repo/blob/s3/s3_options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\tOS \"os\" // should requir... | go | edit | 6 | 1 | bsd-3-clause | 622a6679403dd07c987d8b148e41d54d557ed185 | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | test/bugs/bug125.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNormalizeName(t *testing.T) {\n\tpackages := map[string]string{\n\t\t\"github.com/Masterminds/cookoo/web/io/foo\": \"github.com/Masterminds/cookoo\",\n\t\t\"golang.org/x/crypto/ssh\": ... | go | edit | 3 | 5 | mit | 4287fcb45b297a2e2b5ec9df92d955aae9243d8a | cmars/tools,franciscocpg/glide,avvmoto/glide,franciscocpg/glide,avvmoto/glide,cmars/tools,cmars/tools,cmars/tools | util/normalizename_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"github.com/gsamokovarov/jump/cli\"\n)\n\nfunc Example_helpCmd() {\n\t_ = helpCmd(cli.Args{}, nil)\n\n\t// Output:\n\t// Usage: jump [COMMAND ...]\n\t//\n\t// Jump to a fuzzy-matched directory passed as an argument.\... | go | edit | 3 | 1 | mit | 06429c29feb01a3eb5e104c8073e8664aff2f5ff | gsamokovarov/jump | cmd/help_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage randstring\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/hex\"\n\t\"io\"\n\t\"math/big\"\n)\n\n/*\n Use mixed-case alphanumeric characters, minus vowels so we don't\n get naughty words. This leaves us with 10+21+21=52 possibilities\n... | go | edit | 0 | 3 | mit | 388a98c52af761a7e8884d8a1b005f76e31888d1 | litl/randstring | randstring.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage g\n\nimport (\n\t\"time\"\n)\n\n// changelog:\n// 3.1.3: code refactor\n// 3.1.4: bugfix ignore configuration\n// 5.0.0: 支持通过配置控制是否开启/run接口;收集udp流量数据;du某个目录的大小\n// 5.1.0: 同步插件的时候不再使用checksum机制\n// 5.1.3: Fix config syntax error when dep... | go | edit | 0 | 0 | apache-2.0 | bc5d1fb41fb0096e4731c17a4d0de828ec613f1c | masato25/open-falcon-backend,masato25/open-falcon-backend,masato25/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open... | modules/agent/g/const.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/kidoman/embd\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar blinker Blinker\n\nfunc main() {\n\tvar blinker Blinker\n\terr := embd.InitGPIO()\n\tif err != nil {\n\t\tblinker ... | go | edit | 0 | 4 | apache-2.0 | 60538ba4e19667ac73dccbe1e61ccd071383890a | eweatherley/pi-io | interfaces.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cruncher\n\nimport (\n\t\"github.com/davecgh/go-spew/spew\"\n\t\"pilosa/core\"\n\t\"pilosa/dispatch\"\n\t\"pilosa/index\"\n\t\"pilosa/transport\"\n)\n\ntype Cruncher struct {\n\tcore.Service\n\tclose_chan chan bool\n\tapi *index.... | go | edit | 6 | 1 | apache-2.0 | 5a337e576eb0418a7607e858943436a39f5bdd3d | alanbernstein/pilosa,travisturner/pilosa,raskle/pilosa,alanbernstein/pilosa,linhvo/pilosa,alanbernstein/pilosa,linhvo/pilosa,linhvo/pilosa,raskle/pilosa,raskle/pilosa | cruncher/cruncher.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage test\n\nimport (\n\t\"github.com/davecgh/go-spew/spew\"\n\t\"github.com/pmezard/go-difflib/difflib\"\n)\n\nfunc init() {\n\tspew.Config.SortKeys = true // :\\\n}\n\n// Diff diffs two arbitrary data structures, giving human-readable outp... | go | edit | 0 | 1 | apache-2.0 | 1f222b9156cb2abd7689f7fabdc53bc54bef369c | paulbellamy/scope,paulbellamy/scope,kinvolk/scope,paulbellamy/scope,kinvolk/scope,weaveworks/scope,kinvolk/scope,paulbellamy/scope,paulbellamy/scope,alban/scope,alban/scope,weaveworks/scope,alban/scope,weaveworks/scope,weaveworks/scope,alban/scope,kinvolk/scope,weaveworks/scope,kinvolk/scope,alban/scope,kinvolk/scope,a... | test/diff.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ast_test\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/DeedleFake/wdte/ast\"\n)\n\nfunc printTree(t *testing.T, cur ast.Node, depth int) {\n\tindent := strings.Repeat(\" \", depth)\n\tswitch cur := cur.(type) {\n\tcase *a... | go | edit | 3 | 5 | mit | 7c08e181d685404ca5eef510cf688a53a7da3c96 | DeedleFake/wdte,DeedleFake/wdte | ast/ast_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNewCmd(t *testing.T) {\n\tinitLogsTest()\n\n\targs := []string{\"new\", \"/tmp/testwf.go\"}\n\terr := parseFlags(args)\n\tif err != nil {\n\t\tt.Error(\"Could not parse flags:\", err.Error(... | go | edit | 6 | 3 | mit | a79836fb890927a7d83234768e9b1dc80d64e934 | scipipe/scipipe,scipipe/scipipe,samuell/scipipe | cmd/scipipe/main_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc inspectJob(id uint64) (err error) {\n\tbody, err := conn.Peek(id)\n\tstats, _ := conn.StatsJob(id)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unknown job %v\", id)\n\t}\n\tprintJob(id, body, sta... | go | edit | 18 | 3 | bsd-3-clause | a00015cc8eacbd990585bd2317b5623d96c6ddcd | davidpersson/bsa | jobs.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage piglatin\n\nimport \"strings\"\n\nfunc Sentence(sentence string) string {\n\tif startsWithVowel(sentence) ||\n\t\tstrings.HasPrefix(sentence, \"xr\") ||\n\t\tstrings.HasPrefix(sentence, \"yt\") {\n\t\treturn sentence + \"ay\"\n\t}\n\tif... | go | edit | 0 | 5 | mit | 522822e2773f1e589f36db0bfaa9edc098b5ff30 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/pig-latin/pig_latin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage certstream\n\nimport (\n\t\"time\"\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/jmoiron/jsonq\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc CertStreamEventStream(skipHeartbeats bool) (chan jsonq.JsonQuery, chan error) {\n\toutputStre... | go | edit | 0 | 8 | mit | 8cc628cade1d2d4a845b43902aceed695c916789 | CaliDog/certstream-go | certstream.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bitbucket\n\nimport (\n\t\"code.cloudfoundry.org/lager\"\n\tapi \"github.com/SHyx0rmZ/go-bitbucket/bitbucket\"\n\t\"github.com/concourse/atc/auth/verifier\"\n\t\"net/http\"\n)\n\ntype UserVerifier struct {\n\tusers []string\n\tclient a... | go | edit | 0 | 4 | apache-2.0 | 2bdd8f4c939241fa5224295de3eb61b5c366b8d8 | concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse | bitbucket/user_verifier.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n\n \"github.com/jasonpuglisi/ircutil\"\n)\n\n// main requests a server and user which it uses establish a connection. It\n// runs a loop to keep the client alive until it is no longer active.\nfunc main() {... | go | edit | 0 | 5 | mit | eccc2f678e62451c5515ebc136d6bc0da78cd969 | JasonPuglisi/inami-irc-bot | client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"bytes\"\n\t\"os/exec\"\n)\n\nfunc ExecCmd(name string, args ...string) (string, error) {\n\tcmd := exec.Command(name, args...)\n\tvar out bytes.Buffer\n\tcmd.Stdout = &out\n\n\terr := cmd.Run()\n\tif err != nil {\... | go | edit | 0 | 2 | apache-2.0 | 7c5fccd7a80a7eb164d08afb8c5e95e5be787e32 | mikebrow/cri-o,jwhonce/ocid,kubernetes-incubator/cri-o,resouer/cri-o,apilloud/cri-o,jwhonce/ocid,nalind/cri-o,vbatts/cri-o,mikebrow/cri-o,sameo/cri-o,14rcole/cri-o,rhatdan/cri-o,rhatdan/cri-o,kubernetes-incubator/ocid,mikebrow/cri-o,nalind/cri-o,aweiteka/cri-o,resouer/cri-o,rhatdan/cri-o,mheon/cri-o,14rcole/cri-o,mikeb... | utils/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// $G $D/$F.go && $L $F.$A && (! ./$A.out || echo BUG: should not succeed)\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npa... | go | edit | 0 | 4 | bsd-3-clause | 016fd1dee1d652fa6589db05cb2d9aac9e50249a | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | test/bugs/bug113.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cc1100\n\nimport (\n\t\"github.com/ecc1/gpio\"\n\t\"github.com/ecc1/spi\"\n)\n\nconst (\n\tspiSpeed = 1000000 // Hz\n\tgpioPin = 14 // Intel Edison GPIO connected to GDO0\n)\n\ntype Device struct {\n\tspiDev *spi.Device\n\trxGPIO ... | go | edit | 0 | 4 | mit | 1632f1b9f56d91e3c5df698cd9c95fefb88a4dd7 | ecc1/cc1101 | device.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\ntype Direction byte\n\nconst (\n\tNorth Direction = 1 << iota\n\tSouth\n\tEast\n\tWest\n)\n\ntype Coordinate struct {\n\tX, Y int\n}\n\ntype Gopher struct {\n\t// Current direction\n\tDirection Direction\n\tX, Y int\n\tPa... | go | edit | 0 | 0 | mit | ce74a4d3d6e9780cfeae8675a8cfe947d97ea5c7 | gophergala2016/gophertron,gophergala2016/gophertron,gophergala2016/gophertron | models/gopher.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage osfs\n\nimport (\n\t\"syscall\"\n)\n\nfunc (f *file) Lock() error {\n\tf.m.Lock()\n\tdefer f.m.Unlock()\n\n\treturn syscall.Flock(int(f.File.Fd()), syscall.LOCK_EX)\n}\n\nfunc (f *file) Unlock() error {\n\tf.m.Lock... | go | edit | 6 | 1 | apache-2.0 | f557f30e6eca6f28d8833300ec532198b99deaff | src-d/go-billy,src-d/go-billy,go-git/go-billy | osfs/os_posix.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage enaml\n\ntype JobManifest struct {\n\tProperties map[string]JobManifestProperty `yaml:\"properties\"`\n}\n\ntype JobManifestProperty struct {\n\tDescription string `yaml:\"description\"`\n\tDefault interface{} `yaml:\"default\"... | go | edit | 0 | 0 | apache-2.0 | d3385905181ee73971d5dbadf7566d60b285570d | xchapter7x/enaml,enaml-ops/enaml | release_job_manifest.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 Google LLC. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n/... | go | edit | 0 | 0 | apache-2.0 | 616662aaac757337c2c3713ea2e9fabad2ac50ec | transparency-dev/merkle,transparency-dev/merkle | hasher.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux\n\n/*\nCopyright 2016 The Kubernetes Authors All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of ... | go | edit | 15 | 1 | apache-2.0 | c202a405cd88216a81f58ae2dc2a504e38be5dd6 | gtank/kubernetes,tsungming/kubernetes,arashbina/kubernetes,tvansteenburgh/kubernetes,rajatchopra/kubernetes,rthallisey/kubernetes,oulinbao/kubernetes,jagosan/kubernetes,jakub-d/kubernetes,carlory/kubernetes,zhouhaibing089/kubernetes,jonboulle/kubernetes,ingvagabund/kubernetes,humblec/kubernetes,vipulsabhaya/kubernetes,... | pkg/kubelet/cm/cgroup_manager_unsupported.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage download\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/srt32/hkpg/heroku\"\n)\n\n// DownloadUrl takes a url string, downloads it, and copies it to a local file\n// on disk.\nfunc DownloadUrl(url... | go | edit | 0 | 4 | mit | cca1f7e051b46f517e278d9d3ea99de270e1c5b2 | srt32/hkpg | download/download.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage validations\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/jinzhu/gorm\"\n)\n\nvar settingKey = \"validations:errors\"\n\nfunc AddError(db *gorm.DB, resource interface{}, err string) {\n\tvar errors = GetErrors(db)\n\tvar scope = db.NewScope(... | go | edit | 0 | 2 | mit | da266c2f4961a1815f142d1a8be7ed17dd9a5589 | amirrpp/qor,amirrpp/qor,qor/qor,trigrass2/qor,lance2088/qor,insionng/qor,codedogfish/qor,yanzay/qor,codedogfish/qor,yanzay/qor,qor/qor,trigrass2/qor,insionng/qor,strogo/qor,strogo/qor,lance2088/qor,qor/qor | validations/validations.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/engine-api/types\"\n)\n\nconst labelPrefix string = \"io.conplicity\"\n\n// CheckErr checks for error, logs and optionall... | go | edit | 0 | 3 | apache-2.0 | 71385b101611a2eb9d6c0bedcb01859b7ade66a0 | camptocamp/conplicity,camptocamp/conplicity | util/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage userverify\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/skygeario/skygear-server/pkg/core/db\"\n)\n\ntype safeStoreImpl struct {\n\timpl *storeImpl\n\ttxContext db.SafeTxContext\n}\n\nfunc NewSafeStore(\n\tbuilder ... | go | edit | 18 | 1 | apache-2.0 | d3dd3e6baf8432622a69f31650f8119edf157fca | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | pkg/auth/dependency/userverify/tx_store.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2015, Peter Mrekaj. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE.txt file.\n\npackage ptypes\n\nimport \"math\"\n\n// ReverseInt returns reversed x dig... | go | edit | 0 | 9 | mit | 50f8ba0a08e810846c1a764f7fdffe8a3daf53fb | mrekucci/epi,mrekucci/epi | ptypes/reverseint.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNewK(t *testing.T) {\n\tk := NewK(\"iso9995\")\n\tif k.Proc != \"/proc/bus/input/devices\" {\n\t\tt.Errorf(\"NewK() error: expected '/proc/bus/input/devices', received %q\", k.Proc)\n\t}\n}... | go | edit | 6 | 3 | mit | 1883546b2f34e46d10ba146b8df17147f282b95e | jspc/go-kbd | device_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 The LUCI Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://w... | go | edit | 0 | 1 | apache-2.0 | c23d50badfcb9d30453499b6879d9d614112c948 | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | server/auth/middleware.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gstrings\n\nimport (\n\t\"github.com/wallclockbuilder/testify/assert\"\n\t\"testing\"\n)\n\nfunc TestEmpty(t *testing.T) {\n\tassert := assert.New(t)\n\tassert.Equal(false, Empty(\"hello\"))\n\tassert.Equal(false, Empty(\" \"))\n\tasser... | go | edit | 9 | 1 | bsd-2-clause | cd88e0523907a427b9d7248c0a1c37a2199a4baf | wallclockbuilder/gstrings,wallclockbuilder/stringutil | empty_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage observers\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/ivan1993spb/snake-server/objects/wall\"\n\t\"github.com/ivan1993spb/snake-server/world\"\n)\n\nconst wallPerNDots = 100\n\ntype WallObserver struct{}\n\nfunc (Wal... | go | edit | 0 | 2 | bsd-2-clause | 1fc5a14564acf1c6d271a726860630b936da54fd | ivan1993spb/clever-snake | observers/wall_observer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage peco\n\nimport \"github.com/nsf/termbox-go\"\n\ntype Input struct {\n\t*Ctx\n}\n\nfunc (i *Input) Loop() {\n\tdefer i.ReleaseWaitGroup()\n\n\t// XXX termbox.PollEvent() can get stuck on unexpected signal\n\t// handling cases. We still w... | go | edit | 24 | 7 | mit | c3f3ad2686e443847296f86f521f4b6ba3b66494 | dav009/peco,ken-saka/peco,peco/peco,ukitazume/peco,reiki4040/peco,r7kamura/peco,polamjag/peco | input.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gokhipu\n\nvar (\n\tbasePath = \"https://khipu.com/api/2.0\"\n)\n\n// Khipu implements a basic struct with revelant data to handle\n// khipu's API requests.\ntype Khipu struct {\n\tSecret string\n\tReceiverID string\n}\n\n// NewKhip... | go | edit | 3 | 3 | mit | 786327941ec633d34ff9c6844d01815bd75e11da | mtavano/ghipu | khipu.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gohandy\n\nimport (\n\t\"archive/tar\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc Unpack(r *tar.Reader, toPath string) error {\n\tfor {\n\t\thdr, err := r.Next()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil ... | go | edit | 6 | 5 | mit | 17797e2cded9aeab7bf4d7a005339a4af6944d34 | materials-commons/gohandy,materials-commons/gohandy | archive.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage generator\n\nimport (\n\t\"io\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/golang/protobuf/proto\"\n\tplugin \"github.com/golang/protobuf/protoc-gen-go/plugin\"\n)\n\nfunc TestGenerator_GenerateAllFiles(t *testing.T) {\n\ttype fiel... | go | edit | 3 | 3 | mit | c0cf69fed31eebd6efcaaf40bb5788659efa818e | nametake/protoc-gen-gohttp | generator/generator_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"github.com/paulbellamy/ratecounter\"\n\t\"github.com/c2h5oh/datasize\"\n\t\"time\"\n)\n\ntype DataRateCounter interface {\n\tGetDataRate() datasize.ByteSize\n\tCaptureEvent(rate int)\n}\n\nfunc NewRateCounter() Da... | go | edit | 0 | 2 | mit | 510949fd1ab80f305779a5d1465c8c18ac1a21f2 | selvakn/p2p-port-forward | utils/data_rate_counter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// #include \"types.h\"\nimport \"C\"\nimport (\n\t\"fmt\"\n\t\"github.com/amarburg/go-lazyquicktime\"\n)\n\n//export MovInfo\nfunc MovInfo(path *C.char) C.MovieInfo {\n\n\tfile, err := sourceFromCPath(path)\n\n\tif err != nil {... | go | edit | 12 | 4 | mit | 1de3392374d9324fe3f9aefb32b7c61d6fe684c4 | amarburg/cgo-lazyquicktime,amarburg/cgo-lazyquicktime,amarburg/cgo-lazyquicktime | movie_info.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nfunc out_escapes() (x int, p *int) {\n\... | go | edit | 0 | 1 | bsd-3-clause | 2e5f4680915e9980173f0069ba4a09841597a484 | npe9/noahevans-go9,webfd/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,rdp/rogerpack2005-golang,d0f/go-zh,sanjosh/sanjos100-tipc,npe9/noahevans-go9,rdp/... | test/escape1.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nfunc out_escapes() (x int, p *int) {\n\... | go | edit | 0 | 1 | bsd-3-clause | 2e5f4680915e9980173f0069ba4a09841597a484 | npe9/noahevans-go9,webfd/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,rdp/rogerpack2005-golang,d0f/go-zh,sanjosh/sanjos100-tipc,npe9/noahevans-go9,rdp/... | test/escape1.go | rejected_duplicate | Near-duplicate of sample 117252 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fate\n\ntype bigrams map[token]*tokset\n\nfunc (b bigrams) Observe(tok0 token, tok1 token) {\n\tctx, ok := b[tok0]\n\tif !ok {\n\t\tctx = &tokset{}\n\t\tb[tok0] = ctx\n\t}\n\tctx.Add(tok1)\n}\n\ntype fwdrev struct {\n\tfwd *tokset\n\tre... | go | edit | 27 | 2 | mit | b87b4e14909f176471fffc48fb2dab77f1d4f69a | pteichman/fate | obs.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage potcp\n\nimport (\n \"proboscis-go\"\n \"net\"\n)\n\ntype HandlerFunction func(*proboscis.Request) *proboscis.Response\n\ntype Handler struct {\n Method string\n Format string\n Function HandlerFunction\n}\n\ntype Server struct {\n... | go | edit | 3 | 1 | mit | 64679af83fb76d2eae24cf491e466902cf16adc6 | dirk/proboscis-go | potcp/potcp.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Enumerates USB devices, finds and identifies CrazyRadio USB dongle.\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/krasin/crazyradio\"\n\t\"github.com/krasin/crazyradio/usb\"\n)\n\nfunc fail(format string, args ... | go | edit | 0 | 6 | mit | d36e70b6192613b9e5aadce71ab45f44e3e3186e | samofly/cflie | cmd/crazyradio-enum/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mpb\n\nimport (\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc BenchmarkIncrSingleBar(b *testing.B) {\n\tp := New(WithOutput(ioutil.Discard))\n\tbar := p.AddBar(int64(b.N))\n\tfor i := 0; i < b.N; i++ {\n\t\tbar.Increment()\n\t}\n}\n\nfunc ... | go | edit | 12 | 2 | unlicense | 026348035cb2a9cc885794f759f962d828c79c0b | vbauerster/mpb,vbauerster/mpb | barbench_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"poule/configuration\"\n\t\"poule/gh\"\n\t\"poule/runner\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc executeAction(config *configuration.Config, action configuration.Action, item gh.Item) error {\n\tfor _, op... | go | edit | 0 | 4 | apache-2.0 | 3299714f51fc5cec67fb480d1a0c54164b98452b | icecrime/poule,icecrime/poule | src/poule/server/action.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mesos\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc cleanName(name string) string {\n\treg, err := regexp.Compile(\"[^\\\\w-.\\\\.]\")\n\tif err != nil {\n\t\tlog.Print(\"[WARN] \", err)\n\t\tr... | go | edit | 0 | 2 | apache-2.0 | 4660d7d17f163b506ad8d8a410efe7fdc7ed06b6 | ryane/mesos-consul,Spantree/mesos-consul,z00223295/mesos-consul,CiscoCloud/mesos-consul,mantl/mesos-consul | mesos/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fs\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// WARN (CEV): Investigate handling of environment variables and path expansion.\n\n// Max is 255 but use 245 to be safe.\nconst winMaxLength = 245\n\nfunc longPath(p string) (string, ... | go | edit | 0 | 3 | mit | d1624adb6210fab2d75f29969f2fdb7beea9792b | charlievieth/fs | fs_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cpu\n\nimport (\n\t\"io/ioutil\"\n\t\"strings\"\n\t\"regexp\"\n)\n\ntype Cpu struct{}\n\nfunc (self *Cpu) Collect() (result map[string]map[string]string, err error) {\n\treturn map[string]map[string]string{\n\t\t\"cpu\": getCpuInfo(),\n... | go | edit | 0 | 4 | mit | cf62f97cbf2a46ff531142874d3f8f7a9ee65044 | DataDog/gohai,DataDog/gohai,urosgruber/gohai | cpu/cpu_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage aws\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials/stscreds\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/s3\"\n)\n\nfunc ListBuckets(... | go | edit | 0 | 4 | apache-2.0 | a8193acb0ac722ae0817343104b529680ddaa8d9 | bdastur/notes,bdastur/notes,bdastur/notes,bdastur/notes,bdastur/notes,bdastur/notes | go/ws_2/src/github.com/bdastur/aws/s3helper.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage netlink\n\n/*\n#include <sys/ioctl.h>\n#include <sys/socket.h>\n#include <linux/if.h>\n#include <linux/if_tun.h>\n\n#define IFREQ_SIZE sizeof(struct ifreq)\n*/\nimport \"C\"\n\ntype ifReq struct {\n\tName [C.IFNAMSIZ]byte\n\tFlags uint... | go | edit | 0 | 0 | apache-2.0 | 283874315567f7a541ad7d7898fb0b93f205663f | mcastelino/netlink,paravmellanox/netlink,axsh/netlink,vishvananda/netlink,porjo/netlink,chantra/netlink | link_tuntap_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage codegen\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"path\"\n)\n\nfunc Output(ctx *Context, p string, data string) error {\n\top := path.Join(ctx.Dir, p)\n\tvar out bytes.Buffer\n\n\tfmt.Fprintf(&out, \"package %s... | go | edit | 6 | 3 | isc | 21e7f297b792e43ba18431951d5156a07b569c19 | nullstyle/go-codegen | src/github.com/nullstyle/go-codegen/output.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os/exec\"\n)\n\nfunc main() {\n\tcmd := exec.Command(\"./a.sh\")\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := cmd.Start(); err != ni... | go | edit | 0 | 4 | mit | 896dd2ce1ea1b57dae735425158226b824115121 | hnakamur/execcommandexample,hnakamur/execcommandexample | main.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.