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 acr\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"github.com/pkg/errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"time\"\n)\n\nconst VERSION = \"2018-03-28\"\n\ntype AzureBlobStorage struct {\n\tUploadUrl string\n\tBytes bytes.Buffer\n}\n\nfunc...
go
edit
0
4
apache-2.0
cac520a197bd3ff01f6b52a1983f0f2edcfa9776
GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold
pkg/skaffold/build/acr/azure_storage.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/stianeikeland/go-rpio\"\n\t\"net/http\"\n\t\"os\"\n)\n\nvar (\n\tpin = rpio.Pin(23)\n)\n\nfunc main() {\n\t// Open and map memory to access gpio, check for errors\n\tif err := rpio.Open(); err...
go
edit
9
4
mit
6bca9aec95a06f95086551a25814c703835ba0f1
cghawthorne/garagebot,cghawthorne/garagebot,cghawthorne/garagebot
garagebot.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"github.com/k0kubun/gosick/scheme\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc printShellPrompt(indentLevel int) {\n\tif indentLevel == 0 {\n\t\tfmt.Print(\"gosick> \")\n\t} else if indentLevel > 0 {\n\...
go
edit
3
6
mit
3504b0ade51d44e6116fa2cf708082abdd95cc08
k0kubun/gosick
gosick.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hummingbird\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/parnurzeal/gorequest\"\n)\n\ntype API struct {\n\tendpoint string\n\ttoken string\n\trequest *gorequest.SuperAgent\n}\n\nfunc (api *API) UserAuthenticate(username, email...
go
edit
3
3
mit
9cf66af6fdf5ccd6312014071e7eb6f631812a99
MiLk/hummingbird-go
api.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mesh\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype PeerInfo struct {\n\tID string\n\tProtocols map[string][]string\n}\n\ntype peerInfoProtocol struct {\n\tPeerID string\n\tName string\n\tAddress string\n\tLastUpda...
go
edit
0
1
mit
073293c7b5f879c112c0e46b62f506c7e4cd833e
nimona/go-nimona,nimona/go-nimona,nimona/go-nimona,nimona/go-nimona
mesh/peerinfo.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gophercloud\n\nimport (\n\t\"github.com/racker/perigee\"\n)\n\n// WithReauth wraps a Perigee request fragment with logic to perform re-authentication\n// if it's deemed necessary.\n//\n// Do not confuse this function with WithReauth()! ...
go
edit
6
4
apache-2.0
441991d2f73ee9761b32c750d06e5c0410bce09e
sti-jans/gophercloud,larsbutler/gophercloud,clintonskitson/gophercloud,feiskyer/gophercloud,rackspace/gophercloud,mitchellh/gophercloud-fork-40444fb,DSpeichert/gophercloud,timbyr/gophercloud,mitchellh/gophercloud-fork-40444fb,larsbutler/gophercloud,rgbkrk/gophercloud,clintonskitson/gophercloud,trumant/gophercloud,jamie...
reauth.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// (c) Copyright 2015 JONNALAGADDA Srinivas\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// h...
go
edit
0
2
apache-2.0
cb7f0c5db00f51a4c7c5e90390fddec9c25251fe
js-ojus/flow,js-ojus/flow
doc.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/hoisie/web\"\n \"github.com/russross/blackfriday\"\n \"io/ioutil\"\n \"log\"\n \"os\"\n)\n\nfunc handler(ctx *web.Context, path string) {\n input, err := ioutil.ReadFile(\"testdata/foo.m...
go
edit
0
3
bsd-2-clause
fae6ed236a31c146f8e5eb8dc09ef7b703a1389f
rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog
rtfblog.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage socket\n\nimport (\n\t\"time\"\n\t\"github.com/neliseev/logger\"\n)\n\n// Defaults\nconst maxTCPQueries int = 256\nconst tcpIdleTimeout time.Duration = 60 * time.Second\nconst rtimeout time.Duration = 2 * time.Second //...
go
edit
3
1
mit
69b70fc86ecf34bdee61e7e0a0f4a4574dde2c3d
neliseev/socket
defaults.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage vsphere\n\nimport \"github.com/cloudfoundry/bosh-bootloader/storage\"\n\ntype TemplateGenerator struct{}\n\nfunc NewTemplateGenerator() TemplateGenerator {\n\treturn TemplateGenerator{}\n}\n\nfunc (t TemplateGenerator) Generate(state st...
go
edit
0
1
apache-2.0
0dd2b40f0894f2001ae32c3f5ed1851098343a33
niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader
terraform/vsphere/template_generator.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/exercism/cli/api\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar BinaryName string\n\n// RootCmd represents the base command when called without any subcommands.\nvar RootC...
go
edit
3
2
mit
c4305645df453d526f18fe5ca776344840ad47de
exercism/cli,exercism/cli
cmd/root.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage flagutil\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\n// SetFlagsFromEnv parses all registered flags in the given flagset,\n// and if they are not already set it attempts to set their values from\n// environment var...
go
edit
0
4
apache-2.0
ba1e8ad5e4b20b92684f9b7c4bf3efb35a2fe0e1
dgonyeo/pkg,barakmich/pkg,ecnahc515/pkg,jonboulle/pkg,sym3tri/pkg,sym3tri/pkg,coreos/pkg,coreos/pkg,bobbyrullo/pkg,jonboulle/pkg,bobbyrullo/pkg,ecnahc515/pkg,dgonyeo/pkg,barakmich/pkg
flagutil/env.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// HelpForHelp shows overall usage information for the BigV client, including a list of available commands.\nfunc (cmds *CommandSet) HelpForHelp() {\n\t// TODO(telyn): write real usage in...
go
edit
6
8
mit
f53e12216c70c4fc0a423cd873eb76d50e2a1e2f
BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client
main/cmd-help.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package process supplies helper functions to start a tor binary as a slave process.\npackage tor\n\nimport (\n\t\"os/exec\"\n\t//\t\"bufio\"\n\t//\t\"regexp\"\n)\n\n// Cmd represents an tor executable to be run as a slave process.\ntype Cmd ...
go
edit
0
3
bsd-3-clause
3311aaf8030e9ed62347b2127b6c66e2406c200e
sycamoreone/orc
tor/exec.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype Action int\n\nconst (\n\tcoin Action = iota\n\tpush Action = iota\n)\n\ntype TurnstileState interface {\n\tHandle() (TurnstileState, error)\n}\n\ntype TurnstileContext struct {\n\tact...
go
edit
6
3
mit
d71c56ec372cca2ad812250854efcc68da0e718e
0xfoo/turnstile
turnstile.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage task\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestTaskState(t *testing.T) {\n\tdummyTask := NewTask(\"dummy\", \"foo\", \"bar\")\n\tgot := dummyTask.State\n\twant := TaskStateUnknown\n\tif want != got {\n\t\tt.Errorf(\"Incor...
go
edit
12
3
mit
1924b9935c166ccbf046e2d0f6d52cc3870965c8
ranjithamca/gru
task/task_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build dragonfly freebsd linux nacl netbsd openbsd solaris\n\n// Copyright 2016 Florian Pigorsch. All rights reserved.\n//\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage f...
go
edit
9
3
mit
dcaff1f4b88c6a5c8300484767ba68b9c4283cfd
flopp/go-findfont
fontdirs_unix.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"strings\"\n)\n\nfunc main() {\n\traw, err := ioutil.ReadFile(\"activity.dat\")\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tencoded := strings.Spl...
go
edit
0
7
mit
c4ac2626e0f731de4cd1177ed5407ec0943856e9
Metalnem/runtastic
decoder/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage wats\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/onsi/gomega/gexec\"\n\n\t\"github.com/cloudfoundry-incubator/cf-test-helpers/cf\"\n\t\"github.com/cloudfoundry-incubator/cf-test-helpers/...
go
edit
42
1
apache-2.0
84494e3ce36f35807ca004f44b0c8936f78ed835
cloudfoundry-incubator/wats,cloudfoundry-incubator/wats,cloudfoundry/wats,cloudfoundry-incubator/wats,cloudfoundry-incubator/wats,cloudfoundry/wats,cloudfoundry/wats,cloudfoundry-incubator/wats,cloudfoundry/wats,cloudfoundry/wats
wats/output_volume_test.go
rejected_lint
Too many lint violations: 42
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gohr\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"golang.org/x/crypto/ssh/terminal\"\n)\n\n//get number of columns of terminal from crypto subdirectory ssh/terminal\nfunc getCols() int {\n\tc, _, err := terminal.GetSize(int(os.Stdout.Fd()))\...
go
edit
0
6
mit
67d792b9039bf57f47368d3edb9816971eff7ee1
hasit/gohr
gohr.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage static\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n)\n\nfunc exists(name string) bool {\n\t_, err := os.Stat(name)\n\treturn !os.IsNotExist(err)\n}\n\n// Static returns a middl...
go
edit
0
3
mit
2500594011319f680c08a1f7e15dfcac88a8b523
gin-contrib/cache,gin-contrib/cache
static/static.go
accepted
null
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 btrees\n\n// LCA returns the lowest common ancestor in\n// the bi...
go
edit
9
7
mit
128b8b36b9e356ce8bb23bd9680212dfc1449f76
mrekucci/epi,mrekucci/epi
btrees/lca.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage std\n\nimport \"github.com/tisp-lang/tisp/src/lib/core\"\n\n// Y is Y combinator which takes a function whose first argument is itself\n// applied to the combinator.\nvar Y = core.NewLazyFunction(\n\tcore.NewSignature(\n\t\t[]string{\"f...
go
edit
0
1
mit
97540772a7d43894f764f06ca768caca364d2467
raviqqe/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp
src/lib/std/y.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage service\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/client\"\n\t\"github.com/docker/docker/cli\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc newRemoveCommand(dockerCli *client.D...
go
edit
0
4
apache-2.0
cf61cd3a920809f6a0be44a584f365544acaf1a9
konstruktoid/docker-1,tagomoris/docker,dims/docker,13W/docker,konstruktoid/docker-upstream,POLJM242/docker,maxamillion/docker,sarnautov/moby,tonistiigi/docker,duglin/docker,crosbymichael/docker,xiekeyang/docker,mike1729/docker,duglin/docker,akira-baruah/docker,dongjoon-hyun/docker,mahak/docker,KarthikNayak/docker,ndelo...
api/client/service/remove.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\thost string // The host address to scan\n)\n\nfunc init() {\n\tif len(os.Args) != 2 {\n\t\tfmt.Fprintf(os.Stderr, \"Usage: %s host\\n\", os.Args[0])...
go
edit
0
2
mit
f9702473c30c878bfa846440246b1dfb13261c7c
redforks/portscan
app.go
rejected_duplicate
Near-duplicate of sample 117060
true
[ { "role": "user", "content": "Write go code for the following: Add initial version of object pool" }, { "role": "assistant", "content": "package creational\n\nimport \"sync\"\n\n// PoolObject represents the object to be stored in the Pool.\ntype PoolObject struct {\n}\n\n// Pool represents the p...
go
new_file
0
3
mit
33beb7569c13d185e9603d56b2f3268ff591d0c1
bvwells/go-patterns,bvwells/go-patterns
creational/object_pool.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage frame\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/zetamatta/go-windows-netresource\"\n\t\"github.com/zetamatta/go-windows-subst\"\n)\n\nfunc optionNetUse(arg string) {\n\tpiece := strings.SplitN(arg, \"=\", 2)\n\ti...
go
edit
6
2
bsd-3-clause
a6a4aadcd0ac587442df2b36bdb72924e2cc6b5f
tsuyoshicho/nyagos,zetamatta/nyagos
frame/option_windows.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ops\n\nimport (\n\t\"bsearch/index\"\n)\n\ntype HeaderCollector interface {\n\tAdd(key, value string)\n}\n\n// QueryOp is the interface for search queries implemented by everything\n// that will return documents. Each QueryOp is assumed...
go
edit
0
0
isc
72195c7881a4fd9486c95fca4bef323c8c8ae51a
art4711/bsearch
ops/interface.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/onsi/ginkgo/ginkgo/testsuite\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc verifyNotificationsAreAvailable() {\n\t_, err := exec.LookPath(\"terminal-notifier\")\n\tif err != nil {\n\t\tfmt.Printf(`--n...
go
edit
3
4
mit
8ad9c74623a2fb3f91a7a82f92a92aeecb1230ce
onsi/ginkgo,ixdy/ginkgo,onsi/ginkgo,yaoshipu/ginkgo,alvinvarghese/ginkgo,justintung/ginkgo,fschl/ginkgo
ginkgo/notifications.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package watch detects raw changes to files.\npackage watch\n\nimport (\n\t\"context\"\n)\n\n// Watcher watches a file at the given path for changes.\ntype Watcher interface {\n\t// Read blocks and returns the next update for a file. An error...
go
edit
0
0
apache-2.0
a6130d7d09ee064b54975ca8518c2f00d5e9424f
openconfig/gnmi,openconfig/gnmi,openconfig/gnmi
watch/watch.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto/x509\"\n\t\"flag\"\n\t\"log\"\n\t\"path/filepath\"\n\n\t\"github.com/lxc/lxd/lxd/vsock\"\n\t\"github.com/lxc/lxd/shared\"\n\t\"github.com/pkg/errors\"\n)\n\nvar tlsClientCertFile = filepath.Join(\"/\", \"med...
go
edit
9
4
apache-2.0
02c8e40d7595dffbc9e353d3f566e6e1e12ea82b
mjeanson/lxd,lxc/lxd,mjeanson/lxd,lxc/lxd,hallyn/lxd,stgraber/lxd,atxwebs/lxd,hallyn/lxd,lxc/lxd,lxc/lxd,lxc/lxd,stgraber/lxd,atxwebs/lxd,hallyn/lxd,atxwebs/lxd,stgraber/lxd,mjeanson/lxd,hallyn/lxd,hallyn/lxd,Skarlso/lxd,Skarlso/lxd,atxwebs/lxd,stgraber/lxd,Skarlso/lxd,Skarlso/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,stgraber/...
lxd-agent/main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage builtin\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/NeowayLabs/nash/errors\"\n\t\"github.com/NeowayLabs/nash/sh\"\n)\n\ntype (\n\texitFn struct {\n\t\tstatus int\n\t}\n)\n\nfunc newExit() *exitFn {\n\treturn &exitF...
go
edit
0
4
apache-2.0
59a72a76a0067729aa62002a15ea88fb789e8efe
NeowayLabs/nash,NeowayLabs/nash
internal/sh/builtin/exit.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2012 Dorival de Moraes Pedroso. 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\n// +build ignore\n\npackage main\n\nimport \"github.com/cpmech/gosl/p...
go
edit
0
1
bsd-3-clause
0c60437d74180b80064a5c20fcb011e8ce0ed900
cpmech/goga,cpmech/goga,cpmech/goga
examples/05-many-obj/ploterror.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2017 The Kubernetes Authors.\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 http://www.apache....
go
edit
3
1
apache-2.0
2e560e797e22c44ac628581486d847c2d5bdbd59
MikeSpreitzer/kubernetes,sethpollack/kubernetes,BenTheElder/kubernetes,zhangxiaoyu-zidif/kubernetes,BenTheElder/kubernetes,jingxu97/kubernetes,ncdc/kubernetes,kow3ns/kubernetes,fgimenez/kubernetes,goblain/kubernetes,mbohlool/kubernetes,ingvagabund/kubernetes,kow3ns/kubernetes,bizhao/kubernetes,madhanrm/kubernetes,resou...
staging/src/k8s.io/apiserver/pkg/server/signal.go
rejected_duplicate
Near-duplicate of sample 118319
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage local\n\nimport (\n\tdb_schema \"github.com/creativesoftwarefdn/weaviate/database/schema\"\n)\n\nfunc (l *LocalSchemaManager) RegisterSchemaUpdateCallback(callback func(updatedSchema db_schema.Schema)) {\n\tl.callbacks = append(l.callba...
go
edit
6
2
bsd-3-clause
b21105fe597a351ec24cbf435bb6147df3ddca80
weaviate/weaviate,weaviate/weaviate
database/schema_manager/local/callbacks.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\"github.com/psmithuk/xlsx\"\n)\n\nfunc main() {\n\n\tc := []xlsx.Column{\n\t\txlsx.Column{Name: \"Col1\", Width: 10},\n\t\txlsx.Column{Name: \"Col2\", Width: 10},\n\t}\n\n\tsh := xlsx.NewSheetWithColumns(c)\n\n\tfor...
go
edit
0
2
mit
b80a0bf8df618d352f966bc0898eb329eec18ff7
psmithuk/xlsx,scraperwiki/xlsx
example/large/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"gopkg.in/redis.v3\"\n)\n\nfunc apiClusterSpecHandler(w http.ResponseWriter, r *http.Request, redisClient *redis.Client) {\n\tqueryCluster := strings.TrimSpace(r.FormValue...
go
edit
3
6
mit
e18512e5485a0315a19ffa6d85ced07d0d0a782c
unixvoid/nsproxy
nsproxy/api_cluster_spec.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\"strings\"\n\t\"time\"\n)\n\nfunc Usage() {\n\tfmt.Fprintf(os.Stderr, \"Usage: %s [STOP|START] [STOPFILE]\\n\", os.Args[0])\n\tos.Exit(1)\n}\n\nfunc main() {\n\tif len(os.Args) != 3 {\n\t\tUsage...
go
edit
0
8
apache-2.0
955ae7a459447257e4c88bdd1b7a8252744af020
cloudfoundry/bosh-agent,cloudfoundry/bosh-agent,mattcui/bosh-agent,gu-bin/bosh-agent,gu-bin/bosh-agent,mattcui/bosh-agent,mattcui/bosh-agent,gu-bin/bosh-agent
jobsupervisor/testdata/StartStop/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage day8\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/domdavis/adventofcode/2016/day8/display\"\n)\n\nfunc Solution() string {\n\treturn fmt.Sprintf(\"Part 1: %d, Part 2: %s\",\n\t\tpart1(data), \"Not yet done\")\n}\n\nfunc part1(input string) ...
go
edit
3
1
mit
e782236bee81800676d2a04fa14ae8b086fe42d8
domdavis/adventofcode
2016/day8/day8.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build linux freebsd openbsd darwin solaris\n\npackage host\n\nimport (\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc kernelArch() (string, error) {\n\tvar utsname unix.Utsname\n\terr := unix.Uname(&utsname)\n\treturn string(utsname.Machine[:]), e...
go
edit
0
1
bsd-3-clause
25be4d08fe6a1ff50e85e6a2c09a213e2c87953c
influxdb/gopsutil,influxdb/gopsutil
host/host_posix.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage scraper\n\nimport \"testing\"\n\nfunc TestScrape(t *testing.T) {\n\tgetItem = func(url string) {\n\t\tdefer wg.Done()\n\n\t\tch <- Item{\n\t\t\t\"FooTitle\",\n\t\t\t\"FooSize\",\n\t\t\t\"10.00\",\n\t\t\t\"FooDescription\",\n\t\t}\n\t}\n...
go
edit
12
2
mit
e49b7a2ffffc47bba6edca782fe266c18182a1bc
Integralist/Sainsbury-Scraper
scraper/scraper_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"database/sql\"\n\t_ \"github.com/go-sql-driver/mysql\"\n\n\t\"log\"\n)\n\nfunc dbConnection() *sql.DB {\n\tdb, err := sql.Open(\"mysql\",\n\t\t\"root:@tcp(127.0.0.1:3306)/blog\")\n\tif err != nil {\n\t\tlog.Fatal(e...
go
edit
0
2
mit
e6a76b4efa8de9d0a20e8bd5523675ca7eb1e184
nicholasrucci/blog,nicholasrucci/blog,nicholasrucci/blog
db.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage errors\n\nimport \"fmt\"\n\ntype HTTP struct {\n\t*primitive\n\tcode int\n}\n\nfunc (h HTTP) Code() int {\n\treturn h.code\n}\n\nfunc NewHTTP(cause error, code int, message string) error {\n\treturn &HTTP{\n\t\tprimitive: newPrimitive(c...
go
edit
15
1
mit
94a623fa08b669a41452fa441ad8da2d93baa58b
adrg/errors
http.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"net\"\n \"net/http\"\n \"net/http/fcgi\"\n \"os\"\n)\n\ntype FastCGIServer struct{}\n\nfunc (s FastCGIServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {\n resp.Write([]byte(\"{}\"))\n}\...
go
edit
3
3
apache-2.0
471baf3bf6276f77dc4b425961dfd63b8d294e5a
kerrickstaley/central-academy-alumni-site,kerrickstaley/central-academy-alumni-site,kerrickstaley/central-academy-alumni-site
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model_test\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/crezam/actions-on-google-golang/internal/test\"\n\t\"github.com/crezam/actions-on-google-golang/model\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestRequestParsing(t *te...
go
edit
0
1
mit
6aae5a89aae5a2de94251b367c6062d733d36db9
crezam/actions-on-google-golang
model/request_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2014 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\n// +build darwin linux\n\npackage main\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\...
go
edit
9
2
bsd-3-clause
6d14a085c97a181bab72760a5c6886714a9de07a
rakyll/sensors,rakyll/sensors
example/example.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage adeptus\n\nimport (\n\t\"testing\"\n)\n\nfunc Test_in(t *testing.T) {\n\tcases := []struct {\n\t\tin string\n\t\tslice []string\n\t\tout bool\n\t}{\n\t\t{\n\t\t\tin: \"\",\n\t\t\tslice: []string{},\n\t\t\tout: false,\n\t\t},\n...
go
edit
0
3
unlicense
be93f20db6069f6197f50daa76844717b4233151
elwinar/adeptus
utils_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage Golf\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\n// A wrapper of http.Request\ntype Request struct {\n\t*http.Request\n\tParams map[string]string\n\tIP string\n}\n\nfunc NewRequest(req *http.Request) *Request {\n\trequest := ne...
go
edit
3
3
mit
66b61effd6d3a06e38cdcd5f6f399cbd84d15076
dinever/golf
request.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage random\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"testing\"\n)\n\nfunc TestIntn(t *testing.T) {\n\tfor i := 0; i < 100; i++ {\n\t\trn := Intn(10)\n\t\tif 0 <= rn && rn < 10 {\n\t\t\tcontinue\n\t\t}\n\t\tt.Errorf(\"Intn sho...
go
edit
6
4
mit
4df207efd1935ac459200524ce6c262dcbabb763
jaeyeom/math
random/random_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright © 2015-2018 Hilko Bengen <<EMAIL>>\n// All rights reserved.\n//\n// Use of this source code is governed by the license that can be\n// found in the LICENSE file.\n\npackage yara\n\n/*\n#include <yara.h>\n*/\nimport \"C\"\n\nfunc in...
go
edit
9
2
bsd-2-clause
fe6599cc98f3bf57e9f186e825d80f703fde2627
VirusTotal/go-yara
main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage io_test\n\nimport (\n\t\"os\"\n\n\t. \"github.com/cloudfoundry/cli/testhelpers/io\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"io helpers\", func() {\n\tIt(\"will never overflow the pipe\", ...
go
edit
12
2
apache-2.0
bf9afc53bd061aa9ecf2805a313305eb5d01228d
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
testhelpers/io/io_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Write go code for the following: Add some very simple tests for NewClient and MakeRequest." }, { "role": "assistant", "content": "package namecheap\n\nimport (\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc TestNewClient(t *testing.T) {\n\tc := NewClient(\"anApiUser\", \"...
go
new_file
15
2
mit
ac23b7e90b207a9c0edbcce11782b86e57ebcfcf
billputer/go-namecheap
namecheap_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cache\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/centurylinkcloud/clc-go-cli/state\"\n\t\"time\"\n)\n\nconst (\n\tLONG_AUTOCOMPLETE_REFRESH_TIMEOUT = 30 // seconds\n)\n\nfunc Put(key string, opts []string) {\n\tdata, err := json.M...
go
edit
0
5
apache-2.0
421a2b9f324795e1b153d394786e126ab7abe43b
CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli
autocomplete/cache/cache.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestSomethingExciting(t *testing.T) {\n\ttransport := &http.Transport{\n\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // OK\n\t}\n\tdoStuffTo(transport)\n}\n\nfunc doStuffTo(t *http.Trans...
go
edit
0
1
mit
013d88e511e5e5958b264af3c2814bef4d415f2d
github/codeql-go,github/codeql,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql-go
ql/test/query-tests/Security/CWE-295/DisabledCertificateCheck/tst.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage db\n\nimport sq \"github.com/lann/squirrel\"\n\n// CoreOfferRecordSelect is a sql fragment to help select form queries that\n// select into a CoreOfferRecord\nvar CoreOfferRecordSelect = sq.Select(\n\t\"co.accountid\",\n\t\"co.offerid\"...
go
edit
0
0
apache-2.0
a457ed3f0d7dd15ad9b1ee360e4c9445cc52f6e2
FredericHeem/go-horizon,nullstyle/go-horizon,irisli/horizon,masonforest/go-horizon,masonforest/go-horizon,FredericHeem/go-horizon,stellar/horizon,lackac/horizon,masonforest/horizon,irisli/horizon,irisli/horizon,FredericHeem/go-horizon,masonforest/horizon,masonforest/horizon,lackac/horizon,nullstyle/go-horizon,stellar/h...
db/record_core_offer.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\n\t\"github.com/lluchs/mima\"\n)\n\nfunc main() {\n\tif len(os.Args) != 2 {\n\t\tfmt.Println(\"Usage: mimarun <filename>\")\n\t\treturn\n\t}\n\n\tfilename := os.Args[1]\n\tfile, err := os.Open(fil...
go
edit
0
8
mit
7007278a16fb5c0d7e5264eadc96ac23404d0b69
lluchs/mimarun
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (c) 2015 The btcsuite developers\n// Copyright (c) 2015-2016 The Decred developers\n// Use of this source code is governed by an ISC\n// license that can be found in the LICENSE file.\n\npackage blockchain\n\n// TODO Make benchmark...
go
edit
18
2
isc
ad46c711d3853acf3904f74e7831b6cacc878e7f
decred/dcrd,jrick/dcrd,decred/dcrd,jrick/dcrd
blockchain/bench_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage vm\n\ntype Closure struct {\n\tfunction *Thunk\n\tfreeVariables []*Thunk\n}\n\nfunc (c Closure) Call(ts ...*Thunk) *Thunk {\n\to := c.function.Eval()\n\tf, ok := o.(Callable)\n\n\tif !ok {\n\t\treturn NotCallableError(o)\n\t}\n\n\t...
go
edit
18
3
mit
aad020ddc36bb54df4f241a82fd4603ed8a41d2c
raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp
src/lib/vm/closure.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage peer\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestCrStates(t *testing.T) {\n\tt.Log(\"Running Peer Tests\")\n\n\ttext, err := ioutil.ReadFile(\"crstates.json\")\n\tif err != nil {\n\t\tt.Log(err)\n\t}\n\tcrState...
go
edit
3
5
apache-2.0
8070bfeb4ec352f45c6337ca342b26ed1f349d0d
orifinkelman/incubator-trafficcontrol,amiryesh/incubator-trafficcontrol,amiryesh/incubator-trafficcontrol,knutsel/traffic_control-1,mdb/incubator-trafficcontrol,hbeatty/incubator-trafficcontrol,zhilhuan/incubator-trafficcontrol,mdb/incubator-trafficcontrol,mdb/incubator-trafficcontrol,serDrem/incubator-trafficcontrol,h...
traffic_monitor/experimental/traffic_monitor/peer/peer_test.go
rejected_duplicate
Near-duplicate of sample 116795
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"encoding/json\"\n)\n\nfunc String(v interface{}) string {\n\te, _ := json.Marshal(v)\n\treturn string(e[:])\n}\n\n```\n\nApply this change: Add a string prettify method which formats the json nicely" }, { "...
go
edit
0
1
apache-2.0
ddd7479e80175d2535d9400a0d711b10d8598b90
dominics/redishappy,dominics/redishappy
util/stringify.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage auth\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/gorilla/mux\"\n\t\"net/http\"\n)\n\nconst (\n\ttokenCookieName = \"access_token\"\n)\n\nfunc AddRoutes(r *mux.Router, service Service) {\n\t// Explicitly only serve login ...
go
edit
6
4
mit
a4cb446a21961a7f43fec7b80deece371f42883f
DiscoViking/website,DiscoViking/website,DiscoViking/website,DiscoViking/website,DiscoViking/website
server/auth/handler.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\n// A LightBulb is a Switch and additionally has a brightness, saturation and hue value.\n//\n// TODO(brutella): The HAP protocol defines brightness, saturation and hue as optional. This\n// is currently no reflected in the Ligh...
go
edit
3
0
apache-2.0
699e786a9c16f21cc6ba1c27c6d8346045dd5515
bahlo/hc,sjfloat/hc,mxlje/hc,ninjasphere/hc,brutella/hc,savaki/hc
model/light_bulb.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/spf13/cobra\"\n)\n\nvar autocompleteTarget string\n\nvar cmdAutocomplete = &cobra.Command{\n\tUse: \"autocomplete\",\n\tShort: \"Generate shell autocompletion script\",\n\tLong: `The \"autocomplete\" c...
go
edit
0
1
bsd-2-clause
81c5d8a9689114d3b25758a45096cef78ea49749
ar-jan/restic,restic/restic,kurin/restic,fawick/restic,fawick/restic,ar-jan/restic,kurin/restic,middelink/restic,middelink/restic,restic/restic
cmd/restic/cmd_autocomplete.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"net/http\"\n \"fmt\"\n \"encoding/json\"\n)\n\nfunc handlePing(w http.ResponseWriter, r *http.Request) {\n fmt.Fprint(w, \"OK\")\n}\n\nfunc handleRequest(w http.ResponseWriter, r *http.Request) {\n ty...
go
edit
0
3
mit
232d08769385512c1e15c10f176456d46991d766
mhaligowski/paperboy-crawler
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gitmedia\n\nimport (\n\t\"../gitconfig\"\n\t\"fmt\"\n\t\"regexp\"\n)\n\ntype InitCommand struct {\n\t*Command\n}\n\nvar valueRegexp = regexp.MustCompile(\"\\\\Agit[\\\\-\\\\s]media\")\n\nfunc (c *InitCommand) Run() {\n\tsetFilter(\"clea...
go
edit
6
3
mit
c4653d14447a8bd6aa46b16d74081e1c4c38f496
bozaro/git-lfs,ModernTechnologyPlayers01/git-lfs,Aorjoa/git-lfs,sanoursa/git-lfs,clareliguori/git-lfs,ModernTechnologyPlayers01/git-lfs,jsroads/git-lfs,iSC-Labs/git-lfs,michael-k/git-lfs,engsoonhock1967/git-lfs,andyneff/git-lfs,jsroads/git-lfs,beni55/git-lfs,larsxschneider/git-lfs,phungmy/git-lfs,modulexcite/git-lfs,Ch...
commands/command_init.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage uat\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/DATA-DOG/godog\"\n)\n\nvar runDir = \".\"\nvar raceBinPath = \".\"\n\nconst GodogSuiteName = \"uat\"\n\nfunc TestMain(m *testing.M) {\n\t// Run the features tests from the compi...
go
edit
3
2
mit
1992690eede6e11f7d9a5da9951409b3e8715d27
intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur
uat/uat_runner_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc GetStringFlag(ctx *cobra.Command, name string) string {\n\treturn ctx.Flag(name).Value.String()\n}\n\nfunc GetBoolFlag(ctx *cobra.Command, name strin...
go
edit
0
2
mit
ac9befc76f166290c447d9d20d92c12f8ca0982b
ailispaw/talk2docker
commands/utils.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/robfig/cron\"\n\t\"github.com/spf13/viper\"\n\t\"github.com/markbao/redditdaily/redditdaily\"\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc main() {\n\tviper.SetConfigType(\"yaml\")\n\tviper.SetConfigName(\"config\"...
go
edit
0
3
mit
06ec50bfdb1c560c0d03cd78f9e0ef2482204989
markbao/redditdaily,markbao/redditdaily
redditdaily_cron.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage resourcepool\n\nimport (\n\t\"sync\"\n\t\"testing\"\n)\n\ntype IntMaker struct{}\n\nvar wg sync.WaitGroup = sync.WaitGroup{}\n\nfunc (*IntMaker) Create() (interface{}, error) {\n\ti := 1\n\treturn &i, nil\n}\n\nfunc (*IntMaker) Check(in...
go
edit
3
6
mit
a27b615d93aa4abb06cd46ef3abbc0043e48a7c8
basking2/sdsai-go
pkg/sdsai/resourcepool/resourcepool_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\n// responseWriter implements the http.ResponseWriter interface and\n// keeps track of the header status\ntype responseWriter struct {\n\tStatus int...
go
edit
0
1
mit
ab97520f51adc9904c0545d38af9275ee29dcc6c
anthonynsimon/parrot,anthonynsimon/parrot,anthonynsimon/parrot,todes1/parrot,anthonynsimon/parrot,todes1/parrot,todes1/parrot,anthonynsimon/parrot,todes1/parrot,todes1/parrot,todes1/parrot,anthonynsimon/parrot
parrot-api/logger/request.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cliedit\n\nimport (\n\t\"github.com/elves/elvish/cli\"\n\t\"github.com/elves/elvish/cli/addons/histwalk\"\n\t\"github.com/elves/elvish/cli/histutil\"\n\t\"github.com/elves/elvish/eval\"\n)\n\nfunc initHistWalk(app *cli.App, ev *eval.Eva...
go
edit
0
1
bsd-2-clause
b1f78a296047401f7794bef4ac229c5f6174517f
elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish
cliedit/histwalk.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage routes\n\nimport (\n\t\"net/http\"\n\n\th \"github.com/anonx/sunplate/internal/skeleton/assets/handlers\"\n\n\tr \"github.com/anonx/sunplate/routing\"\n)\n\n// List is a slice of routes of the following form:\n//\tRoute:\n//\t\tPattern\...
go
edit
0
0
bsd-2-clause
564adc09e4351668cf3a3914a560d94bdeb0b1a7
anonx/sunplate,goaltools/goal,anonx/sunplate,anonx/sunplate,goaltools/goal,goaltools/goal
internal/skeleton/routes/routes.go
rejected_duplicate
Near-duplicate of sample 117970
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dbg\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"runtime\"\n\t\"runtime/pprof\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst (\n\tpath = \"/var/cores/\"\n)\n\n// DumpGoMemoryTrace output memory profile to logs.\...
go
edit
0
3
apache-2.0
2bd23f3a5852bde496bf8bf19acf95eacab27000
libopenstorage/openstorage,libopenstorage/openstorage,pault84/openstorage,pault84/openstorage,pault84/openstorage,libopenstorage/openstorage
pkg/dbg/profile_dump.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage helpers\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/gbytes\"\n\t\"github.com/onsi/gomega/types\"\n)\n\n// SayPath is used to assert that a path i...
go
edit
3
2
apache-2.0
ae1b011e8616a6d3e77a520d47afb3d979335723
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
integration/helpers/matchers.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n\t\"github.com/prometheus/client_golang/prometheus/promhttp\"\n)\n\nvar collections = prometheus.NewSummary(prometheus.SummaryOpts{\n\tName: \"kub...
go
edit
3
1
apache-2.0
40b1ceaa1aec33c93e2351a4f15422c5d5b98355
UniconLabs/kube-saml-collector
metrics.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage golog\n\nimport \"testing\"\n\nfunc TestAsserta(t *testing.T) {\n db0 := NewDatabase()\n db1 := db0.Asserta(NewTerm(\"alpha\"))\n db2 := db1.Asserta(NewTerm(\"beta\"))\n db3 := db2.Asserta(NewTerm(\"gamma\", NewTerm(\"greek ...
go
edit
12
5
mit
85c92a53c5ec8c58fb6d2afee66a7109398fa07d
mndrix/golog,vzaramel/golog,samuell/golog,vzaramel/golog,bransorem/golog,bransorem/golog,samuell/golog,mndrix/golog
database_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/jawher/mow.cli\"\n\t\"github.com/vially/seomoz\"\n)\n\nfunc main() {\n\tapp := cli.App(\"seomoz\", \"Analyze URLs using SEOmoz\")\n\n\tapp.Spec = \"[--cols=<SEOmoz COLS>...
go
edit
3
5
mit
e8db31c34b70c0733d4e1c20ce06fe8a5dbc8e58
vially/seomoz
cmd/seomoz/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/leocassarani/pew/command\"\n\t\"os\"\n)\n\nfunc main() {\n\targs := os.Args\n\tif len(args) < 2 {\n\t\tprintUsage(args)\n\t\tos.Exit(1)\n\t}\n\n\tcmd := args[1]\n\tcmdArgs := args[2:]\n\n\tswi...
go
edit
0
5
mit
d77204399a3c26f306c214f0c48768f5c4ae713e
leocassarani/pew
main.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\n\t\"strings\"\n\n\t\"github.com/hackebrot/go-librariesio/librariesio\"\n)\n\nfunc loadFromEnv(keys ...string) (map[string]string, error) {\n\tenv := make(map[string]string)\n\n\tfor _, key := ran...
go
edit
0
3
mit
19483c59c12b2208dd919209b6e481c205713e0c
hackebrot/go-librariesio
librariesio/cmd/librariesio/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage godbg\n\nimport (\n\t\"os\"\n\t\"testing\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nfunc TestProject(t *testing.T) {\n\tConvey(\"Test buffers\", t, func() {\n\n\t\tConvey(\"By Default, equals to std\", func() {\n\t\t\tSo(...
go
edit
42
1
mit
f12337ee1915a606b6acc65f0aebf9f643fda471
VonC/godbg
gogdb_test.go
rejected_lint
Too many lint violations: 42
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage repository\n\nimport (\n\t\"fmt\"\n\n\t\"gopkg.in/asaskevich/govalidator.v6\"\n)\n\nfunc ValidateCreate(r *Repository) error {\n\tif err := validateName(r.Name); err != nil {\n\t\treturn err\n\t}\n\n\tif err := validateDescription(r.Des...
go
edit
12
4
apache-2.0
793044456495a61839478ac93175ad0d7aa3bf6e
gitpods/gitpods,gitpods/gitpods,gitpods/gitpods,gitpods/gitpods
repository/validate.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gbrotli\n\nimport (\n\t\"io\"\n\n\t\"github.com/dsnet/compress/brotli\"\n\t\"github.com/itchio/wharf/pwr\"\n)\n\ntype brotliDecompressor struct{}\n\nfunc (bc *brotliDecompressor) Apply(reader io.Reader) (io.Reader, error) {\n\tbr := bro...
go
edit
0
2
mit
7c576a60ccff5a5d28c874a32886852325e4b1c7
itchio/wharf,itchio/wharf.proto,itchio/wharf.proto,itchio/wharf
decompressors/gbrotli/gbrotli.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage pg_query\n\n// Note(LukasFittl): This needs Go 1.5 for $SRCDIR support, see\n// https://github.com/golang/go/commit/131758183f7dc2610af489da3a7fcc4d30c6bc48\n\n/*\n#cgo CFLAGS: -I${SRCDIR}/tmp/libpg_query-master\n#cgo LDFLAGS: -L${SRCDI...
go
edit
2
1
bsd-3-clause
a97b09ce55a0be3ad5a34c2b4a92cd324924809b
lfittl/pg_query.go,lfittl/pg_query.go
parse.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage atc\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\ntype PathFlag string\n\nfunc (path *PathFlag) UnmarshalFlag(value string) error {\n\tif value == \"\" {\n\t\treturn nil\n\t}\n\n\tmatches, err := filepath.Glob(value)\...
go
edit
6
5
apache-2.0
91638cc14d1e5d192683ccda9cb2fa5d2cfdee66
concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse
path_flag.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage registry\n\n// Schema1 sets the registry to serve v1 api\nfunc Schema1(c *Config) {\n\tc.schema1 = true\n}\n\n// Htpasswd sets the auth method with htpasswd\nfunc Htpasswd(c *Config) {\n\tc.auth = \"htpasswd\"\n}\n\n// Token sets the au...
go
edit
9
1
apache-2.0
92eca900b086200b4f270cf438a8a5ff9c8c2a3b
trebonian/docker,moby/moby,thaJeztah/docker,Mokolea/docker,konstruktoid/docker-upstream,thaJeztah/docker,jimjag/docker,konstruktoid/docker-upstream,konstruktoid/docker-upstream,Ramzec/docker,jimjag/docker,moby/moby,jimjag/docker,thaJeztah/docker,Ramzec/docker,moby/moby,mahak/docker,Mokolea/docker,Ramzec/docker,Mokolea/...
testutil/registry/ops.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/kataras/iris\"\n)\n\nfunc main() {\n\tapp := iris.New()\n\n\t// this works as expected now,\n\t// will handle *all* expect DELETE requests, even if there is no routes\n\tapp.Get(\"/action/{p}\", h)\n\n\t...
go
edit
0
2
bsd-3-clause
abb10e9cbfe5b28b693e3a138e54be495538ed31
kataras/iris,kataras/iris,kataras/gapi,kataras/iris,kataras/gapi,kataras/iris
_examples/routing/fallback-handlers/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage git\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestPatch(t *testing.T) {\n\trepo := createTestRepo(t)\n\tdefer repo.Free()\n\t//defer os.RemoveAll(repo.Workdir())\n\n\t_, originalTreeId := seedTestRepo(t, repo)\n\toriginalTree...
go
edit
21
2
mit
3e05c1038589258b40efd4bfef4d5c387bcc73c9
TheDahv/git2go,joseferminj/git2go,joseferminj/git2go,libgit2/git2go,treejames/git2go,Acidburn0zzz/git2go,hwjeong/git2go,treejames/git2go,Acidburn0zzz/git2go,treejames/git2go,ezwiebel/git2go,orivej/git2go,kissthink/git2go,clns/git2go,AaronO/git2go,orivej/git2go,TheDahv/git2go,TheDahv/git2go,clns/git2go,libgit2/git2go,hw...
patch_test.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage jsonptrerror_test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/dolmen-go/jsonptrerror\"\n)\n\nfunc ExampleDecoder() {\n\tdecoder := jsonptrerror.NewDecoder(strings.NewReader(\n\t\t`{\"key\": \"x\", \"value\": 5}`,\n\t))\n\tva...
go
edit
0
2
apache-2.0
10da1eaf3e2994e2d9b16cdf85b7e7e237761e3c
dolmen-go/jsonptrerror
decoder_example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gophercloud\n\nimport \"strings\"\n\n// ServiceClient stores details required to interact with a specific service API implemented by a provider.\n// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderCl...
go
edit
3
2
apache-2.0
55bbaafada72e0bc2af6121f8d1faa6e8e1eb752
pratikmallya/gophercloud,rackspace/gophercloud,dudymas/gophercloud,larsbutler/gophercloud,feiskyer/gophercloud,jarosser06/gophercloud,timbyr/gophercloud,carolynvs/gophercloud,jamiehannaford/gophercloud,feiskyer/gophercloud,rgbkrk/gophercloud,trumant/gophercloud,rackspace/gophercloud,DSpeichert/gophercloud,trumant/gophe...
service_client.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage metrics\n\nimport (\n\t\"strconv\"\n\t\"sync/atomic\"\n)\n\ntype Counter interface {\n\tInc(delta int64)\n\tDec(delta int64)\n\tSet(delta int64)\n\tCount() int64\n}\n\ntype atomicCounter int64\n\nfunc NewCounter() Counter {\n\tc := atom...
go
edit
0
1
bsd-3-clause
e3b1a0f5dc313071ea41110e53cff8a4bda50429
samuel/go-metrics
metrics/counter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2017 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 gps\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc stripVendor(pa...
go
edit
3
12
bsd-3-clause
151b3c82b548994c9061da2b05acbd8eab78cead
golang/dep,ibrasho-forks/dep,ibrasho-forks/dep,golang/dep,golang/dep
internal/gps/strip_vendor_windows.go
rejected_complexity
Cyclomatic complexity too high: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/drone/drone-go/drone\"\n\t\"github.com/jackspirou/syscerts\"\n)\n\ntype handlerFunc func(*cli.Context, drone.Client) error\n\n//...
go
edit
0
4
apache-2.0
f71c0a6006fd8282480b875577bf386db019b8ed
drone/drone-cli,drone/drone-cli,drone/drone-cli
drone/handle.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Albert Nigmatzianov. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage util\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nvar (\n\tsizeInt...
go
edit
6
3
mit
46383ae27d51da084fe7aa34637fc094d09d4149
bogem/id3v2
util/util_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\"testing\"\n\n\tassert \"github.com/stretchr/testify/require\"\n\t\"go.skia.org/infra/go/testutils\"\n\t\"go.skia.org/infra/proberk/go/types\"\n)\n\nfunc TestProbeSSL(t *testing.T) {\n\ttestutils.LargeTest(t)\n\tpro...
go
edit
6
3
bsd-3-clause
c41b31da262ee79bdfd833935c136a1c8e30cab5
google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot
proberk/go/proberk/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\"flag\"\n\t\"fmt\"\n\t\"net\"\n\n\t\"github.com/AdRoll/hologram/protocol\"\n)\n\nvar host = flag.String(\"host\", \"localhost\", \"IP or hostname to ping\")\nvar port = flag.Int(\"port\", 3100, \"Port to connect to ...
go
edit
0
4
apache-2.0
69561491f9025548a4a1673b1f70e1dadaf77df3
snwight/hologram,snwight/hologram,AdRoll/hologram,AdRoll/hologram
cmd/hologram-ping/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage routers\n\nimport (\n\t\"github.com/gorilla/mux\"\n\t\"github.com/unrolled/secure\"\n)\n\nvar secureMiddleware = secure.New(secure.Options{\n\t// SSLRedirect: true,\n\tFrameDeny: true,\n\tContentTypeNosniff: true,\n\tBro...
go
edit
12
1
mit
fc02c9475cd681f3ef7699e49ed9b2e3492d8555
Alex1sz/shotcharter-go-api
routers/router.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage blobstore\n\nconst (\n\tblobTypeSimpleStaticFile = 0x01\n\tblobTypeSimpleStaticDir = 0x11\n\n\tmaxSimpleFileDataSize = 16 * 1024 * 1024\n\tmaxSimpleDirEntries = 1024\n\n\tvalidationMethodHash = 0x01\n)\n\n```\n\nApply this change: Ad...
go
edit
0
0
bsd-3-clause
10366d507e20f8ac3dc68461b88ee2cd404062ee
cinode/golib
blobstore/consts.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"golang/finalize\"\n\t_ \"golang/hooks\"\n\t\"os\"\n\n\t\"github.com/cloudfoundry/libbuildpack\"\n)\n\ntype config struct {\n Config struct {\n GoVersion string `yaml:\"GoVersion\"`\n VendorTool string `yaml...
go
edit
0
6
apache-2.0
1aba4c628adaca49e706917001338fc21bfe77e8
cloudfoundry/go-buildpack,cloudfoundry/go-buildpack,cloudfoundry/go-buildpack
src/golang/finalize/cli/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/camd67/moebot/moebot_bot/bot/permissions\"\n\n\t\"github.com/camd67/moebot/moebot_bot/util/db\"\n)\n\ntype TimerCommand struct {\n\tComPrefix string\n\tChecker permissions.PermissionCh...
go
edit
3
1
mit
0e85cffe47bf79b03e6e941c93effa39c1005710
camd67/moebot,camd67/moebot
moebot_bot/bot/commands/timer.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"code.cloudfoundry.org/bbs/db/sqldb/helpers\"\n\t\"code.cloudfoundry.org/bbs/guidprovider\"\n\t\"code.cloudfoundry.org/lager\"\n\t\"code.cloudfoundry.org/locket/models\"\n)\n\n//go:generate counterfeiter . LockDB\ntyp...
go
edit
0
1
apache-2.0
0e8083c6e2d9335d5f90958a0ebcf673965db5ef
cloudfoundry-incubator/locket
db/sqldb.go
accepted
null
true