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\n// +build !linux\n\npackage lxc\n\nfunc finalizeNamespace(args *InitArgs) error {\n\tpanic(\"Not supported on this platform\")\n}\n\n```\n\nApply this change: Windows: Fix go test in execdriver\\lxc\n\nSigned-off-by: John Howard <<EMAIL>>" },...
go
edit
0
1
apache-2.0
30ab497e174cdf788b8e7864c2e2e4019a119978
achanda/docker,bluebreezecf/docker,catinthesky/docker,amatsus/docker,Test-Betta-Inc/psychic-barnacle,dims/docker,SvenDowideit/docker,paralin/docker,Tenk42/docker,kunalkushwaha/docker,allencloud/docker,anortef/docker,YujiOshima/docker,willmtemple/docker,jlhawn/docker,amatsus/docker,hqhq/moby,pragyasardana/Docker-cr-comb...
daemon/execdriver/lxc/lxc_init_unsupported.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"sync\"\n\t\"text/template\"\n)\n\n// Per IP address rate limit in seconds\nconst rateLimitSeconds = 15\n\nvar templates = template.Must(template.ParseFiles(\"tmpl/header.tmpl\", \"tmpl/footer.tmpl\", \"tmpl/homepag...
go
edit
0
0
mit
2547713698c5e44991aa0fe9137f07e60fc38dce
bradleyfalzon/sha1affected
globals.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/docker/engine-api/client\"\n)\n\nfunc main() {\n\tcli, err := client.NewEnvClient()\n\tquitOnErr(err)\n\tver, err := cli.ServerVersion(context.Background())\n\tquitO...
go
edit
0
2
apache-2.0
0b90959c5c6885661652c90ac1a51570455fff88
alexbrand/dockerception,alexbrand/dockerception
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage schedule\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n)\n\nfunc RandomSchedule(min, max) {\n\tfmt.Println(\"Start random scheduler\")\n\n\t// representation of the past 365 days\n\t// for each day\n\t// get random value between --min and --...
go
edit
12
2
mit
221ed6a68378751c17935a5bc9c7c66770dfeedb
0xfoo/punchcard
schedule/random.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tests\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"github.com/xrash/smetrics\"\n)\n\nfunc TestHamming(t *testing.T) {\n\tcases := []hammingcase{\n\t\t{\"a\", \"a\", 0},\n\t\t{\"a\", \"b\", 1},\n\t\t{\"AAAA\", \"AABB\", 2},\n\t\t{\"BAAA\",...
go
edit
3
4
mit
c56542adca38e4f51055c08dc741d5a48b657c9f
xrash/smetrics
tests/hamming_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha1\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"time\"\n)\n\ntype ICEAuthServer struct {\n\tURLs []string `json:\"urls\"`\n\tUsername string `json:\"username,omitempty\"`\n\tCred...
go
edit
12
2
mit
f1e1e65d69158ebf3b693e786465ce81de973965
jeremija/peer-calls,jeremija/peer-calls,jeremija/peer-calls
server/iceauth.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dense\n\ntype nonZerosCursor struct {\n\tmatrix *denseMatrix\n\telement float64\n\trow int\n\tcolumn int\n\tindex int\n}\n\nfunc newNonZerosCursor(matrix *denseMatrix) *nonZerosCursor {\n\tc := &nonZerosCursor{\n\t\tmatrix: mat...
go
edit
3
3
mit
ebfa97d9f40f13b58d0754beb59769e145029bf6
mitsuse/matrix-go
dense/non_zeros.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sentry\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"runtime/debug\"\n\n\t\"github.com/getsentry/raven-go\"\n\t\"github.com/gin-gonic/gin\"\n)\n\nfunc Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {\n\n\tr...
go
edit
9
4
mit
fb4f186e8dbbc88874b3e12bf75e9e6382daa70d
gin-contrib/cache,gin-contrib/cache
sentry/recovery.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n \"regexp\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n re := regexp.MustCompile(\"[^/]+.rpm\")\n\n for true {\n line, _ ...
go
edit
0
3
mit
85f6727f5bb924ec350f00d6e91e89c821ea5ee9
yevmel/squid-rpm-cache,yevmel/squid-rpm-cache
store_id_program/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage irc\n\nimport \"net\"\nimport \"fmt\"\nimport \"bufio\"\n\ntype Client struct {\n\tsocket net.Conn\n\n\tHost string\n\tPort int\n\tNickname string\n\tIdent string\n\tRealname string\n\n\tHandler EventHandler\n}\n\nfunc (c *Cl...
go
edit
6
4
mit
95fa6083f22c4549ca87d5c81f5e4575a3d37f79
cjoudrey/irc
client.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage slave\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aaronang/cong-the-ripper/lib\"\n)\n\nfunc (s *Slave) addTask(task lib.Task) {\n\ttaskStatus := lib.TaskStatus{\n\t\tId: task.ID,\n\t\tJobId: task.JobID,\n\t\tStatus: lib.Running,...
go
edit
9
3
mit
f2e5b570d93253ff9e122c28fdd3e1f21a93a4aa
aaronang/cong-the-ripper,aaronang/cong-the-ripper
slave/slave_channels.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main \n\nimport (\n \"net/http\"\n \"io/ioutil\"\n \"os\"\n)\n\n\nfunc saveHandler(w http.ResponseWriter, r *http.Request) {\n\tfolder := \"/PRODUCTION/EXPERIMENT/web/savedfiles/\"\n filename := generateRandomURL()\n path...
go
edit
0
3
mit
2fd313d1163cafb64f9a44eb63c367ade8f2a36a
elifkus/very-simple-service,elifkus/very-simple-service,elifkus/very-simple-service
src/webservice/server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2014 The Dename Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// \thttp://ww...
go
edit
3
4
apache-2.0
9d1092e4dac008473a0e0397711900630d5095c6
andres-erbsen/dename,andres-erbsen/dename,andres-erbsen/dename
utils/mkkey/mkkey.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/howeyc/fsnotify\"\n\t\"path\"\n)\n\ntype Cmd struct {\n\tPath string\n\tEventType string\n\tEventFile string\n}\n\nfunc Manage(events chan *fsnotify.FileEvent, rules []*Rule) (queue chan *Cmd) {\n\t...
go
edit
9
5
mit
83c0110ce1b62654fed3288ed6ceb6ab22e0e0ef
mrnugget/watchgopher,mrnugget/watchgopher,mrnugget/watchgopher
manage.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage json\n\nimport (\n\tjson \"github.com/bitly/go-simplejson\"\n)\n\n// Gets the JSON\n//\n// This method would panic if the JSON cannot be marshalled\nfunc MarshalJSON(jsonContent *json.Json) string {\n\tjsonByte, err := jsonContent.Encod...
go
edit
30
2
apache-2.0
8300aa5ed79b8de3e74036fa78ec867d2270dc49
masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open...
common/json/simplejson.go
rejected_lint
Too many lint violations: 30
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 strings\n\n// reverseBytes reverse elements of a[s:e] in a.\nfunc...
go
edit
0
3
mit
fa56a8d684ce6563125be018252f7d667ff227b3
mrekucci/epi,mrekucci/epi
strings/reversewords.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage smoke\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/pivotal-cf-experimental/cf-test-helpers/cf\"\n\t. \"github.com/pivotal-cf-experimental/cf-test-helpers/generator\"\n\t. \"github.com/vit...
go
edit
30
1
apache-2.0
fcef190144983e4918a93e3f4fe510f0ca54495d
joek/cf-smoke-tests,joek/cf-smoke-tests,joek/cf-smoke-tests,cloudfoundry/cf-smoke-tests,cloudfoundry/cf-smoke-tests,joek/cf-smoke-tests,cloudfoundry/cf-smoke-tests,cloudfoundry/cf-smoke-tests
smoke/loggregator_test.go
rejected_lint
Too many lint violations: 30
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//Command to run test version:\n//goapp serve app.yaml\n//Command to deploy/update application:\n//goapp deploy -application golangnode0 -version 0\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc helloWorld(w http.ResponseWrit...
go
edit
0
1
mit
c747264967d63f8413a2920f5de03ed0b39b842a
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 \"testing\"\n\nfunc TestCRC16(t *testing.T) {\n\tdata := []byte{72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100}\n\n\tvar expected uint16 = 39210\n\tvar actual uint16 = CRC16(data)\n\n\tif actual != expected {\n\t\tt.F...
go
edit
24
1
mit
b1edd577b332cb507a13b76aa5d7ddfccbede7be
Omegaice/go-xmodem
xmodem/xmodem_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage service\n\nimport (\n\tv1alpha1 \"github.com/jetstack/navigator/pkg/apis/navigator/v1alpha1\"\n\t\"github.com/jetstack/navigator/pkg/controllers/cassandra/util\"\n\tapiv1 \"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/m...
go
edit
0
1
apache-2.0
61944bbfbef9b13280c1f07076e9acbef06aec90
jetstack/navigator,jetstack/navigator
pkg/controllers/cassandra/service/resource.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage linkedql\n\nimport \"github.com/cayleygraph/quad\"\n\nimport \"github.com/cayleygraph/quad/voc\"\n\n// EntityIdentifier is an interface to be used where a single entity identifier is expected.\ntype EntityIdentifier interface {\n\tBuild...
go
edit
6
2
apache-2.0
13683b01aba346cdf5952bd99f4ce5b86a1e8689
cayleygraph/cayley,cayleygraph/cayley
query/linkedql/entity_identfier.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//Copyright 2016 lyobzik\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://www.apache.org/licens...
go
edit
0
2
apache-2.0
f08a1f003e06cdd5cfebb40d235d0f8703672a2f
lyobzik/go-utils
stopper.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/fubarhouse/golang-drush/make\"\n\t\"os\"\n)\n\nfunc main() {\n\n\t// TODO Finish this for Solr 3,4,5,6.\n\n\tvar Address = flag.String(\"address\", \"htt...
go
edit
null
null
mit
50148e84024a630f1b3acb5efa842fbb508f700c
fubarhouse/golang-drush
cmd/yoink-solr-destroy/main.go
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```go\npackage Publish\n\nimport (\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestShare(t *testing.T) {\n\tscheduler := NewGoroutine()\n\tch := make(chan int, 30)\n\ts := FromChanInt(ch).Publish()....
go
edit
12
2
mit
25409d89b8e34f8bf50777e2698449669972afdc
ReactiveGo/rx
test/Publish/testing_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage daemon\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/container\"\n\t\"github.com/docker/docker/libcontainerd\"\n)\n\n// platformConstructExitStatus returns a platform specific exit status structure\nfunc platformConstructExitSt...
go
edit
3
5
apache-2.0
2266e7f2345c88a8e195fd959550d0d657bec843
denverdino/denverdino.github.io,rillig/docker.github.io,yummypeng/docker,amatsus/docker,jongiddy/docker,x1022as/docker,ibuildthecloud/docker,gnailuy/docker,gdevillele/docker.github.io,YuPengZTE/docker,bdwill/docker.github.io,rhatdan/docker,eskaaren/docker,flavio/docker,londoncalling/docker.github.io,dongjoon-hyun/docke...
daemon/monitor_windows.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype AliveRequest struct {\n\tDeviceID string `json:\"device_id\"`\n\tTimeout int32 `json:\"timeout\"`\n}\n\ntype DeviceTimer stru...
go
edit
3
2
mit
8a36ce8d736bbd3465f7da937cb574d9f5cb5195
aliveim/aliveim-service
aliveim.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/miekg/dns\"\n)\n\nconst (\n\tQUERY_TYPE_NONE = iota\n\tQUERY_TYPE_IPV4\n\tQUERY_TYPE_IPV6\n)\n\ntype Handler struct {\n\tresolver *Resolver\n\tforwarder *Forwarder\n}\n\nfunc NewHandler() *...
go
edit
18
4
mit
f88146b0981d2ff11397d70cd352a0e86994d8b0
codebear4/dnsforwarder,codebear4/dnsforwarder
handler.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage clienttest\n\nimport (\n\tcheck \"gopkg.in/check.v1\"\n\n\t\"github.com/radanalyticsio/oshinko-cli/rest/version\"\n)\n\nfunc (s *OshinkoRestTestSuite) TestServerInfo(c *check.C) {\n\tresp, _ := s.cli.Server.GetServerInfo(nil)\n\n\texpec...
go
edit
3
1
apache-2.0
02e6448771c5e68e31794460c0aa6bd96866a981
tmckayus/oshinko-cli,tmckayus/oshinko-cli,tmckayus/oshinko-cli,radanalyticsio/oshinko-cli,radanalyticsio/oshinko-cli,radanalyticsio/oshinko-cli,crobby/oshinko-cli,crobby/oshinko-cli,crobby/oshinko-cli
rest/tests/client/server_client_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage symbol\n\nimport \"testing\"\n\nfunc TestInfo(t *testing.T) {\n\tif Info() == \"ℹ \" {\n\t\tt.Fatalf(\"Symbol must be\", \"ℹ \")\n\t}\n}\n\nfunc TestSuccess(t *testing.T) {\n\tif Success() == \"✔ \" {\n\t\tt.Fatalf(\"Symbol must be\", \...
go
edit
33
2
mit
94aa796d548c8d278b57d86fffa23d924ce0e3dc
shamsher31/gosymbol
symbol_test.go
rejected_lint
Too many lint violations: 33
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"flag\"\n\n\t\"github.com/asim/go-micro/registry\"\n\t\"github.com/asim/go-micro/server\"\n\t\"github.com/asim/go-micro/store\"\n)\n\nvar (\n\tflagBindAddress string\n\tflagRegistry string\n\tflagStore strin...
go
edit
0
4
apache-2.0
87e2edbeb53fc836394ded966a66477f6c93836d
kgrvamsi/go-micro,myodc/go-micro,micro/go-micro,Taik/go-micro,uffy/go-micro,gpavlidi/go-micro,jmptrader/go-micro,divisionone/go-micro,iheitlager/go-micro
cmd/cmd.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage uniq_chars\n\nimport \"fmt\"\n\nfunc IsAllUniqueChars (strings ...string) bool {\n\t//Save Time\n\tfmt.Println(strings)\n\n\t//Iterate all runes and keep track of each we've seen O(n)\n\t//MAP {runeVal: seen before}\n\tcharCounts := mak...
go
edit
0
8
mit
ab80c2756feac430657fbe66be59777662b8e775
philosoralphter/ToyProblems,philosoralphter/ToyProblems
problems/uniqueChars/go/isAllUniqueChars.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage schedule\n\nimport (\n\t\"time\"\n)\n\nconst (\n\tCOMMIT_MESSAGE_BASE = \"commit_message_base.txt\"\n)\n\ntype Commit struct {\n\tdateTime time.Time\n\tmessage string\n}\n\n```\n\nApply this change: Add separator for commit message bas...
go
edit
0
0
mit
29314247fec4b062e54c397fd3001b65f2388f57
0xfoo/punchcard
schedule/commits.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\"jogurto/commands\"\n)\n\nfunc main() {\n\tvar options string\n\tvar packages []string\n\tif len(os.Args) < 2 {\n\t\tfmt.Printf(\"%s: A yaourt-like interface and toolkit for Debian.\", os.Args[0...
go
edit
0
4
cc0-1.0
c2eb972b432698610958c400ec84faa20de1c016
LaPingvino/jogurto
jogurto.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage rewriters\n\nimport (\n\t\"testing\"\n)\n\ntype testPair struct {\n\tX int\n\tY int\n}\n\nfunc TestReflect(t *testing.T) {\n\ttest := testPair{\n\t\tX: 1,\n\t\tY: 2,\n\t}\n\n\tif x, y := Reflect().Rewrite(test.X, test.Y); x != test.X ||...
go
edit
12
3
mit
529e1600861311d576fa2d491d75a7d46fa894d0
jmptrader/matrix-go,mitsuse/matrix-go
rewriters/rewriters_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage faker\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n)\n\nfunc getRandValueInRange(rangeSize int, epsilon float64) float64 {\n\trand.Seed(time.Now().UTC().UnixNano())\n\n\tminDataWithError := rand.Float64()*float64(rangeSize) - epsilon\n\tma...
go
edit
0
1
mit
c6747787ca1ddef2b935361f120799392942fff5
mingrammer/go-codelab
faker/generator.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage core\n\nimport (\n \"errors\"\n \"fmt\"\n \"image\"\n \"image/png\"\n \"io\"\n \"os\"\n \"os/exec\"\n)\n\ntype PNGHandler struct {\n}\n\nfunc (p *PNGHandler) ImageType() string {\n return \"image/png\"\n}\n\nfunc...
go
edit
0
4
mit
dc82776bd491a846cb0324f97f8e3943ba5f9f63
lotrekagency/piuma,lotrekagency/piuma
core/image_png.go
rejected_duplicate
Near-duplicate of sample 117593
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nRestful api for communicating with mobile app.\n*/\npackage api\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/gorilla/mux\"\n\t\"net/http\"\n)\n\nfunc (webapp *WebApp) BindRoute() {\n\t// 按名字bind/按照资源划分... 这个以后改\n\twebapp.Router.HandleF...
go
edit
3
1
mit
770c6bbb9f64ae66039d26c5b3f0b3f8b60c17a0
tsinghua-io/api-server
api/api.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage facebook\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGet(t *testing.T) {\n\tfor _, url := range urls {\n\t\tt.Logf(\"Fetching Facebook object from %s url.\\n\", url)\n\t\tresp, err := Get(url)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Error:...
go
edit
6
5
mit
082eebcd0aadd40a3781fd4bd6ad836fa4692df0
mattn/go-facebook
facebook/response_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nconst none = 0 // same const identifie...
go
edit
6
0
bsd-3-clause
ed1eb770f0ec882af805b452c904f29db6050110
npe9/noahevans-go9,webfd/go-zh,npe9/noahevans-go9,npe9/noahevans-go9,scirelli/scirelli-go,webfd/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,bryanxu/go-zh,bryanxu/go-zh,d0f/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh,scirelli/s...
test/bugs/bug126.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\"os\"\n\t\"os/exec\"\n)\n\n// docker runs docker command\nfunc docker(args ...string) error {\n\tcmd := exec.Command(\"docker\", args...)\n\tcmd.Stderr = os.Stdout // ioutil.Discard\n\tcmd.Stdout = os.Stdout // iout...
go
edit
0
3
mit
d1d539ace25af16f5ab78e324b70aa6b837f01ab
tcnksm/cf-plugin-local-push,tcnksm/cf-plugin-local-push
docker.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage httpfake\n\nimport \"net/http\"\n\n// Response stores the settings defined by the request handler\n// of how it will respond the request back\ntype Response struct {\n\tStatusCode int\n\tBodyBuffer []byte\n\tHeader http.Header\n}\n\...
go
edit
3
2
mit
f99cc39052624c88fbcdf6d2d5a89d4416eff6fe
maxcnunes/httpfake
response.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage bucket\n/*\n * Filename: bucket.go\n * Package: bucket\n * Author: Bryan Matsuo <<EMAIL>>\n * Created: Sat Jul 30 19:48:17 PDT 2011\n * Description: \n */\nimport ()\n\ntype Elem struct {\n id int\n Value i...
go
edit
0
4
bsd-2-clause
a12a8dcf70a3c544e5706ce3b9b98b84470ef5c3
bmatsuo/container
bucket/bucket.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/msiebuhr/go-tag-test\"\n)\n\nfunc main() {\n\tfmt.Println(TagTest.Tag())\n}\n\n```\n\nApply this change: Include pre-made import statements in the test program." }, { "role": "assistan...
go
edit
3
1
bsd-2-clause
f9b7a631f2c745591d003917737747c635a28f2c
msiebuhr/go-tag-test
TestProgram/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Marcel Gotsch. 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 goserv\n\ntype Context struct {\n\tstore storage\n}\n\nfunc (c *Context) ...
go
edit
0
2
bsd-3-clause
0818fd8716af45da3c026c01bff667bcbc439e77
gotschmarcel/goserv
context.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os/exec\"\n\n\t\"github.com/mikepea/go-jira-ui\"\n)\n\nfunc resetTTY() {\n\tcmd := exec.Command(\"reset\")\n\t_ = cmd.Run()\n}\n\nfunc main() {\n\tdefer resetTTY()\n\tjiraui.Run()\n}\n\n```\n\nApply this change: Ad...
go
edit
3
1
apache-2.0
31a1efc4e81100349be820f1b06b44c60a00b8c9
mikepea/go-jira-ui
jira-ui/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/service/iam\"\n)\n\nfunc iamUserNames(users []*iam.User) []string {\n\tnames := make([]string, len(users))\n\tfor idx, u := range users {\n\t\tnames[id...
go
edit
0
2
mit
aa8b1710a950bb2f1f1751f03763a0eabeb03005
davidrjonas/ssh-iam-bridge,davidrjonas/ssh-iam-bridge
iam_users.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage middleware\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/pressly/chi\"\n\t\"golang.org/x/net/context\"\n)\n\n// 499 Client Closed Request (Nginx)\n// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\nconst StatusClientClosedReque...
go
edit
0
3
mit
ea7f7b5bbcde634a42331fd5bc43eefff490ea07
go-chi/chi,pressly/chi
middleware/closenotify.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage types\n\ntype TModalResult int32\n\ntype TColor uint32\n\ntype THelpEventData uintptr\n\ntype TTabOrder int16\n\ntype PFNLVCOMPARE uintptr\n\ntype PFNTVCOMPARE uintptr\n\ntype Integer int32\n\ntype Cardinal uint32\n\ntype Single float32...
go
edit
0
0
apache-2.0
fd1bfa53a0f5dda63b182207b59636416b220f0c
ying32/govcl
vcl/types/delphi.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage workspace\n\nimport \"path/filepath\"\n\n// Document is a file in a directory.\ntype Document struct {\n\tRoot string\n\tRelativePath string\n}\n\n// NewDocument creates a document from a relative filepath.\n// The root is typic...
go
edit
0
2
mit
60b6ed7bf8c22107e407983043adfd59c1a7e5ab
exercism/cli,exercism/cli
workspace/document.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"net\"\n \"log\"\n \"os\"\n \"os/signal\"\n \"syscall\"\n)\n\n\nfunc signalHandler(signalChannel chan os.Signal, doneChannel chan bool){\n // block the goroutine until we get a signal\n signal :=...
go
edit
0
4
mit
633bd58ca5dde4729a773cb4e057630fe3992983
djt5019/garnet
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/mistifyio/gozfs/nv\"\n)\n\nfunc snapshot(zpool string, snapNames []string, props map[string]string) (map[string]int32, error) {\n\t// snaps needs to be a map with the snap name as the ke...
go
edit
3
5
mit
09ba5667a443723fb551918ed992462488cca7ff
cerana/cerana,cerana/cerana,cerana/cerana,mistifyio/gozfs,cerana/cerana,mistifyio/gozfs,mistifyio/gozfs
snapshot.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package config provides configuration primitives for Overlord\npackage config\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// DataDir returns the path to the Overlord data directory\nfunc DataDir() (string, error) {\n\tdata, valid := os....
go
edit
0
8
mit
ea0ee41d7ac926e160eeac5410a0cd4a2a7ea9d3
nirenjan/overlord
internal/config/config.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage structmapper\n\nimport \"github.com/hashicorp/go-multierror\"\n\n// Mapper provides the mapping logic\ntype Mapper struct {\n\ttagName string\n}\n\n// ToStruct takes a source map[string]interface{} and maps its values onto a target stru...
go
edit
0
6
mit
a265d3c2f5eccd509c52e8c25048c8762161e82b
anexia-it/go-structmapper,anexia-it/go-structmapper
mapper.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2019 Google LLC\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://www.apac...
go
edit
0
0
apache-2.0
534090a5aedbfe3f9e7d92b2a85607063627eb98
GoogleCloudPlatform/healthcare-federated-access-services,GoogleCloudPlatform/healthcare-federated-access-services,GoogleCloudPlatform/healthcare-federated-access-services,GoogleCloudPlatform/healthcare-federated-access-services
lib/globalflags/globalflags.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t. \"launchpad.net/gocheck\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype MonitorSuite struct {\n\tzones Zones\n}\n\nvar _ = Suite(&MonitorSuite{})\n\nfunc (s *MonitorSuite) SetUpS...
go
edit
39
1
apache-2.0
3a3c0425eaacb1785d746ec8f2f41f128b69811c
anuaimi/geodns,abligh/geodns,anuaimi/geodns,abh/geodns,gofort/geodns,abligh/geodns,gofort/geodns,gofort/geodns,abligh/geodns,abh/geodns,anuaimi/geodns
monitor_test.go
rejected_lint
Too many lint violations: 39
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage meta\n\n// Application contains third party application specific data.\n//\n// ref: https://www.xiph.org/flac/format.html#metadata_block_application\ntype Application struct {\n\t// Registered application ID.\n\t//\n\t// ref: https://ww...
go
edit
0
2
unlicense
25cfda55014438e50ae38237841d12a9bb112852
mewkiz/flac
meta/application.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015 Andrew E. Bruno. 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 gofasta\n\nimport (\n \"strings\"\n \"os\"\n \"bufio\"\n \"...
go
edit
0
7
mit
e776ef625791e00d327f7eb8fcb6ebe537c769cc
aebruno/gofasta
fasta.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage emperror\n\n// TestHandler throws every error away.\ntype TestHandler struct {\n\terrors []error\n}\n\n// NewTestHandler returns a new TestHandler.\nfunc NewTestHandler() Handler {\n\treturn &TestHandler{}\n}\n\n// Handle does the actua...
go
edit
0
2
mit
5508d1964ed91282c2c08621b70aef00ae8af1f9
goph/emperror,goph/emperror
testing.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"html/template\"\n\t\"os\"\n\t\"time\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\ntype Sms struct {\n\tID int\n\tTimestamp time.Time\...
go
edit
0
6
mit
3955c1ff2d1bc753f4294ad5f9ca5f32de69e454
Xiol/smslogger,Xiol/smslogger,Xiol/smslogger
db.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\n// #cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files\n// #include <mini-os/experimental.h>\nimport \"C\"\nimport \"fmt\"\n\n//go:cgo_import_static test\n//go:linkname test test\nvar test byte\n\nfunc main() {}\n\n//e...
go
edit
3
1
bsd-2-clause
a647f7af6d4e3eac9fe85e6f6532e48ef60127f8
unigornel/unigornel,unigornel/unigornel
integration_tests/go/src/call_c_from_go/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 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.org/l...
go
edit
0
0
apache-2.0
7511061861861b17894ac49289e8df209b7ba465
li-ang/client-go,kubernetes/client-go
informers/internalinterfaces/factory_interfaces.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage widget\n\nvar funcMap = map[string]interface{}{\n\t\"widget_available_scopes\": func() (results []string) {\n\t\tfor _, scope := range registeredScopes {\n\t\t\tresults = append(results, scope.Name)\n\t\t}\n\t\treturn\n\t},\n}\n\n```\n\...
go
edit
6
3
mit
3b6a00613592a2e6bf06dee4815b6390b2569847
qor/widget,qor/widget
func_map.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage solver\n\nimport \"cryptics/utils\"\n\ntype transform func(string, int) map[string][]string\n\nvar TRANSFORMS = map[int]transform{\n\tLIT: func(x string, l int) map[string][]string {\n\t\treturn map[string][]string{x: []string{}}\n\t},\...
go
edit
12
4
mit
01fcd5cc5310c595f0adc05c47a9d38e3b28dae8
rdeits/cryptics,rdeits/cryptics,rdeits/cryptics,rdeits/cryptics,rdeits/cryptics,rdeits/cryptics,rdeits/cryptics
go/src/cryptics/solver/transforms.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\"crypto/tls\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\taddr := flag.String(\"addr\", \":4000\", \"HTTPS network address\")\n\tcertFile := flag.String(\"certfile\", \"cert.pem\", \"cer...
go
edit
0
3
unlicense
6f6068d58385c0185c8a45bffc93ea7ea5d404bb
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/go-rest-servers/auth/basic-sample/tls-basic-auth.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage bbolt\n\nimport \"unsafe\"\n\n// maxMapSize represents the largest mmap size supported by Bolt.\nconst maxMapSize = 0x7FFFFFFF // 2GB\n\n// maxAllocSize is the size used when creating array pointers.\nconst maxAllocSize = 0xFFFFFFF\n\n`...
go
edit
0
0
mit
52871c4623f30e415a6b78c1bd6e441ce608e63b
etcd-io/bbolt
bolt_arm.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage device\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestParse(t *testing.T) {\n\tt.Run(\"46540=>46.54\", parseSuccess(\"46540\", \"46.54\"))\n\tt.Run(\"-46540=>-46.54\", parseSuccess(\"-46540\", \"-4...
go
edit
6
2
mit
ac577eff0f5b3329434d45478305867be42c194d
andreandradecosta/rpimonitor,andreandradecosta/rpimonitor
device/parse_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage beam\n\ntype Verb uint32\n\nconst (\n\tAck Verb = iota\n\tAttach\n\tConnect\n\tError\n\tFile\n\tGet\n\tLog\n\tLs\n\tSet\n\tSpawn\n\tStart\n\tStop\n\tWatch\n)\n\n```\n\nApply this change: Add string representation of verb enum\n\nDocker-...
go
edit
0
14
apache-2.0
878e88e777419ad5bd69ba537c062df7db26a7d4
dmcgowan/libchan,docker/libchan,wangtuanjie/libchan,beni55/libchan
verbs.go
rejected_complexity
Cyclomatic complexity too high: 14
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mislav/everyenv/cli\"\n\t_ \"github.com/mislav/everyenv/commands\"\n\t\"os\"\n)\n\nfunc main() {\n\tcmdName := os.Args[1]\n\tcmd := cli.Lookup(cmdName)\n\n\tif cmd != nil {\n\t\tcmd(os.Args[2:...
go
edit
0
2
mit
7e044fa6f007634cdfb1c3119d103af7755051ca
mislav/anyenv
everyenv.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport \"testing\"\n\nfunc TestResponse(t *testing.T) {\n\n}\n\n```\n\nApply this change: Rename dummy missionary test in order to avoid collision" }, { "role": "assistant", "content": "package server\n\nimport \"t...
go
edit
0
1
mit
c876f56737c5db4e0565a11ae244ebc029e721bb
WarCluster/warcluster-server,WarCluster/warcluster-server
server/missionary_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage billing\n\nimport (\n\t\"io\"\n\n\t\"github.com/BytemarkHosting/bytemark-client/lib/output\"\n\t\"github.com/BytemarkHosting/bytemark-client/lib/output/prettyprint\"\n)\n\n// Definition is an admin-modifiable parameter for bmbilling\n//...
go
edit
0
1
mit
6fc6051df671c52e0aeec24a96dbe2570e3af9cc
BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client
lib/billing/definition.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage grpc_prometheus\n\nimport (\n\tprom \"github.com/prometheus/client_golang/prometheus\"\n)\n\ntype CounterOption func(opts *prom.CounterOpts)\n\ntype counterOptions []CounterOption\n\nfunc (co counterOptions) apply(o prom.CounterOpts) pr...
go
edit
0
2
apache-2.0
c03e2acb2433bee5a403efbfcc6e576c64458f74
grpc-ecosystem/go-grpc-prometheus,mwitkow/go-grpc-prometheus,grpc-ecosystem/go-grpc-prometheus
metric_options.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage npc\n\nimport (\n\t\"encoding/json\"\n)\n\nfunc js(v interface{}) string {\n\ta, _ := json.Marshal(v)\n\treturn string(a)\n}\n\n```\n\nApply this change: Trim the JSON logged for Kubernetes objects by weave-npc\n\nRemove things like \"a...
go
edit
0
4
apache-2.0
0205adcedb596312a68eb796e0ecd57e42b5bf75
weaveworks/weave,weaveworks/weave,weaveworks/weave,weaveworks/weave
npc/json.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage falcore\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestHandlerFilter(t *testing.T) {\n\treply := \"Hello, World\"\n\thandler := func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintf(w, re...
go
edit
6
4
mit
e8c10476269fce8903785a1e93db0fd5b8f06c9e
ngmoco/falcore,dgrijalva/falcore,fitstar/falcore,fitstar/falcore
handler_filter_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage nessusExporter\n\nimport (\n\t\"database/sql\"\n\t\"github.com/kkirsche/nessusControl/api\"\n\t\"net/http\"\n)\n\n// NewExporter returns a new exporter instance for use in exporting scan results\nfunc NewExporter(apiClient *nessusAPI.Cl...
go
edit
12
1
apache-2.0
c430095037bfc8bf4bb377c34d938745f4879b55
kkirsche/nessusControl
exporter/newExporter.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build go1.16\n\npackage compiler\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n)\n\n// Version is the GopherJS compiler version string.\nconst Version = \"1.16.1+go1.16.3\"\n\n// GoVersi...
go
edit
0
5
bsd-2-clause
57c13b6cee64250e4b101f91d357f5b5b9ad3ce5
gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs
compiler/version_check.go
rejected_duplicate
Near-duplicate of sample 117155
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"log\"\n\nfunc main() {\n\tlog.Println(\"Starting 'nginx-requests-stats' app...\")\n}\n\n```\n\nApply this change: Set the version of the application to 0.1.0 - Expose the /version endpoint" }, { "role": "assista...
go
edit
0
1
mit
b680c822da75b460d18af343f0ec1ba668ce5065
jvrplmlmn/nginx-requests-stats
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage next\n\nimport (\n\t\"time\"\n)\n\n// Minute returns a time.Time referencing the beginning of the next minute\nfunc Minute(t time.Time) time.Time {\n\treturn t.Add(time.Minute).Truncate(time.Minute)\n}\n\n// Hour returns a time.Time ref...
go
edit
0
1
apache-2.0
d5f261bf4aa0d589cce6d27662b9a313845600f8
billhathaway/next
next.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/cloudfoundry/bosh-utils/davcli/app\"\n\t\"github.com/cloudfoundry/bosh-utils/davcli/cmd\"\n)\n\nfunc main() {\n\tcmdFactory := cmd.NewFactory()\n\n\tcmdRunner := cmd.NewRunner(cmdF...
go
edit
0
2
apache-2.0
1ca0f385adcae2a235a968503441f4ff916b944e
cloudfoundry/bosh-davcli,cloudfoundry/bosh-davcli
main/dav.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage file\n\nimport \"github.com/vektra/cypress\"\nimport \"path/filepath\"\n\ntype Plugin struct {\n\tPaths []string\n\tOffsetDB string\n}\n\nfunc (p *Plugin) Generator() (cypress.Generator, error) {\n\tm := NewMonitor()\n\n\tvar files [...
go
edit
3
6
bsd-3-clause
9cdd504d27b979d4652bfc4e04dbd38915bb7468
vektra/cypress,vektra/cypress
plugins/file/plugin.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build linux\n\npackage netlink\n\nimport (\n\t\"testing\"\n\n\t\"github.com/vishvananda/netlink/nl\"\n)\n\nfunc TestXfrmMonitorExpire(t *testing.T) {\n\tdefer setUpNetlinkTest(t)()\n\n\tch := make(chan XfrmMsg)\n\tdone := make(chan struct{}...
go
edit
15
11
apache-2.0
48a75e0e38d60624571389bf95b0a2a16f5b4245
paravmellanox/netlink,vishvananda/netlink
xfrm_monitor_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/alessio/xkcdfind/xkcd\"\n)\n\nfunc printResults(results []xkcd.Comic) {\n\tfor _, comic := range results {\n\t\tfmt.Printf(\"%4d %-40s %s\\n\", comic.Num, co...
go
edit
0
4
isc
15cc1e5fcebac5dfc5f94e3733dccd357867d0eb
alessio/xkcdfind
xkcdfind.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/jinzhu/gorm\"\n)\n\nvar dbPath = \"./test.db\"\nvar db *gorm.DB\n\nfunc TestMain(m *testing.M) {\n\trmDB()\n\tmkDB()\n\trun := m.Run()\n\trmDB()\n\tos.Exit(run)\n}\n\nfunc mkD...
go
edit
3
2
mit
ddc4ea3ebbefe6b2ae925362899c66fc62e372e9
hoop33/limo
model/db_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage yara\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestMain(m *testing.M) {\n\tif r, err := Compile(`rule test : tag1 { meta: author = \"Hilko Bengen\" strings: $a = \"abc\" fullword condition: $a }`, nil); err != nil {\n\t\tos.Exit(1...
go
edit
3
4
bsd-2-clause
3391bf9d7610a1cb389e0d4023768fe0ada5d5ed
VirusTotal/go-yara,hillu/go-yara,hillu/go-yara
main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2014, Rogue Ethic, Inc.\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
mit
5bcf8ce88c248aee8a2271b1d91e5e024a71f544
christianvozar/itunes-hipchat-status
version.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"fmt\"\n\t\"log\"\n\n\t\"github.com/libgit2/git2go\"\n)\n\nfunc main() {\n\n var cloneOptions git.CloneOptions\n cloneOptions.Bare = true\n\n if _, err := git.Clone(\"https://github.com/rollbrettler/go-playgrou...
go
edit
6
3
mit
3546ca06a8e2311bf5f0b017da79aabf04894901
rollbrettler/go-playground
_draft/git-mirror.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage text\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/morikuni/preview\"\n)\n\n// PreviewTxt print text file.\nfunc PreviewTxt(path string, out io.Writer, conf *preview.Config) error {\n\tf...
go
edit
0
9
mit
ac467a512263bd37f965fdf4989c443c4cf14de7
morikuni/preview
text/txt.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cdp\n\nimport (\n\t\"github.com/mafredri/cdp/rpcc\"\n)\n\ntype eventClient interface {\n\trpcc.Stream\n}\n\n// Sync takes two or more event clients and sets them into synchronous operation,\n// relative to each other. This operation can...
go
edit
0
3
mit
95bf065037f2d6ebf7fe59e15361d1e3f4c4ff9e
mafredri/cdp,mafredri/cdp
sync.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage generate;\n\nimport (\n\t\"testing\"\n\t\"unicode/utf8\"\n\t\n\t\"github.com/ejcx/passgo/generate\"\n)\n\nvar generateTests = []struct {\n n int // input\n expected int // expected result\n}{\n {0, 24},\n {-1, 24},...
go
edit
0
3
mit
42168d8e25e0ebc3e1ba9a89ea5326d422d3c60e
ejcx/passgo,nicr9/passgo
generate/generate_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage auth\n\nimport (\n\t\"crypto/sha256\"\n\t\"crypto/subtle\"\n)\n\n// SecureCompare performs a constant time compare of two strings to limit timing attacks.\nfunc SecureCompare(given string, actual string) bool {\n\tgivenSha := sha256.Sum...
go
edit
0
1
mit
a3686ce037f5514dc9a7394525c63bd6f3ee4ce3
go-macaron/auth
util.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage channel\n\nimport (\n\t\"testing\"\n\n\t\"github.com/emreler/finch/models\"\n)\n\nfunc TestNotify(t *testing.T) {\n\th := &HTTPChannel{}\n\n\tstatusCode, err := h.Notify(&models.Alert{URL: \"https://google.com/\", Method: methodGet})\n\...
go
edit
6
2
mit
3a6432de5021ff422eed5b40bac493a0d3bdd0c5
emreler/finch,emreler/finch
channel/http_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage generator\n\nimport (\n\tuuid \"github.com/nu7hatch/gouuid\"\n)\n\nfunc RandomName() string {\n\tguid, err := uuid.NewV4()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn \"CATS-APP-\" + guid.String()\n}\n\n```\n\nApply this change:...
go
edit
0
2
apache-2.0
6eb40501259e9b6bb784328189202b5e32c4b9c3
cloudfoundry-incubator/cf-test-helpers,cloudfoundry-incubator/cf-test-helpers
generator/random_name.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage blenc\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc allKG(f func(kg KeyGenerator)) {\n\n\tfunc() {\n\t\tf(constantKey(\"testkey\"))\n\t}()\n\n}\n\nfunc TestEqualData(t *testing.T) {\n\tfor _, data := range []string...
go
edit
15
2
apache-2.0
9df9f81c3b9451258424eef8fc86fe5953b4adc1
cinode/go
blenc/keygenerator_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cc_messages\n\ntype LRPInstanceState string\n\nconst (\n\tLRPInstanceStateStarting LRPInstanceState = \"STARTING\"\n\tLRPInstanceStateRunning LRPInstanceState = \"RUNNING\"\n\tLRPInstanceStateFlapping LRPInstanceState = \"FLAPPING\"\n\...
go
edit
0
0
apache-2.0
728bfe557ee7fabf5ed8ba067555dfe7e1c52f24
cloudfoundry-incubator/runtime-schema
cc_messages/lrp_instance.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/cloudfoundry/libbuildpack/cutlass\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"CF PHP Buildpack\",...
go
edit
36
1
apache-2.0
cb594256caa3cf3556dcf1af623ae2c46ae8a289
cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cloudfoundry/php-buildpack,cf-identity/php-buildpack,cloudfoundry/php-buildpack,cf-identity/php-buildpack,cf-identity/php-buildpack,cf-identity/php-buildpack,cloudfoundry/php-buildpack,cf-identity/php-buildpack,cf-identity/php-buildpack,cl...
src/php/integration/deploy_a_php_app_with_phpredis_test.go
rejected_lint
Too many lint violations: 36
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2013 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 akaros\n\npackage parlib\n\n/*\n#include <parlib.h>\n#include <uthre...
go
edit
6
4
bsd-3-clause
18e7e70ecc692ddb6ea481b1aac0835bb288d596
klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros,klueska/go-akaros
src/pkg/runtime/parlib/funcs.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage env\n\nimport \"fmt\"\n\nfunc FlattenArguments(argMap map[string]string) []string {\n\targs := []string{}\n\n\tfor flag, value := range argMap {\n\t\targument := fmt.Sprintf(fmt.Sprintf(\"--%v=%v\", flag, value))\n\n\t\targs = append(ar...
go
edit
0
6
apache-2.0
bfe8725f3a2a2786ba666d65098948daeb236850
maxamillion/flamingo,maxamillion/flamingo,tmrts/flamingo,rtnpro/flamingo,tmrts/flamingo
src/cloud-init/env/arg.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"testing\"\n)\n\nfunc TestMain(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tdir, err := os.Getwd()\n\t...
go
edit
18
1
apache-2.0
127d51abc31132564e54280022195157879ab473
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
main/main_suite_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage aeon\n\nimport (\n\t\"github.com/ninjasphere/go-openzwave\"\n\n\t\"github.com/ninjasphere/driver-go-zwave/spi\"\n)\n\ntype multisensor struct {\n\tdriver spi.Driver\n\tnode openzwave.Node\n}\n\nfunc MultiSensorFactory(driver spi.Drive...
go
edit
21
3
mit
252244c93aab912ac3d4d967163e08b7a63f4c20
ninjasphere/driver-go-zwave,ninjasphere/driver-go-zwave
devices/aeon/multisensor.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage resources\n\nimport \"github.com/cloudfoundry/cli/cf/models\"\n\ntype PaginatedSpaceQuotaResources struct {\n\tResources []SpaceQuotaResource\n}\n\ntype SpaceQuotaResource struct {\n\tResource\n\tEntity models.SpaceQuota\n}\n\nfunc (res...
go
edit
6
1
apache-2.0
83256ccf0f5776e48499a2d4587dba8fff1c6ba0
TomG713/cli,SrinivasChilveri/cli,SrinivasChilveri/cli,carnell69/cli,saurabhguptasg/cli,TomG713/cli,simonleung8/cli,zhang-hua/cli,srikanth88infy/cli,kavoj/cli,cgvarela/cli,zhang-hua/cli,ReachingOut/cli,carnell69/cli,saravana76/cli,rastasheep/trash-can,SrinivasChilveri/cli,Zouuup/cli,fujitsu-cf/cli,mcowger/cli,Zouuup/cli...
cf/api/resources/space_quotas.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage marogo\n\nimport \"sync\"\nimport \"encoding/json\"\nimport \"net/http\"\nimport \"bytes\"\nimport \"fmt\"\n\nfunc MakeRequest(address string, method string, data interface{}) (*http.Response, error) {\n\taddress = API_URL + address\n\t...
go
edit
8
5
mit
eac91ececabdc78448716ac3393407f95d33347c
CentricWebEstate/maropostgo
generics.go
rejected_lint
Too many lint violations: 8
true