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 sqlc\n\nimport (\n\t\"reflect\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBasicComposition(t *testing.T) {\n\ts := Statement{}\n\ts = s.Select(\"*\").From(\"Employees\").Where(\"name = 'Marge'\").Order(\"id\")\n\n\tsql...
go
edit
6
2
mit
3c8adf08c8f68764bde178cea6e97962fe97d9f9
mipearson/sqlc
sqlc_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage singularity\n\nimport (\n\t\"github.com/opentable/sous/ext/docker\"\n\t\"github.com/opentable/sous/lib\"\n)\n\n// DummyNameCache implements the Builder interface by returning a\n// computed image name for a given source version\ntype Du...
go
edit
9
1
mit
ce26ce7488864dec155dc1805a33e0e89b3651eb
samsalisbury/sous,opentable/sous,opentable/sous,nyarly/sous,opentable/sous,opentable/sous,nyarly/sous,samsalisbury/sous,samsalisbury/sous,opentable/sous,samsalisbury/sous,nyarly/sous,samsalisbury/sous
ext/singularity/dummy_name_cache.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\"fmt\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc cmdPush(c *cli.Context) error {\n\trepos, err := repos(c.Bool(\"all\"), c.Args()...)\n\tif err != nil {\n\t\treturn cli.NewMultiError(fmt.Errorf(`failed gatherin...
go
edit
9
9
apache-2.0
24f286f82ed3999ed349372c76ccc272bc444362
nodejs-docker-bot/official-images,pesho/docker-official-images,thresheek/official-images,docker-solr/official-images,emilevauge/official-images,nodejs-docker-bot/official-images,docker-library/official-images,dinogun/official-images,infosiftr/stackbrew,docker-solr/official-images,docker-solr/official-images,thresheek/o...
bashbrew/go/src/bashbrew/cmd-push.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\"text/template\"\n)\n\nvar (\n\tBANNER_TEMPLATE = template.Must(template.New(\"banner\").Parse(\n\t\t`===================== goslow ====================\n`))\n\n\tCREATE_SITE_TEMPLATE = template.Must(template.New(\"c...
go
edit
0
0
mit
b4664b01c89d2b71a62936fc5bad3875177a98b5
alexandershov/goslow,alexandershov/goslow
templates.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage switchconsole\n\nimport (\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/docker/libcompose/project/options\"\n\t\"github.com/rancher/os/compose\"\n\t\"github.com/rancher/os/config\"\n\t\"golang.org/x/net/context\"\n)\...
go
edit
0
8
apache-2.0
42748a2c4b1307c012c5a2c2cc5bbbe5fd2bb1ba
ibuildthecloud/os,rancherio/os,gizmotronic/os,rancher/os,SvenDowideit/os,juliengk/os,juliengk/os,gizmotronic/os,rancher/os,rancherio/os,SvenDowideit/os,rancherio/os,ibuildthecloud/os
cmd/switchconsole/switch_console.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage goapi\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\t\"strings\"\n)\n\ntype Context struct {\n\tParams map[string]string\n\tRoute Route\n}\n\nfunc fromRequest(r *route, req *http.Request) (*Context, error) {\n\tpaths := strings.Split(str...
go
edit
6
3
mit
b6a4ce4e292367cb9a88e4ca9eab925ab1c49b71
vardius/goserver,vardius/goserver
context.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage stripe\n\n// DiscountParams is the set of parameters that can be used when deleting a discount.\ntype DiscountParams struct {\n Params\n}\n\n// Discount is the resource representing a Stripe discount.\n// For more details see https://s...
go
edit
6
0
mit
d104ebdf619fd589c1e69edcdb1086e65e28c64d
ChannelMeter/stripe-go,stripe/stripe-go,ChannelMeter/stripe-go,stripe/stripe-go
discounts.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage faker\n\nimport (\n\t\"math/rand\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"time\"\n)\n\nfunc random(min, max int) int {\n\trand.Seed(time.Now().Unix() + int64(rand.Int()))\n\treturn rand.Intn(max-min) + min\n}\n\n// UUID generate random uuid....
go
edit
0
2
mit
0ae7d3c6bcc7a880be4db7d503e52f8bcf49f847
raitucarp/faker
random.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage besticon\n\n// PopularSites we might use for examples and testing.\nvar PopularSites []string\n\nfunc init() {\n\tPopularSites = []string{\n\t\t\"apple.com\",\n\t\t\"bbc.co.uk\",\n\t\t\"bing.com\",\n\t\t\"booking.com\",\n\t\t\"craigslis...
go
edit
0
1
mit
b4b0d38e76022e4b1b8eaa3c0aa58c42e7e20533
mat/besticon,mat/besticon,mat/besticon
besticon/popular_sites.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"io\"\n \"os\"\n \"os/exec\"\n)\n\nfunc main() {\n config := exec.Command(\"configbrot\", os.Args[1:]...)\n render := exec.Command(\"renderbrot\")\n\n confoutp, conferrp, conferr := pip...
go
edit
0
2
mit
c14e4298246c74f064e60d0911b16792acf1caba
johnny-morrice/godelbrot
godelbrot.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage testutils\n\nimport (\n\t\"net/http/httptest\"\n\n\t\"github.com/gorilla/mux\"\n\t\"github.com/mailgun/scroll\"\n)\n\n// TestApp wraps a regular app adding features that can be used in unit tests.\ntype TestApp struct {\n\tRestHelper\n\...
go
edit
6
1
apache-2.0
72bf14c26294c79fad3c8bc16e4655a1fda60445
pquerna/scroll,mailgun/scroll,mailgun/scroll
testutils/testapp.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"os\"\n\t// \"github.com/pkg/errors\"\n)\n\ntype config struct {\n\tHost string\n\tPort string\n\n\tDebug bool\n}\n\nconst (\n\tDefaultHost = \"localhost\"\n\tDefaultPort = \"8000\"\n)\n\n// Config is set from the...
go
edit
0
8
apache-2.0
1df497d057f42493911fab7251a7b5fef5e529f7
yuuki/diamondb,yuuki/diamondb
lib/config/config.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tracing\n\nimport \"bytes\"\n\n// SpanError is a simple slice of Spans that implements error. To be meaningful,\n// at least (1) Span in the slice must have an error.\ntype SpanError []Span\n\nfunc (se SpanError) String() string {\n\tr...
go
edit
12
4
apache-2.0
e12b29759cd9b9a3ad94b2ad76694dc89ec2cce7
Comcast/webpa-common,Comcast/webpa-common
tracing/spanError.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Write go code for the following: Set up basic test infrastructure" }, { "role": "assistant", "content": "package sqlstore\n\nimport (\n\t\"fmt\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/mattn/go-sqlite3\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype Client...
go
new_file
0
3
mit
693b4f75d6e87fe1b227be37cb07cb9e3676efe9
DarinM223/osin-sql-storage
sqlstore/sqlstorage_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sample\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkLessThanRand(b *testing.B) {\n\ts, err := NewLessThan(1000)\n\tif err != nil {\n\t\tb.Fatal(\"NewLessThan must not error\", err)\n\t}\n\n\t// run sample b.N times\n\tfor n := 0; n < ...
go
edit
9
3
mit
eff3bfec17b711a2dd5f4efdb3b3bb1c6900e46b
breml/sample,breml/sample
benchmark_test.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\"os\"\n\t\"fmt\"\n\t\"encoding/json\"\n)\n\ntype Config struct {\n\tBooleanOption bool\n\tStringOption string\n\tArrayOption []string\n}\n\nfunc main() {\n\tfile, err := os.Open(\"config.json\")\n\tif err!= nil {\n\...
go
edit
0
4
mit
79a3160ccb19db48cf9038daae20133d490d478c
daniel-bryant-uk/go-book-exp
configreader/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage testutil\n\nimport \"sync/atomic\"\n\nvar nextPort uint32 = 41300\n\n// UniquePort generates a likely unique port, so that multiple servers can run\n// concurrently. Note that it does not actually check that the port is free,\n// but us...
go
edit
0
2
apache-2.0
228713acb8c952579be07f23249b0930c4bc49e5
pachyderm/pfs,pachyderm/pfs,pachyderm/pfs
src/server/pkg/testutil/ports.go
rejected_duplicate
Near-duplicate of sample 117798
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/flynn/flynn-controller/client\"\n)\n\nfunc main() {\n\tkey := os.Args[3]\n\n\tclient, err := controller.NewClient(\"\", os.Getenv(\"CONTROLLER_AUTH_KEY\"))\n\tif err != nil {\n\t\t...
go
edit
3
5
bsd-3-clause
fe56731123d96a1d466785458bd3587c8d06f211
flynn-archive/flynn-receive,flynn-archive/flynn-receive
key-check/main.go
rejected_duplicate
Near-duplicate of sample 119028
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\n Copyright The containerd 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
0
apache-2.0
62609d66d06a963036bc368a72f0524559d55dc2
mikebrow/containerd,containerd/containerd,estesp/containerd,thaJeztah/containerd,vdemeester/containerd,estesp/containerd,containerd/containerd,vdemeester/containerd,crosbymichael/containerd,mikebrow/containerd,dmcgowan/containerd,dmcgowan/containerd,thaJeztah/containerd,crosbymichael/containerd
defaults/defaults.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n)\n\nfunc main() {\n\thttp.Handle(\"/\", http.FileServer(http.Dir(\"../ui/\")))\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\n```\n\nApply this change: Add stubs for various request handlers" }, { ...
go
edit
0
1
bsd-2-clause
bc7ed292d2ab30a56442bb8f4ee7bc0e54ce48ff
ambidextrousTx/RWiki,ambidextrousTx/RWiki
server/server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage httpservicse\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gourd/kit/store\"\n)\n\n// Request contains all common fields needed for a usual API request\ntype Request struct {\n\n\t// Request stores the raw *http.Request\n\tRequest *http...
go
edit
0
0
mit
8221732e3d9e1db8dad0c521b9239af1de42f4ad
gourd/kit
service/http/protocol.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage filter\n\nimport (\n\t\"github.com/ikawaha/kagome/v2/tokenizer\"\n)\n\ntype (\n\tPOS = []string\n)\n\ntype POSFilter struct {\n\tfilter *FeaturesFilter\n}\n\n// NewPOSFilter returns a part of speech filter.\nfunc NewPOSFilter(stops ...P...
go
edit
0
5
mit
77932bc098850f81c831551f7e05969246cb66e0
ikawaha/kagome,ikawaha/kagome
filter/pos.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage wrapplog\n\nimport (\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nvar jsonFormatter = logrus.JSONFormatter{}\n\ntype WrappFormatter struct{}\n\nfunc init() {\n\tlogrus.SetFormatter(&WrappFormatter{})\n\tlogrus.SetO...
go
edit
0
1
mit
932adbff70a86fd1e79359d8323761ef569e5ca0
wrapp/wrapplog
log.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/bewuethr/advent-of-code/go/convert\"\n\t\"github.com/bewuethr/advent-of-code/go/intcode\"\n\t\"github.com/bewuethr/advent-of-code/go/ioutil\"\n\t\"github.com/bewuethr/advent-of-code/go/l...
go
edit
0
8
mit
447b539334464de8949aad222e85932cd926ec10
bewuethr/advent_of_code,bewuethr/advent_of_code,bewuethr/advent_of_code
2019/day05/first/day05a.go
rejected_duplicate
Near-duplicate of sample 116949
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build acceptance\n\npackage app\n\nimport (\n\tstdnet \"net\"\n\t\"time\"\n\n\t\"github.com/DATA-DOG/godog\"\n\t\"github.com/goph/stdlib/net\"\n\t\"google.golang.org/grpc\"\n)\n\nfunc FeatureContext(s *godog.Suite) {\n\taddr := net.ResolveV...
go
edit
0
1
mit
36afb44b25bc375046b089f675d700afbf737bc5
deshboard/boilerplate-model-service
app/features_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage github\n\nimport (\n\t\"context\"\n)\n\ntype Repo struct {\n\tName *string `json:\"name, omitempty\"`\n}\n\nfunc (github *Client) Repos(user string) ([]*Repo, error) {\n\tctx := context.Background()\n\n\trepos, _, err := github.client.R...
go
edit
6
3
mit
c1f6c7ed0bb6bc544da60c6da8b442f240404f0e
proshik/githubstatbot,proshik/githubstatbot
github/repository.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mocks\n\nimport \"time\"\n\ntype Service struct {\n\tURLCall struct {\n\t\tReturnURL string\n\t\tErr error\n\t}\n\n\tStartCall struct {\n\t\tCalled bool\n\t\tErr error\n\t}\n\n\tStopCall struct {\n\t\tCalled bool\n\t\tErr er...
go
edit
0
1
mit
8c066089cfc84e13709054cc54c941afb1cd8caa
Etienne42/agouti,abourget/agouti,sclevine/agouti,sclevine/agouti,abourget/agouti,Etienne42/agouti
api/internal/mocks/service.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage container\n\nimport (\n\t\"testing\"\n\n\t\"github.com/docker/docker/api/types\"\n)\n\nfunc TestCalculBlockIO(t *testing.T) {\n\tblkio := types.BlkioStats{\n\t\tIoServiceBytesRecursive: []types.BlkioStatEntry{{8, 0, \"read\", 1234}, {8,...
go
edit
3
3
apache-2.0
18caa28b669871adb11dff0f6914d3094d2d2c4e
Zebrilee/cli,redpanda/cli,ashfall/cli,riyazdf/cli,e11137/cli,dnephin/cli,Zebrilee/cli,dnephin/cli,ashfall/cli,e11137/cli,allencloud/cli,redpanda/cli,cpuguy83/cli,thaJeztah/cli,riyazdf/cli,cpuguy83/cli,allencloud/cli,gdevillele/cli,docker/cli,thaJeztah/cli,docker/cli
command/container/stats_unit_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage proto\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"github.com/vapourismo/knx-go/knx/encoding\"\n)\n\n// Address is a IPv4 address.\ntype Address [4]byte\n\n// Port is a port number.\ntype Port uint16\n\n// HostInfo contains information abou...
go
edit
0
4
mit
11fb2c6c9f583570ef82650a64e125c36c3114be
vapourismo/knx-go
knx/proto/hpai.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright (c) 2014 VMware, Inc. 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 http...
go
edit
0
2
apache-2.0
8593d9c70df732a62f7abfb4ac1548f095ab8275
jrmycanady/govmomi,l1jiang/govmomi,egorovv/govmomi,vmware/govmomi,egorovv/govmomi,daxgames/govmomi,daxgames/govmomi,abathla/govmomi,anexia-it/govmomi,ilikejam/govmomi,juju/govmomi,ilikejam/govmomi,gonkulator/govmomi,gonkulator/govmomi,casualjim/govmomi,higebu/govmomi,excilsploft/govmomi,chrislovecnm/govmomi,dougm/govmo...
govc/version/command.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage static\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nvar (\n\tErrUnknownCommand = errors.New(\"Unknown command. Valid commands are: 'server', 'build'.\")\n)\n\nconst (\n\tRunCommandServer = \"server\"\n\tRunCommandBuil...
go
edit
6
4
mit
25a041c0b624719e34369d4893ebee32b81c67ba
leighmcculloch/static
static_run.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//\n// Copyright (c) 2014 The heketi 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...
go
edit
0
0
apache-2.0
e3aaab175ff40d05eeab963592d862f83a873950
lpabon/heketi,humblec/heketi,humblec/heketi,lpabon/heketi,lpabon/heketi,Zandrr/heketi,Zandrr/heketi,Zandrr/heketi,humblec/heketi,humblec/heketi
requests/json_volumes.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage creational\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar outputWriter io.Writer = os.Stdout // modified during testing\n\n// StoogeType is used as a enum for stooge types.\ntype StoogeType int\n\nconst (\n\tLarry StoogeType = iot...
go
edit
0
4
mit
f7fed7aed50067c57296e05c08064b4c6c8ed4f4
bvwells/go-patterns,bvwells/go-patterns
creational/factory_method.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/b2aio/typhon/auth\"\n\t\"github.com/golang/protobuf/proto\"\n\t\"golang.org/x/net/context\"\n)\n\n// Request received by the server\ntype Request interface {\n\tcontext.Context\n\n\t// Id of this messa...
go
edit
6
2
mit
53d3ce1fc67cce86cd2db02907bd6de2c67065b3
monzo/typhon,mondough/typhon
server/request.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sudoblock\n\nimport (\n\t\"fmt\"\n\t\"github.com/shamsher31/goisroot\"\n\t\"github.com/shiena/ansicolor\"\n\t\"os\"\n)\n\nfunc Is() {\n\tif root.Is() {\n\t\tw := ansicolor.NewAnsiColorWriter(os.Stdout)\n\t\tmessage := \"%sYou are not al...
go
edit
6
2
mit
79daec8f5956f6f8511c9e5519b85ac51ce0fbd6
shamsher31/gosudoblock
sudoblock.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage plugin\n\nimport \"os\"\n\n/**\n\t* This function is called by the plugin to setup their server. This allows us to call Run on the plugin\n\t* os.Args[1] port CF_CLI rpc server is running on\n\t* os.Args[2] **OPTIONAL**\n\t\t* SendMetad...
go
edit
6
2
apache-2.0
104740c9552270adc635b0447757204a17120b23
18F/cli,xingzhou/cli,rastasheep/trash-can,cgvarela/cli,pishro-cc/cli,saravana76/cli,EngineerBetter/cli,zhang-hua/cli,carnell69/cli,xingzhou/cli,saravana76/cli,hyenaspots/cli,SrinivasChilveri/cli,mcintyred/cli,EngineerBetter/cli,TomG713/cli,carnell69/cli,zhang-hua/cli,mcowger/cli,ofer43211/cli,zhang-hua/cli,fujitsu-cf/c...
plugin/plugin_shim.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tokenizer\n\nimport (\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestEnglish001(t *testing.T) {\n\tfiles := []string{\n\t\t\"testdata/input-org-syn.txt\",\n\t\t\"testdata/input-te-wiki.txt\",\n\t}\n\n\tfor _, fn := range files {\n\t\tt....
go
edit
6
5
mit
7f16516d8feaf99e0be1f1d85b81fa595895730a
js-ojus/RxnMiner,RxnWeaver/RxnMiner
tokenizer/text_token_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"time\"\n)\n\n// Client is the aptomictl config representation\ntype Client struct {\n\tDebug bool `validate:\"-\"`\n\tAPI API `validate:\"required\"`\n\tAuth Auth `validate:\"required\"`\n\tHTTP HTTP `valida...
go
edit
3
1
apache-2.0
5ae158f91cef7c6e8889f0a9697ba5b18a858cd3
Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi
pkg/config/client.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage base\n\nconst (\n\tdefaultTimeFormat = \"2006-01-02-15-04-05\"\n)\n\ntype Config struct {\n\t// TimeFormat is used for a directory path\n\tTimeFormat string\n\n\t// RootDir\n\tRootDir string\n\n\t// TempDir\n\tTempDir string\n}\n\nfunc ...
go
edit
0
2
apache-2.0
78e4fa6f41a1061033be63ca323ae7837b3a5cd1
taku-k/polymerase,taku-k/polymerase,taku-k/polymerase,taku-k/polymerase
pkg/base/config.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/pagarme/teleport/config\"\n\t\"github.com/pagarme/teleport/server\"\n)\n\nfunc main() {\n\tconfig := config.New()\n\n\t// Load config file\n\terr := config.ReadFromFile(\"source_config.yml\")\...
go
edit
0
4
mit
e6e81175964c529897196451c8ff0943fbe78710
pagarme/teleport,pagarme/teleport,timehop/teleport
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage lang\n\ntype APIPolicy struct {\n\tNamespace map[string]*PolicyNamespace\n}\n\ntype APIPolicyNamespace struct {\n\tServices map[string]*Service\n\tContracts map[string]*Contract\n\tClusters map[string]*Cluster\n\tRules ...
go
edit
21
1
apache-2.0
6c3a7b745cc5bb236df587bf2ad27bd16b0f1b94
Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi
pkg/lang/policy_api.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage keys\n\nimport \"fmt\"\n\n// Kind expresses usage of the ambient internal key.\ntype Kind int\n\nconst (\n\t// Delete represents deletion of this key.\n\tDelete = 0\n\t// Value represents value setting of this key.\n\tValue = 1\n\tmax...
go
edit
0
3
mit
b6dc6b208309f5035b1ca22e565a1dfa982691d9
kezhuw/leveldb,kezhuw/leveldb
internal/keys/kind.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage webbrowser\n\nimport (\n\t\"errors\"\n\t\"net/url\"\n\t\"os/exec\"\n)\n\nvar (\n\tErrCantOpen = errors.New(\"webbrowser.Open: can't open webpage\")\n\tErrNoCandidates = errors.New(\"webbrowser.Open: no browser candidate found for yo...
go
edit
0
4
mit
0410e3edc651f083577e49ab2248a63f6cc86975
toqueteos/webbrowser
webbrowser.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage horizon\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\tgctx \"github.com/goji/context\"\n\t\"github.com/stellar/go-horizon/render/problem\"\n\t\"github.com/zenazn/goji/web\"\n\t. \"github.com/zenazn/goji/web/middleware\"\n\t\"log\"\n\t\"net/htt...
go
edit
0
2
apache-2.0
a983ff09acefb0d7255abf92573b338cc67de135
irisli/horizon,masonforest/go-horizon,masonforest/horizon,FredericHeem/go-horizon,lackac/horizon,stellar/horizon,masonforest/horizon,irisli/horizon,lackac/horizon,FredericHeem/go-horizon,stellar/horizon,masonforest/go-horizon,stellar/horizon,nullstyle/go-horizon,nullstyle/go-horizon,masonforest/go-horizon,nullstyle/go-...
middleware_recover.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\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 time\n\nimport (\n\t\"testing\";\n\t\"time\";\n)\n\nexport func TestTick...
go
edit
6
4
bsd-3-clause
3faba6bf3cf82dbf8f5eff0a8927d1a8a954d2f3
abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go
src/lib/time/tick_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\t\"net/smtp\"\n\t\"strconv\"\n)\n\ntype emailManager struct {\n\tLogin string\n\tPassword string\n\tHost string\n\tPort int\n}\n\nfunc NewEmailManager() *emailManager {\n\tmanager := new(emailMan...
go
edit
12
1
mit
b7f2285ba304b0473025902fd6508a175cf51420
lukasz-pyrzyk/CerberCam,lukasz-pyrzyk/CerberCam,lukasz-pyrzyk/CerberCam,lukasz-pyrzyk/CerberCam,lukasz-pyrzyk/CerberCam
Src/Server/emailManager.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2014 Google Inc. 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 http://ww...
go
edit
0
2
apache-2.0
f45c7a34e944b6fb12e01dbc8f227a924bdec1ab
kubernetes/api
pkg/api/unversioned.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage utils\n\nimport \"sync\"\n\n// ConcurrentSlice type that can be safely shared between goroutines\ntype ConcurrentSlice struct {\n\tsync.RWMutex\n\titems []interface{}\n}\n\n// ConcurrentSliceItem contains the index/value pair of an item...
go
edit
0
3
mit
097bd9f0b1cd3cae779ed277efce5911359cc49a
ranjithamca/gru
utils/slice.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage svg\n\n// InstructionType tells our path drawing library which function it has\n// to call\ntype InstructionType int\n\n// These are instruction types that we use with our path drawing library\nconst (\n\tPathInstruction InstructionType...
go
edit
9
0
mit
93fdb8b568b3f0e9fb822242cb9b3f3ee67d2a60
rustyoz/svg
drawinginstruction.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage streaming\n\nimport (\n\t\"net/url\"\n\n\t\"github.com/ChimeraCoder/anaconda\"\n)\n\nfunc StartUserStream(api *anaconda.TwitterApi) anaconda.Stream {\n\tv := url.Values{}\n\tv.Set(\"with\", \"user\")\n\tv.Set(\"replies\", \"all\")\n\tre...
go
edit
0
1
mit
daef6f29bcd8a9212fb44b42431352c4eae276dd
mrap/twitterget
streaming/streaming.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage engine\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\ntype Dot struct {\n\tX uint8\n\tY uint8\n}\n\n// Equals compares two dots\nfunc (d1 Dot) Equals(d2 Dot) bool {\n\treturn d1 == d2 || (d1.X == d2.X && d1.Y == d2.Y)\n}\n\n// Implem...
go
edit
0
4
bsd-2-clause
068fc2e05e885734d5d6ab8c66ce5b94867bdd07
ivan1993spb/clever-snake
engine/dot.go
rejected_duplicate
Near-duplicate of sample 117759
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\t\"warcluster/entities\"\n\t\"warcluster/server/response\"\n)\n\n// StartMissionary is used when a call to initiate a new mission is rescived.\n// 1. When the delay ends the thread ...
go
edit
3
2
mit
ff48cecce2391f044c9ea8451ce493f429e7123b
WarCluster/warcluster-server,WarCluster/warcluster-server
server/missionary.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cfgfile\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\t\"gopkg.in/yaml.v2\"\n)\n\n// Command line flags\nvar configfile *string\nvar testConfig *bool\n\nfunc CmdLineFlags(flags *flag.FlagSet, name string) {\n\tconfigfile = fla...
go
edit
0
4
mit
2a2989abe972e1c7a3d88698a3ecb9874328fa8f
yapdns/yapdnsbeat,yapdns/yapdnsbeat
cfgfile/cfgfile.go
rejected_duplicate
Near-duplicate of sample 117292
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage templates\n\nfunc ScopeTemplateContent() string {\n\treturn `#cloud-config\n\n{{ .Name}}:\n {{ range .Services }}{{ .GetName }}:\n {{ range $key, $value := .GetParameters }}{{ $key }}: {{ $value }}\n {{ end }}\n {{ end }}\n`\n}\...
go
edit
0
1
apache-2.0
37b210689082a98536f36f0781e18f732259a13a
bernardolins/clustereasy,bernardolins/clustereasy
templates/content.go
rejected_duplicate
Near-duplicate of sample 116954
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage route\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mailgun/predicate\"\n)\n\n// IsValid checks whether expression is valid\nfunc IsValid(expr string) bool {\n\t_, err := parse(expr, &match{})\n\treturn err == nil\n}\n\nfunc parse(expression...
go
edit
33
4
apache-2.0
599439ae107b1f36aebb7754aaa9c2f27e5eec36
vulcand/route,mailgun/route
parse.go
rejected_lint
Too many lint violations: 33
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"fmt\"\n\t\"github.com/timakin/ts/loader\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar Commands = []cli.Command{\n\tcommandAll,\n\tcommandBiz,\n\tcommandHack,\n}\n\nvar commandAll = cli.Command{...
go
edit
0
2
mit
3fab59b1d33459b5ec435f6ad950c24237ed6ffa
timakin/ts,timakin/ts
commands.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)\n\nfunc helloWorld(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hello World!\")\n}\n\nfunc startPage(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprint(w, \"Hello, tes...
go
edit
0
1
mit
a46d7149f8c866d75f0161df3788c1e9331e2dcf
GreyLabsDev/GoTests,GreyLabsDev/GoTests
hw.go
rejected_duplicate
Near-duplicate of sample 117971
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"hge\"\n)\n\nvar h *hge.HGE\n\nfunc FrameFunc() int {\n\tif h.Input_GetKeyState(hge.K_ESCAPE) {\n\t\treturn 1\n\t}\n\n\treturn 0\n}\n\nfunc main() {\n\th = hge.Create(hge.VERSION)\n\tdefer h.Release()\n\n...
go
edit
0
2
bsd-2-clause
8dfe751d5529fbc192a281ce20ef8478bf40e741
losinggeneration/hge,losinggeneration/hge-go,losinggeneration/hge-go,losinggeneration/hge
tutorial01/main.go
accepted
null
true
[ { "role": "user", "content": "Write go code for the following: Add an example load balancing test" }, { "role": "assistant", "content": "package cloudflare_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\tcloudflare \"github.com/cloudflare/cloudflare-go\"\n)\n\nfunc ExampleAPI_ListLoadBalancers() {\n...
go
new_file
0
5
bsd-3-clause
0a4ec9f982f1c55e5b41650b2ef865ef956addab
cloudflare/cloudflare-go,cloudflare/cloudflare-go
load_balancing_example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage missinggo\n\nimport \"io\"\n\ntype StatWriter struct {\n\tWritten int64\n\tw io.Writer\n}\n\nfunc (me *StatWriter) Write(b []byte) (n int, err error) {\n\tn, err = me.w.Write(b)\n\tme.Written += int64(n)\n\treturn\n}\n\nfunc NewSt...
go
edit
0
2
mit
f1b72f4fee37bb9b19ef15e207e398baeba4220b
anacrolix/missinggo
ioutil.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\r\n\r\nimport (\r\n\t// \"fmt\"\r\n\t\"os\"\r\n\t\"strings\"\r\n\t\"testing\"\r\n)\r\n\r\nfunc TestGeneral(t *testing.T) {\r\n\tdefer os.RemoveAll(\"data\")\r\n\tp := Open(\"testpage\")\r\n\terr := p.Update(\"**bold**\")\r\n\tif er...
go
edit
15
5
mit
e9e513171c5188b616e6b7f49ee33d512833c7af
schollz/AwwKoala,schollz/cowyo,schollz/AwwKoala,schollz/AwwKoala,schollz/AwwKoala
page_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor _, ev := range WolfEnumValues() {\n\t\tfmt.Println(\"Enum value: \", ev)\n\t}\n\n\tev1 := Wolf1{}.New()\n\tev2 := Wolf2{}.New()\n\n\tif ev1 != ev2 {\n\t\tfmt.Println(ev1, \" differs from \"...
go
edit
0
9
mit
1b71ee9f41dde3560f816b8ba6e9932211789f0f
gdm85/go-genums
examples/intEnums/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage funk\n\nimport (\n\t\"reflect\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nfunc Fill(in interface{}, fillValue interface{}) (interface{}, error) {\n\tinValue := reflect.ValueOf(in)\n\tinKind := inValue.Type().Kind()\n\tif inKind != reflect.Slice &&...
go
edit
0
5
mit
77849ede1a3ccc01b3e8db6a458ba6d15447a476
thoas/go-funk,thoas/go-fn
fill.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/exec\"\n)\n\nfunc proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {\n\tproc := exec.Command(args[0], args[1:]...)\n\tproc.Dir = workdir\n\n\tdone := make(chan b...
go
edit
15
7
mit
442aed80fd4a62be7142a5da1a51eae3f53e5a20
alco/goon,felixbuenemann/goon,felixbuenemann/goon,alco/goon
proto_0_0.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage multihash\n\nimport (\n\t\"errors\"\n)\n\n// ErrSumNotSupported is returned when the Sum function code is not implemented\nvar ErrSumNotSupported = errors.New(\"Function not implemented. Complain to lib maintainer.\")\n\nvar ErrLenTooLa...
go
edit
9
5
mit
442f64ad9d4812d72bdc6219f3cc158a92d4e54e
jbenet/go-multihash,jbenet/go-multihash
sum.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage xstrings\n\nimport (\n\t\"strings\"\n)\n\n// Upcase returns a copy of string s\n// with all lowercase letters replaced\n// with their uppercase counterparts.\n\nfunc Upcase(s string) string {\n\treturn strings.ToUpper(s)\n}\n\n```\n\nAp...
go
edit
0
1
bsd-2-clause
caa9a2c71883912ded2b765fc874aa390cc536c0
wallclockbuilder/gstrings,wallclockbuilder/stringutil
xstrings/upcase.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\n\t\"github.com/rafaeljusto/cctldstats/config\"\n)\n\n// Connection database connection.\nvar Connection *sql.DB\n\n// Connect performs the database connection. Today the following databas...
go
edit
0
3
mit
a8875df193de5915ec472414145bd9f952d4cc68
rafaeljusto/cctldstats
db/db.go
rejected_duplicate
Near-duplicate of sample 118546
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// gddoexp is a command line tool crated to list eligible packages for\n// archiving in GoDoc.org\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/golang/gddo/database\"\n\t\"github.com/rafaeljusto/gddoexp\"\n)\n\nfunc main() {\n\tdb, err...
go
edit
0
6
mit
73812af5f144d49e532eba96261e152b565d243a
rafaeljusto/gddoexp
cmd/gddoexp/gddoexp.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage evaluation\n\nimport \"fmt\"\n\nfunc Err(ctx *Context, msg, tag string, fmts ...interface{}) Object {\n\tmsg = fmt.Sprintf(msg, fmts...)\n\n\te := &Instance{\n\t\tBase: ctx.Get(\"Error\"),\n\t}\n\n\tif e.Base == nil {\n\t\tpanic(\"Since...
go
edit
18
2
mit
9e09c7603cb8dc67266e4418043cca91b487b4db
pluto-language/pluto
evaluation/errors.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage engi\n\ntype Entity struct {\n\tid string\n\tcomponents []Component\n\trequires []string\n}\n\nfunc NewEntity(requires []string) *Entity {\n\treturn &Entity{requires: requires}\n}\n\nfunc (e *Entity) DoesRequire(name string) b...
go
edit
9
3
mit
71ac956c57977c38325979dbf0de29c282b1c06f
Newbrict/engi,EngoEngine/engo,paked/engi,EngoEngine/engo,Newbrict/engi,Newbrict/engo,EtienneBruines/engi,Newbrict/engo
entity.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage image\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/dnephin/dobi/tasks/context\"\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\n// RunPush pushes an image to the registry\nfunc RunPush(ctx *context.ExecuteContext, t *Task, _ ...
go
edit
9
2
apache-2.0
1be16f01e01f15c4148c7eacf85c9a297e0c038d
dnephin/dobi,dnephin/dobi
tasks/image/push.go
rejected_lint
Too many lint violations: 9
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/util/db\"\n\t\"github.com/camd67/moebot/moebot_bot/util/reddit\"\n)\n\ntype RandomCommand struct {\n\tRedditHandle *reddit.Handle\n}\n\nfunc (ac *RandomCommand) ...
go
edit
3
2
mit
564facec9183e6152408543a0bd7d9ad9148da27
camd67/moebot,camd67/moebot
moebot_bot/bot/commands/random.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"net/http\"\n)\n\nvar bindaddr = flag.String(\"bind-address\", \":8080\", \"Address to respond to HTTP requests on\")\n\nfunc main() {\n\tlog.SetFlags(0)\n\tflag.Parse()\n\tgo h.run()\n\tgo re...
go
edit
9
3
apache-2.0
c1fc51fddf78f194498fbd0c7175a5c48e17cb8e
flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools
sinks/adsb-ws/main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dexcom\n\n//go:generate ../gen_crc_table/gen_crc_table\n\nfunc crc16(msg []byte) []byte {\n\tres := uint16(0)\n\tfor _, b := range msg {\n\t\tres = res<<8 ^ crc16Table[byte(res>>8)^b]\n\t}\n\treturn MarshalUint16(res)\n}\n\n```\n\nApply...
go
edit
6
2
mit
f2c87d2930e64db4eec51b74db8b7d321a6d480a
ecc1/dexcom
crc16.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\"crypto/tls\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\taddr := flag.String(\"addr\", \":4000\", \"HTTP network address\")\n\tcertFile := flag.String(\"certfile\", \"cert.p...
go
edit
0
2
unlicense
009f8981aabf58e5baf4f1c652bb538ea6d541c5
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
2021/tls/https-server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2016 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
0
1
apache-2.0
a4bfead8819da655e78d990680d200fae519cc55
bowei/dns,bowei/dns,cmluciano/dns,kubernetes/dns,corlettb/dns,kubernetes/dns,cmluciano/dns,corlettb/dns,kubernetes/dns
cmd/kube-dns/dns.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage crypto\n\nimport (\n\t\"testing\"\n)\n\n// TestRandIntnPanics tests that RandIntn panics if n <= 0.\nfunc TestRandIntnPanics(t *testing.T) {\n\tdefer func() {\n\t\tif r := recover(); r == nil {\n\t\t\tt.Error(\"expected panic for n <= 0...
go
edit
6
3
mit
77e0cadc1eba7101344af34a73a39654221d8b93
ericflo/Sia,mnsl/Sia,Mingling94/Sia,NebulousLabs/Sia,mharkus/Sia,MrStrong/Sia,mtlynch/Sia,ChrisSchinnerl/Sia,rivine/rivine,NebulousLabs/Sia,rivine/rivine,MrStrong/Sia,mnsl/Sia,mtlynch/Sia,ChrisSchinnerl/Sia,ericflo/Sia,johnathanhowell/Sia,mharkus/Sia
crypto/rand_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\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/scottjbarr/genpass\"\n)\n\nfunc main() {\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = \"8080\"\n\t}\n\n\tbind := fmt.Sprintf(\":%v...
go
edit
0
3
mit
a7c7f8ba291cf93958b49120f8e16899b21f613d
scottjbarr/genpass
cmd/genpass-http/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage codecs\n\nimport (\n\t\"bytes\"\n\t\"math\"\n\t\"math/rand\"\n\t\"testing\"\n)\n\nfunc TestG722Payloader(t *testing.T) {\n\tp := G722Payloader{}\n\n\tconst (\n\t\ttestlen = 10000\n\t\ttestmtu = 1500\n\t)\n\n\t//generate random 8-bit g72...
go
edit
3
5
mit
297531c672687973facd15b3d0b8a6c839fef6ef
pion/rtp
codecs/g722_packet_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n\npackage crypto\nimport (\n\t\"testing\"\n\t\"fmt\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestEncrypt(t *testing.T) {\n\tauthKey := []byte(\"545e0716f2fea0c7a9c46c74fec46c71\")\n\texpected := map[string]interface{}{\"entity\": \...
go
edit
9
1
mit
a06b2733ee93a553a0e7691fa9c476419fb69bf1
vanng822/aguin,vanng822/aguin,vanng822/aguin,vanng822/aguin,vanng822/aguin
src/aguin/crypto/signed_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage set\n\nimport (\n\t\"testing\"\n)\n\n// BenchmarkAdd checks the performance of the set.Add() method\nfunc BenchmarkAdd(b *testing.B) {\n\t// Create a new set\n\tset := New()\n\n\t// Run set.Add() b.N times\n\tfor i := 0; i < b.N; i++ {\...
go
edit
12
2
mit
c21945cbc2ed0b993b1db071c02623812094465d
mdlayher/goset
set_bench_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\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 time\n\nimport (\n\t\"testing\";\n\t\"time\";\n)\n\nexport func TestTick...
go
edit
6
4
bsd-3-clause
3faba6bf3cf82dbf8f5eff0a8927d1a8a954d2f3
abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go
src/lib/time/tick_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\"runtime\"\n\n\t\"gonico\"\n)\n\nconst (\n\tstartHelp = \"Set start page\"\n\tendHelp = \"Set end page\"\n\toutHelp = \"Set download path\"\n\tintervalHelp = \"Polling interval time (min)\"\...
go
edit
0
1
mit
143de764951ce3a467032c53dead6e7f2a6e0865
takuan-osho/gonico
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nfunc main() {\n}\n\n```\n\nApply this change: Throw in some initial basic code so we have something to work with" }, { "role": "assistant", "content": "package main\n\nimport (\n\t\"log\"\n\n\t\"pault.ag/go/debian/co...
go
edit
0
7
mit
1e52da8ed1a84cdb8e36aedec0d90ef637f72099
tianon/dtodo
src/cmd/dtodo/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage helpers\n\nfunc ConvertTypeForJS(s string) string {\n\tconv := map[string]string{\n\t\t\"array\": \"array\",\n\t\t\"boolean\": \"boolean\",\n\t\t\"integer\": \"number\",\n\t\t\"number\": \"number\",\n\t\t\"object\": \"object\",\n\t\...
go
edit
0
2
mit
e8c2f51ea4163622526a670c7d6225ddc1c8fe4b
go-jstmpl/go-jstmpl,minodisk/go-jstmpl
helpers/js.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dns\n\nimport (\n\t\"testing\"\n)\n\nfunc TestDynamicUpdateParsing(t *testing.T) {\n\tprefix := \"example.com. IN \"\n\tfor _, typ := range TypeToString {\n\t\tif typ == \"CAA\" || typ == \"OPT\" || typ == \"AXFR\" || typ == \"IXFR\" ||...
go
edit
0
14
bsd-3-clause
7619917e11bec5c0c743c01b37b8d8eb956bd775
bboreham/dns,skynet/dns,miekg/dns,josephyzhou/dns,modulexcite/dns,jmhodges/dns,tempbottle/dns,bragr/dns,flebarbe/dns,ym/go-dns,skyportsystems/dns,cloudflare/dns,curtiszimmerman/dns,benbearchen/dns,Git-Host/dns,tsenart/dns,ezoic/dns,janstk/dns,letsencrypt/dns,jdef/dns,Psiphon-Inc/dns,michaelharo/dns,asergeyev/dns,ErikDu...
update_test.go
rejected_complexity
Cyclomatic complexity too high: 14
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//go:build linux && cgo && !agent\n// +build linux,cgo,!agent\n\npackage state\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/lxc/lxd/lxd/db\"\n\t\"github.com/lxc/lxd/lxd/firewall\"\n\t\"github.com/lxc/lxd/lxd/sys\"\n)\n\n// NewTes...
go
edit
6
1
apache-2.0
d2b79eddb0e79fcf29f697731ef60a5c0837c484
atxwebs/lxd,atxwebs/lxd,lxc/lxd,lxc/lxd,atxwebs/lxd,atxwebs/lxd,hallyn/lxd,hallyn/lxd,lxc/lxd,lxc/lxd,lxc/lxd,hallyn/lxd,hallyn/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,stgraber/lxd
lxd/state/testing.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"go/build\"\n\t\"log\"\n\t\"net/http\"\n\t\"path/filepath\"\n\n\t\"github.com/shurcooL/go/gopherjs_http\"\n\t\"github.com/shurcooL/httpfs/httputil\"\n\t\"github.com/shurcooL/httpfs/vfsutil\"\n)\n\nfunc init() {\n...
go
edit
0
2
mit
181822dd2b2187367f11cbcaf16c261fc16f4849
shurcooL/frontend,shurcooL/frontend
table-of-contents/handler/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage herd\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n)\n\nvar httpdHerd *Herd\n\nfunc (herd *Herd) startServer(portNum uint, daemon bool) error {\n\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", portNum))\n\tif err != nil...
go
edit
24
3
apache-2.0
2258533f00d6e8383052a06976b86e627bf1cc11
rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator
dom/herd/httpd.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage langdet\n\n// Token represents a text token and its occurence in an analyzed text\ntype Token struct {\n\tOccurrence int\n\tKey string\n}\n\n// ByOccurrence represents an array of tokens which can be sorted by occurrences of the ...
go
edit
0
2
apache-2.0
544e3058008e94569a463d2849034d65739f0a4c
chrisport/go-lang-detector
langdet/models.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage collector\n\nimport \"github.com/prometheus/client_golang/prometheus\"\n\nconst namespace = \"ipmi\"\n\nvar (\n\ttemperatures = prometheus.NewDesc(\n\t\tprometheus.BuildFQName(namespace, \"\", \"temperatures\"),\n\t\t\"Contains the coll...
go
edit
0
0
bsd-3-clause
94739f50927845013ce01a310fbfc2a23855be15
lovoo/ipmi_exporter,lovoo/ipmi_exporter
collector/metrics.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build windows\n\npackage main\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/mattn/go-colorable\"\n\n\t\"github.com/lxc/lxd/shared/logger\"\n)\n\n// Windows doesn't process ANSI sequences natively, so ...
go
edit
12
4
apache-2.0
d819d52e60622806e94fcd99ed82e59dc889f42e
lxc/lxd,stgraber/lxd,Skarlso/lxd,lxc/lxd,Skarlso/lxd,hallyn/lxd,erikmack/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,Skarlso/lxd,mjeanson/lxd,Skarlso/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,atxwebs/lxd,erikmack/lxd,hallyn/lxd,erikmack/lxd,atxwebs/lxd,hallyn/lxd,mjeanson/lxd,stgraber/lxd,hallyn/lxd,pcdummy/lxd,atxwebs/lxd,lxc/lxd,st...
lxc/exec_windows.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage components\n\nimport (\n\t\"testing\"\n\n\t\"github.com/scipipe/scipipe\"\n)\n\nfunc TestCommandToParams(tt *testing.T) {\n\t// Run test workflow and make sure that the parameter read from the file is\n\t// always \"abc\"\n\twf := scipi...
go
edit
3
4
mit
6155cdba0bb5a316ffa7105dafa4224c9fec9fc1
scipipe/scipipe,samuell/scipipe,scipipe/scipipe
components/cmd_to_param_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage moeparser\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestBbCodeParse(t *testing.T) {\n\ttestString := `Something [b][i][img=http://sauyon.com/blah.png][/i][/i] [b]hi[/b=what]\nThis seems to work very well :D [url][/url] [size=12px...
go
edit
0
3
bsd-2-clause
147d5555aef0c08495931f9fa2745829abe3b58f
moechat/parser
bbcode_test.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\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\...
go
edit
0
3
mit
fd6982c0c6c53d66e35658aa4beb8cb2c1de74a2
bogem/nehm
util/util.go
rejected_duplicate
Near-duplicate of sample 119475
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestBoolEqual(t *testing.T) {\n\tfor _, ts := range [][2]*Thunk{\n\t\t{True, True},\n\t\t{False, False},\n\t} {\n\t\tassert.True(t, testEqual(ts[0], ...
go
edit
36
3
mit
24c8425a8b65e4e18146bf487f22898873b488f7
raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp
src/lib/core/bool_test.go
rejected_lint
Too many lint violations: 36
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage narcissus\n\nimport (\n\t\"testing\"\n\n\t\"honnef.co/go/augeas\"\n)\n\ntype foo struct {\n}\n\nfunc TestParseNotAPtr(t *testing.T) {\n\tn := New(&augeas.Augeas{})\n\terr := n.Parse(foo{}, \"/files/some/path\")\n\n\tif err == nil {\n\t\...
go
edit
9
3
apache-2.0
9d477a0b0ceb63bba152b82a8e0de8dfb94c93f7
raphink/narcissus
parse_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build linux\n\npackage common\n\nimport \"os\"\n\nfunc NumProcs() (uint64, error) {\n\tf, err := os.Open(HostProc())\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tlist, err := f.Readdir(-1)\n\tdefer f.Close()\n\tif err != nil {\n\t\tretur...
go
edit
3
4
bsd-3-clause
613ada987d2da5d1bcbbd7d4fd40ef0ab69132c2
influxdb/gopsutil,influxdb/gopsutil
internal/common/common_linux.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build go1.8\n\npackage avatica\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n)\n\ntype namedValue struct {\n\tName string\n\tOrdinal int\n\tValue driver.Value\n}\n\nfunc driverValueToNamedValue(values []driver.Value) []namedValue ...
go
edit
0
3
apache-2.0
2e145609dbccdae3f245b9699bab5d550de591c1
Boostport/avatica,Boostport/avatica
compat_go18.go
rejected_duplicate
Near-duplicate of sample 118498
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage orchestrators\n\nimport (\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/camptocamp/conplicity/handler\"\n\t\"github.com/camptocamp/conplicity/volume\"\n)\n\n// Orchestrator implements a container Orchestrator interface\ntype Orc...
go
edit
3
2
apache-2.0
ad8616bf2c88d174c110a14caa62d586c0222f9f
camptocamp/conplicity,camptocamp/conplicity
orchestrators/orchestrator.go
accepted
null
true