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 inmem\n\nimport (\n\t\"io\"\n\t\"fmt\"\n)\n\ntype ReceiverFrom interface {\n\tReceiveFrom(Receiver) (int, error)\n}\n\ntype SenderTo interface {\n\tSendTo(Sender) (int, error)\n}\n\nfunc Copy(dst Sender, src Receiver) (int, error) {\n\t...
go
edit
9
3
apache-2.0
1eb832dcbcf7929bfb3fbf351855c90d5f341083
gdevillele/docker.github.io,menglingwei/denverdino.github.io,jzwlqx/denverdino.github.io,polyverse-security/swarm,ezrasilvera/SwarmACLs,ezrasilvera/swarm,linecheng/swarm,pssahi/swarm,xFragger/swarm,beni55/swarm-1,gradywang/swarm,mountkin/swarm,denverdino/docker.github.io,fugr/swarm,thaJeztah/docker.github.io,rillig/doc...
inmem/copy.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\ntype From struct {\n\tImage string\n\tTag string\n\tDigest string\n}\n\ntype Maintainer struct {\n\tName string\n}\n\ntype Run struct {\n\tTokens []string\n}\n\ntype Cmd struct {\n\tTokens []string\n}\n\ntype Lable struct {\...
go
edit
0
1
mit
9fab1cef57e952f415e05c1f84e1ed3dc4f8257c
y-taka-23/voicepipe,y-taka-23/voicepipe
dockerfile.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows\n\npackage main\n\nimport (\n\t\"github.com/docker/docker/pkg/integration/checker\"\n\t\"github.com/go-check/check\"\n)\n\nfunc (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {\n\ttestRequires(c, DaemonIsLinux, memoryL...
go
edit
24
1
apache-2.0
ba19b6927fd79be4d676ff228128d72393cbf76a
lixiaobing10051267/docker,kolyshkin/moby,mikebrow/docker,jzwlqx/denverdino.github.io,jlebon/docker,PatrickLang/moby,mahak/docker,estesp/docker,bearstech/moby,sunyuan3/docker,danyalKhaliq10p/moby,docker/docker.github.io,hallyn/docker,sfsmithcha/docker,thaJeztah/docker.github.io,rhardih/docker,bdwill/docker.github.io,cyp...
integration-cli/docker_cli_oom_killed_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestNopFormatterDoesNothing(t *testing.T) {\n\tsrc := []byte{68, 68, 68}\n\tfmted, err := NopFormatter().Format(src)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !same(fmted, src) {\n\t\tt.Errorf(...
go
edit
6
4
apache-2.0
39898ea8e78dcfad8c7ec4902f8fbdd231f3cf49
Bo0mer/dp,Bo0mer/dp
format_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\"os\"\n\n\t\"golang.org/x/net/context\"\n\n\t\"github.com/BeepBoopHQ/go-slackbot\"\n\t\"github.com/nlopes/slack\"\n)\n\nfunc main() {\n\tbot := slackbot.New(os.Getenv(\"SLACK_TOKEN\"))\n\n\ttoMe := bot.Messages(slac...
go
edit
9
1
mit
0b68164f9588bb86aed0842e55bf8589a69a532a
BeepBoopHQ/go-slackbot
examples/simple/simple.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage virtualboxclient\n\ntype StorageController struct {\n\tvirtualbox *VirtualBox\n\tmanagedObjectId string\n}\n\n```\n\nApply this change: Add GetName() and GetPortCount() to StorageController" }, { "role": "assistant", "c...
go
edit
0
2
mit
fe06051ad3acc48b6d386ae0d3308765f4520027
appropriate/go-virtualboxclient
virtualboxclient/storage_controller.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage request\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc NewRequest(url, bearerToken string) (*http.Response, error) {\n\tclient := &http.Client{}\n\n\trequest, err := http.NewRequest(\"GET\", url, nil)\n\tif err !...
go
edit
0
2
mit
59ed9b2707fd5f71b3995be41e61673629361ace
alphagov/metadata-api,alphagov/metadata-api
request/request.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015, David Howden\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"log\"\n\t\"sort\"\n\t\"time\"\n)\n\ntype Notifier interface {\n\tNotify(m...
go
edit
0
4
bsd-2-clause
e05259e391d6d62afe5f166c9d05c5933b9b86d8
dhowden/ghnotify
notifier.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mc\n\nimport \"errors\"\n\nvar (\n\tErrInvalidProjectFilePath = errors.New(\"path not in project\")\n\tErrFileNotUploaded = errors.New(\"existing file not uploaded\")\n\tErrFileVersionNotUploaded = errors.New(\"existing file with...
go
edit
0
0
mit
8e54018c90eec6bf7218262ff54454c6e93415e0
materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore
cmd/pkg/mc/errors.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\n\tslackreporter \"github.com/ariarijp/horenso-reporter-slack/reporter\"\n\t\"github.com/bluele/slack\"\n)\n\nfunc main() {\n\ttoken := os.Getenv(\"SLACK_TOKEN\")\n\tgroupName := os.Getenv(\...
go
edit
0
3
mit
9392b64be713a848aa23bd9010dd2e82280a79d6
ariarijp/horenso-reporter-slack
main.go
rejected_duplicate
Near-duplicate of sample 117779
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport(\n\t\"io\"\n\t\"log\"\n\t\"net\"\n)\n\nfunc main() {\n\tlog.Print(\"Starting the server\")\n\tlistener, err := net.Listen(\"tcp\", \"127.0.0.1:8377\")\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tfor {\n\t\tco...
go
edit
0
5
bsd-2-clause
01c842bf40ca91acf82f64b7e1e665524d5fb8cf
wincent/clipper
clipper.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2013 Matthew Baird\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// http://www.apache.org...
go
edit
0
5
apache-2.0
57b5447199763a6b50195d9900f8fe70a1849f03
ramin/elastigo,weberr13/elastigo,dimroc/elastigo,zaphod-concur/elastigo,donnanicolas/elastigo,barnslig/elastigo,ramin/elastigo,otiai10/elastigo,Kaidence/elastigo,jiangjin/elastigo,origami/elastigo,splicers/elastigo,mattbaird/elastigo,sammi/elastigo,sammi/elastigo,allgeek/elastigo,sammi/elastigo,splicers/elastigo,otiai1...
indices/deleteIndex.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tclients := strings.Split(os.Getenv(\"XLANG_CLIENTS\"), \",\")\n\tservers := strings.Split(os.Getenv(\"XLANG_SERVERS\"), \",\")\n\tbehaviors := strings.Split(os.Getenv(\"...
go
edit
9
1
mit
ab0af593aef9a398ba2797af7a30cc6db7d0c7c0
crossdock/crossdock,yarpc/crossdock,yarpc/crossdock,crossdock/crossdock,yarpc/crossdock,crossdock/crossdock
main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage commons\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\t\"os\"\n)\n\ntype Manager interface {\n\tCommit() error\n\tGetSaveFilePath() (fullPath string, dirPath string, fileName string)\n\tGetConfig() interface{}\n}\n\nfunc LoadFromDB(mana...
go
edit
6
3
mit
f16a505002ae151768a0003d50374330d1a79e66
Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL
backend/commons/manager.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\"github.com/voxelbrain/pixelpixel/pixelutils\"\n\t\"time\"\n)\n\nfunc main() {\n\tc := pixelutils.PixelPusher()\n\tpixel := pixelutils.NewPixel()\n\tbigPixel := pixelutils.DimensionChanger(pixel, 5*4, 18)...
go
edit
0
3
mit
1fc2ccf786406c313426fc5da77976201d30f801
voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel
examples/clock/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 The Gosl 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 tri\n\nimport \"github.com/cpmech/gosl/plt\"\n\nfunc Draw(V [][]float6...
go
edit
0
6
bsd-3-clause
f9595f0434c83b43b2eaf4bbc47e7bdd95727e82
cpmech/gosl,cpmech/gosl,cpmech/gosl,cpmech/gosl,cpmech/gosl
gm/tri/draw.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tests\n\nimport (\n\t\"net/url\"\n\n\t\"github.com/revel/revel/samples/upload/app/routes\"\n\n\t\"github.com/revel/revel\"\n)\n\ntype MultipleTest struct {\n\trevel.TestSuite\n}\n\nfunc (t *MultipleTest) TestThatMultipleFilesUploadWorks...
go
edit
21
1
mit
f2e5dc605070f7c385ae8f632a11f1ae52a92c45
cokeboL/revel,veliamsli/revel,w4ngyi/revel,trigrass2/revel,folpindo/revel,metafex/revel,revel/revel,lili2311/revel,revel/revel,roblillack/revel,runner-mei/revel,jenalgit/revel,jmptrader/revel,ggerman/revel,notzippy/revel,roblillack/revel,lgscofield/revel,marklap/revel,w4ngyi/revel,nubleer/revel,lgscofield/revel,zacklin...
samples/upload/tests/multipletest.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage vegeta\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// Dumper is an interface defining Results dumping.\ntype Dumper interface {\n\tDump(*Result) ([]byte, error)\n}\n\n// DumperFunc is an adapter to allow the use of or...
go
edit
9
1
mit
0b84771a1f449b8242958befc3de3caae75f4c1d
tsenart/vegeta,tsenart/vegeta
lib/dumpers.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (c) 2016-2017 Eric Barkie. All rights reserved.\n// Use of this source code is governed by the MIT license\n// that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\nfunc Examplemetar() {\n\...
go
edit
6
1
mit
4b8422240a86b030481acdd4a965b363e4dbf0a5
ebarkie/davis-station,ebarkie/davis-station
metar_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\"io/ioutil\"\n\t//\"github.com/go-yaml/yaml\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Readin input.yaml!\\n\")\n\n\tdata, err := ioutil.ReadFile(\"input.yaml\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt....
go
edit
0
2
apache-2.0
11e3263a8c99e1a56e6fa7d6779728d3bf786151
appPlant/alpinepass,appPlant/alpinepass
alpinepass.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gamq\n\nimport (\n\t\"testing\"\n)\n\nconst (\n\tTEST_QUEUE_NAME = \"TestQueue\"\n)\n\nfunc TestQueue_initialize_completesSuccessfully(t *testing.T) {\n\tunderTest := Queue{Name: TEST_QUEUE_NAME}\n\n\tunderTest.Initialize()\n\n\t// Queu...
go
edit
9
4
mit
e5bc938a4566443ec30dc3b0a9d738c5eabc2249
FireEater64/gamq
queue_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hpack\n\nimport (\n\t\"github.com/summerwind/h2spec/config\"\n\t\"github.com/summerwind/h2spec/spec\"\n\t\"golang.org/x/net/http2\"\n)\n\nfunc IndexAddressSpace() *spec.TestGroup {\n\ttg := NewTestGroup(\"2.3.3\", \"Index Address Space\...
go
edit
3
2
mit
190f4e33b720b21bbe98847ad506fd4ae446bc6b
summerwind/h2spec
hpack/2_3_3_index_address_space.go
rejected_duplicate
Near-duplicate of sample 119070
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mint\n\nimport \"testing\"\n\n// Because is context printer.\nfunc Because(t *testing.T, context string, wrapper func(*testing.T)) {\n\tLog(\" Because:\", context, \"\\n\")\n\twrapper(t)\n}\n\n// When is an alternative of `Because`\nfu...
go
edit
6
1
mit
81d1346bf815b714e5929dc6e9d1bec8c346003f
otiai10/mint
because.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport \"go.skia.org/infra/go/buildskia\"\n\nconst (\n\t// BUILD_TYPE is the type of build we use throughout fiddle.\n\tBUILD_TYPE = buildskia.RELEASE_BUILD\n)\n\nvar (\n\t// GN_FLAGS are the flags to pass to GN.\n\tGN_FLAGS =...
go
edit
0
0
bsd-3-clause
8d1aa53fd920b6c8c879f4979c153c98c229e72b
google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot
fiddle/go/config/config.go
rejected_duplicate
Near-duplicate of sample 118070
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\n// Accounts is used to unmarshal the /me/accounts response\n//\n// https://developers.facebook.com/docs/graph-api/reference/v2.3/user/accounts#fields\ntype Accounts struct {\n\tData []Page `json:\"data\"`\n}\n\n// Page represen...
go
edit
0
0
mit
edbebd560ac24a011d66ca39f7d7e0654c478e44
deiwin/facebook
model/page.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage handlers\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nconst URLRouteGame = \"/game/{id}\"\n\nvar upgrader = websocket.Upgrader{\n\tReadBufferSize: 1024,\n\tWriteBufferSize: 1...
go
edit
0
2
bsd-2-clause
0b5655bc3a67160c85bc15b6b8dd39b65ea7d2af
ivan1993spb/clever-snake
handlers/game_handler.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParseMaintainer(t *testing.T) {\n\tcases := []struct {\n\t\tin []byte\n\t\twant *Maintainer\n\t}{\n\t\t{[]byte(\"JohnDoe\"), &Maintainer{Name: \"JohnDoe\"}},\n\t\t{[]byte(\"John Doe\"), &...
go
edit
24
3
mit
ab30b9640bf308b322654248f67979727b744722
y-taka-23/voicepipe,y-taka-23/voicepipe
unmarshal_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage utils\n\nimport \"time\"\n\nvar (\n\tInterval = 10 * time.Second\n\tTimeout = 5 * time.Minute\n)\n\n```\n\nApply this change: Increase e2e poll timeout to 10min\n\nSet e2e poll timeout to 10 min to avoid flakes like\n\n```\n tektonc...
go
edit
0
0
apache-2.0
5404a4242f3423f7309d11eb21b100d3c1339916
tektoncd/operator,tektoncd/operator,tektoncd/operator
test/utils/config.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/eferro/go-snmpqueries/pkg/snmpquery\"\n)\n\nfunc generateRandomQueries() <-chan snmpquery.Query {\n\tout := make(chan snmpquery.Query)\n\tgo func(...
go
edit
0
2
mit
33968ddbdb9b48a2396a7c8a486f3bf89c9295f4
aleasoluciones/gosnmpquerier,aleasoluciones/gosnmpquerier
snmpqueries.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage slack\n\n// https://api.slack.com/docs/attachments\n// It is possible to create more richly-formatted messages using Attachments.\ntype AttachmentField struct {\n\tTitle string `json:\"title\"`\n\tValue string `json:\"value\"`\n\tShort ...
go
edit
0
0
mit
426af272e5395404521d3d27a19b9e56b38430e4
bluele/slack
attachments.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/jessevdk/go-flags\"\n\t\"github.com/k0kubun/go-readline\"\n)\n\ntype Options struct {\n\tScreenName string `short:\"a\" long:\"account\" description:\"login as an account of selec...
go
edit
36
5
mit
d0dcd885d0234d7a8bc7ded3eca8182c87aa1a51
k0kubun/thunderbolt
thunderbolt.go
rejected_lint
Too many lint violations: 36
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc perrin() func() int {\n\ta, b, c := 3, 0, 2\n\n\treturn func() int {\n\t\ta, b, c = b, c, a+b\n\t\treturn a\n\t}\n}\n\nfunc perrin_max(max int) func() int {\n\ta, b, c := 3, 0, 2\n\n\treturn func() int {\n...
go
edit
0
2
apache-2.0
032b2913a2229596905e937c5bfaf4ae541c9a07
doublerr/goperrin
perrin.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage openflow\n\nimport \"io\"\n\nconst MinimumHeaderLength = 8\n\ntype Packetizable interface {\n\tio.ReadWriter\n\tLen() uint\n}\n\ntype Message interface {\n\tPacketizable\n\tHeader() *Header\n}\n\ntype Header struct {\n\tVersion uint8\n\...
go
edit
0
1
mit
055725820cb45e9a3783b00ce6ad2bb89ab7b9e3
oshothebig/goflow
openflow/common.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sessmgr\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\ntype Session struct {\n\tid string\n\tLast time.Time\n\tmu sync.RWMutex\n\tVal map[string]interface{}\n\tprov Provider\n}\n\nfunc NewSession(id string, provider Provider) *Session {...
go
edit
6
1
mit
a7da9bcf5a3479d959364cd8b79f3e93c1673080
codemodus/formlark,codemodus/formlark,codemodus/formlark
internal/sessmgr/session.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage libgodelbrot\n\nimport (\n\t\"image\"\n)\n\n// Draw the Mandelbrot set. This is the main entry point to libgodelbrot\nfunc AutoRender(req *Request) (*image.NRGBA, error) {\n\tinfo, configErr := AutoConf(req)\n\n\tif configErr == nil {\...
go
edit
18
2
mit
07087392149ed02dd00fc19497a9e5a149edf2d3
johnny-morrice/webdelbrot-static,johnny-morrice/webdelbrot,johnny-morrice/webdelbrot-static,johnny-morrice/webdelbrot,johnny-morrice/godelbrot
src/functorama.com/demo/libgodelbrot/libgodelbrot.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage rfc3797\n\nimport (\n\t\"math\"\n)\n\nfunc main() {\n\n}\n\nfunc Entropy(n int, p int) float64 {\n\ti := 0\n\tresult := 0.0\n\n\tif (n < 1) || (n >= p) {\n\t\treturn 0.0\n\t}\n\n\tfor i = p; i > (p - n); i-- {\n\t\tresult += math.Log(fl...
go
edit
0
5
isc
59ef0a66be61cec303c0fc557971e42f0a5e8fbd
kyleroot/go-sortition
rfc3797.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage unittest\n\nimport (\n \"testing\"\n)\n\ntype Any interface{}\n\nfunc Failure(t *testing.T, x, y Any, mid string) {\n t.Fail()\n t.Log(x, mid, y)\n}\n\nfunc CheckEqual(t *testing.T, x, y Any) {\n if x != y {\n Failure...
go
edit
0
2
mit
bb30b6f3c402e8081320e413535131472a695c04
quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt
src/unittest/testing.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage far\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc FileExists(path string) bool {\n\t_, err := os.Stat(path)\n\n\tif err != nil {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc FindAndReplace(path, current,...
go
edit
3
5
mit
becb2e364d0373ba51cdffceafeda648ce928e87
brettchalupa/far,brettchalupa/far
far/far.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Provides a simple REST API implementing a basic to-do list\npackage main\n\nimport (\n\t\"expvar\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"sync\"\n\t\"todolist/repo\"\n\t\"todolist/spi\"\n)\n\nvar repository spi.Repo\n\n// Starts two HTTP services...
go
edit
3
1
mit
6cf1e5227d99c62935fde20cf7f21689bd3e5de5
peppelan/ToDoList,peppelan/ToDoList
src/todolist/todolist.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\tbmtestutils \"github.com/cloudfoundry/bosh-micro-cli/testutils\"\n)\n\nvar testCpiFilePath str...
go
edit
27
1
apache-2.0
33fcb45f6150000444a7925fe382e77868d81ad6
forrestsill/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init,forrestsill/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init,forrestsill/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init
integration/integration_suite_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage interfaces\n\nimport (\n\tpickle \"github.com/hydrogen18/stalecucumber\"\n\t\"github.com/pkg/errors\"\n)\n\ntype SDK struct {\n\tName string `json:\"name\" pickle:\"name\"`\n\tVersion string `json:\"version\" pickle:\"version\"...
go
edit
3
1
mit
2c6257b4c0882c4b254bf9112115743c8194d076
diyan/assimilator,diyan/assimilator,diyan/assimilator
interfaces/sdk.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mapper\n\nimport (\n \"git.aviuslabs.net/golang/async\"\n \"reflect\"\n)\n\nfunc Map(data interface{}, routine async.Routine, callbacks ...async.Done) error {\n var (\n routines []async.Routine\n results []interface{}\n )\n\n...
go
edit
0
2
mit
200c04ac515bce92fe32756555633878588865b4
Southern/async
map/map.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\"testing\"\n\n\trss \"github.com/jteeuwen/go-pkg-rss\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar items []*rss.Item\nvar fixtures = []string{\n\t\"aws-ec2-us-east-1\",\n\t\"cros...
go
edit
9
2
mit
63a647620e5319d3fb2849e085fe2184c734e3bd
justincampbell/lastpost
main_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2018 The Skaffold 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...
go
edit
9
1
apache-2.0
1bdf3df835853714ad321f56b7618b66e6f9b4b4
GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold
pkg/skaffold/build/local/bazel_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\n\t\"github.com/cloudfoundry-community/gcp-tools-release/src/stackdriver-nozzle/firehose\"\n\t\"github.com/cloudfoundry-community/go-cfclient\"\n\t\"github.com/cloudfoundry/sonde-go/events\"\n\t\"gopkg.in/al...
go
edit
6
2
apache-2.0
cb7ef9b9eec4469facd22e2a7114f93564cf8b5d
cloudfoundry-community/stackdriver-tools,cloudfoundry-community/stackdriver-tools,cloudfoundry-community/stackdriver-tools,cloudfoundry-community/stackdriver-tools
src/stackdriver-nozzle/scripts/firehose-to-stdout.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage slack\n\n// Conversation is the foundation for IM and BaseGroupConversation\ntype conversation struct {\n\tID string `json:\"id\"`\n\tCreated JSONTime `json:\"created\"`\n\tIsOpen bool `json:...
go
edit
12
0
bsd-2-clause
f1b061d99e7405d5f83e0b437fac0e1689f8852f
james-lawrence/slack,178inaba/slack,nlopes/slack
conversation.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage flagutil\n\nimport (\n\t\"strings\"\n)\n\nfunc (sl *StringList) String() string {\n\treturn `\"` + strings.Join(*sl, \",\") + `\"`\n}\n\nfunc (sl *StringList) Set(value string) error {\n\t*sl = strings.Split(value, \",\")\n\treturn nil\...
go
edit
9
2
apache-2.0
663198fd530e12ef0d627bba7ebdc2779d080d0c
keep94/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator
lib/flagutil/stringList.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sys\n\nimport (\n\t\"syscall\"\n)\n\nfunc fileOwner(v interface{}) (uid, gid, muid string) {\n\tuid = DefaultUid\n\tgid = DefaultGid\n\t//muid = DefaultMuid\n\tmuid = \"\"\n\n\tstat, ok := v.(*syscall.Dir)\n\tif !ok {\n\t\treturn\n\t}\n...
go
edit
12
2
mit
474e241cd74bfc856c1fbfa6894afe3be32018e5
droyo/styx
internal/sys/owner_plan9.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nconst dockerUnitTemplate = `\n[Unit]\nDescription={{.Name}}\nAfter=docker.service\n\n[Service]\nEnvironmentFile=/etc/environment\nUser=core\nTimeoutStartSec=0\nExecStartPre=/usr/bin/docker pull mmmhm/{{.Name}}:{{.Version}}\nExec...
go
edit
0
0
mit
7a9e26edeafc4c2f52faccefaa71c6c92a0d8b33
bmorton/deployster
templates.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage remotedialer\n\nimport (\n\t\"io\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n)\n\ntype wsConn struct {\n\tsync.Mutex\n\tconn *websocket.Conn\n}\n\nfunc newWSConn(conn *websocket.Conn) *wsConn {\n\tw := &wsConn{\n\t\...
go
edit
9
1
apache-2.0
0f6027ac32c2afbd2b5a1d2532550f5b66c11204
rancherio/rancher,rancherio/rancher,rancher/rancher,cjellick/rancher,rancher/rancher,rancher/rancher,cjellick/rancher,rancher/rancher,cjellick/rancher
pkg/remotedialer/wsconn.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nPackage identity provides type that allows to authorize request\n*/\npackage identity\n\nimport (\n\t\"github.com/google/uuid\"\n)\n\n// Identity data to be encode in auth token\ntype Identity struct {\n\tID uuid.UUID `json:\"id\"`\n\tEm...
go
edit
0
2
mit
8d74280caf163c26c084d042a31fc301b5913b4f
vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate
pkg/identity/identity.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main // import \"github.com/CenturyLinkLabs/panamax-kubernetes-adapter\"\n\nimport (\n\t\"github.com/CenturyLinkLabs/panamax-kubernetes-adapter/adapter\"\n\t\"github.com/CenturyLinkLabs/pmxadapter\"\n)\n\nfunc main() {\n\tadapter := ada...
go
edit
0
1
apache-2.0
f479e81e55890e3620b51068ed9230c42b1030e8
rupakg/panamax-kubernetes-adapter-go,CenturyLinkLabs/panamax-kubernetes-adapter-go
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar ErrAudienceTooLong = errors.New(\"the API only supports at most one element in the audience\")\n\ntype OidcToken struct {\n\tToken string `json:\"token\"`\n}\n\nfunc (c *Client) OidcTok...
go
edit
3
5
mit
d9f9fb14a7bb6fec351384a3cce1e7495b17da31
buildkite/agent,buildkite/agent,buildkite/agent
api/oidc.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/op/go-logging\"\n\t\"github.com/CaliDog/certstream-go\"\n)\n\nvar log = logging.MustGetLogger(\"example\")\n\nfunc main() {\n\tstream := certstream.CertStreamEventStream(false)\n\n\tfor jq := range strea...
go
edit
3
3
mit
eb2c30a26b5e139d5f8f0045d09fc53c264b5a9a
CaliDog/certstream-go
example/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/taylorskalyo/stno/action\"\n\n\t\"gopkg.in/urfave/cli.v1\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\n\tapp.Flags = []cli.Flag{\n\t\tcli.StringFlag{\n\t\t\tName: \"journal, j\",\n\t\t\tUs...
go
edit
0
1
mit
57bb15e2e6919c39a040d44fea004d2fbcb8cea8
taylorskalyo/stno
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/gnamma/server\"\n\t\"log\"\n)\n\nfunc main() {\n\ts := server.New(server.Options{\n\t\tName: \"Bar\",\n\t\tDescription: \"Yeah. This seems appropriate?\",\n\t\tAddress: \":3000\",\n\t})\n\n\tl...
go
edit
0
2
mit
95990453f05457ce3d7cc29ea3f32d149e5ee202
gnamma/server
cmd/gns/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package vpki provides a layer of abstraction between the golang stdlib\n// crypto primitives and common crypto uses (e.g. serving HTTPS) and the\n// functionality provided by Vault. Internally, the library generates private\n// keys locally ...
go
edit
0
0
mit
3e43b363701eb1744e9b628e00569231cf91e582
andrewstuart/vpki
doc.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage randstr\n\nimport \"testing\"\n\nfunc BenchmarkNew(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tNew(50, ASCIIRunes)\n\t}\n}\n\n```\n\nApply this change: Add additional benchmarks with larges sources.\n\nWhat\n===\nAdd additional b...
go
edit
9
2
mit
5491b9bf0412373fc78ca70452db3ce552d7b094
leighmcculloch/randstr
lib/randstr/randstr_bm_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// TODO\n// * improve JRD output\n// * do stuff with the JRD\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/ant0ine/go-webfinger\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc printHelp() {\n\tfmt.Println(\"webfinger [-vh]...
go
edit
3
6
mit
5733d1e8997727dff6a60ff4b2c1503cca92a295
ant0ine/go-webfinger
examples/cmdline/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage knc\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"encoding/json\"\n\t\"keycommon/reqtarget\"\n)\n\ntype KncServer struct {\n\tHostname string\n}\n\nfunc (k KncServer) kncRequest(data []byte) ([]byte, error) {\n\tcmd := exec.Command(\"/usr/...
go
edit
3
5
mit
f66c3dbe9c7a9606415e1918c9c6e6232fb64c59
sipb/homeworld,sipb/homeworld,sipb/homeworld,sipb/homeworld
building/build-debs/homeworld-keyserver/src/keycommon/knc/knc.go
rejected_duplicate
Near-duplicate of sample 117074
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage blockstoragecommands\n\nimport (\n\t\"github.com/jrperritt/rack/commands/blockstoragecommands/snapshotcommands\"\n\t\"github.com/jrperritt/rack/commands/blockstoragecommands/volumecommands\"\n\t\"github.com/jrperritt/rack/internal/githu...
go
edit
0
1
apache-2.0
3a6a322cc8fd953e272c764fc585c03eb4b71db4
ryanvz/rack,brint/rack,rackspace/rack,jrperritt/rack,jrperritt/rack,jarosser06/rack,dolph/rack,DonNateR/rack,annegentle/rack,ryanvz/rack,pratikmallya/rack,rackspace/rack,pratikmallya/rack,nelsnelson/rack,jarosser06/rack,annegentle/rack,nelsnelson/rack,brint/rack,dolph/rack,DonNateR/rack
commands/blockstoragecommands/commands.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage rel\n\nimport (\n\t\"reflect\"\n)\n\ntype AscendingNode OrderingNode\n\nfunc (node AscendingNode) Eq(other AscendingNode) bool {\n\treturn reflect.DeepEqual(node, other)\n}\n\nfunc (node AscendingNode) Direction() string {\n\treturn \"A...
go
edit
9
1
mit
cc30bf92c079553cbf9fefea70820d5e4f8aa5ee
aackerman/rel
ascending_node.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage honeybadger\n\n// nullBackend implements the Backend interface but swallows errors and does not\n// send them to Honeybadger.\ntype nullBackend struct{}\n\n// Ensure nullBackend implements Backend.\nvar _ Backend = &nullBackend{}\n\n// ...
go
edit
9
1
mit
3cbb9019e62b5ed8d2ec7ce693851f96cb8feade
honeybadger-io/honeybadger-go
null_backend.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage response\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n)\n\ntype Response interface {\n\tMakeATimestamp()\n}\n\ntype baseResponse struct {\n\tCommand string\n\tTimestamp int64\n}\n\nfunc (r *baseResponse) MakeATimestamp() {\n\tr.Times...
go
edit
0
2
mit
8a48f78a1f3d8490871e458b8f7e99ec2ec36927
WarCluster/warcluster-server,WarCluster/warcluster-server
server/response/main.go
rejected_duplicate
Near-duplicate of sample 118462
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/blockfreight/blockfreight-alpha/blockfreight/bft/leveldb\"\n)\n\nfunc main() {\n\t//db_path := \"bft-db/db\"\n\tdb_path := \"bft-db\"\n\tdb, err := leveldb.OpenDB(db_path)\n\t...
go
edit
0
2
mit
863c6c5b91a29633c91272ae838f1509b4d2247b
blockfreight/go-bftx,blockfreight/go-bftx,blockfreight/blockfreight-alpha
blockfreight/cmd/leveldb-test/leveldb-test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sack\n\nimport (\n\t\"fmt\"\n\t\"github.com/wsxiaoys/terminal/color\"\n\t\"io/ioutil\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nfunc display() {\n\tlines := content()\n\n\tdat, err := ioutil.ReadFile(termPath)\n\tcheck(err)\n\n\t// Header\n\t...
go
edit
12
2
mit
365f4db3d4dee206f262f205e39dd85bf633da1c
zph/go-sack,zph/go-sack
sack/display.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage similarity\n\nimport (\n\t\"fmt\"\n\t\"github.com/mcroydon/goplayground/similarity\"\n)\n\nfunc ExampleUse() {\n\t// Create a similarity engine\n\tsim := similarity.New()\n\n\t// Create some items\n\tcritic1 := \"critic1\"\n\tcritic2 :=...
go
edit
0
1
bsd-3-clause
809e04f2d16c4bac5b7d38f13537d3debfe0d914
mcroydon/goplayground
similarity/similarity_examples_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage thrift_nats\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"git.apache.org/thrift.git/lib/go/thrift\"\n\t\"github.com/nats-io/nats\"\n)\n\ntype natsServerTransport struct {\n\tconn *nats.Conn\n\taccepted chan struct{}\n\ttransport th...
go
edit
0
1
apache-2.0
c545cc8938facf35da12069d81461e04779a5274
tylertreat/thrift-nats,Workiva/thrift-nats
thrift_nats/nats_server_transport.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage buildbox\n\nimport \"fmt\"\n\n// buildVersion can be overriden at compile time by using:\n//\n// go run -ldflags \"-X github.com/buildbox/agent/buildbox.buildVersion abc\" *.go --version\n\nvar baseVersion string = \"1.0-beta.6\"\nvar ...
go
edit
0
2
mit
a993ac3696c8d38c06fe68279c5325b7b60e6aad
grosskur/agent,joelmoss/agent,Jasperswaagman/agent,es/agent,joelmoss/agent,Jasperswaagman/agent,Shopify/agent,buildkite/agent,tommeier/agent,Jasperswaagman/agent,joelmoss/agent,buildkite/agent,Shopify/agent,buildkite/agent,es/agent,es/agent,grosskur/agent,tommeier/agent,tommeier/agent,Shopify/agent,grosskur/agent
buildbox/version.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage authboss\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestMailer(t *testing.T) {\n\tmailServer := &bytes.Buffer{}\n\n\tconfig := NewConfig()\n\tconfig.Mailer = LogMailer(mailServer)\n\tconfig.Storer = mockStorer{}\n...
go
edit
15
7
mit
22efa3b740baf70a73c5f208dd32a3c8eb15099b
gernest/authboss,pathirana/authboss,orian/authboss,buu700/authboss,go-authboss/authboss
mailer_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cassandra\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/intelsdi-x/swan/pkg/cassandra\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"testing\"\n)\n\nfunc TestCassandraConnection(t *testing.T) {\n\tlogrus.SetLev...
go
edit
18
1
apache-2.0
0a45d48bf2e3ec9041f3f4b7050b3e79eff9df8b
intelsdi-x/swan,intelsdi-x/swan,intelsdi-x/swan
integration_tests/pkg/cassandra/connector_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cfg\n\n/*\n Configuration of Procession services can be done via either command line\n options (flags) or via environment variables.\n \n *Some* environment variables, e.g. PROCESSION_LOG_LEVEL, may be changed\n **after*...
go
edit
0
1
apache-2.0
fee82ab398a40505de70d583b570cbd5274b0f67
jaypipes/procession,jaypipes/procession
pkg/cfg/cfg.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\tbmtestutils \"github.com/cloudfoundry/bosh-micro-cli/testutils\"\n)\n\nfunc TestIntegration(t ...
go
edit
24
1
apache-2.0
f12ee16e5bedc485598ec4e76c3dc6c292f88584
allomov/bosh-init,forrestsill/bosh-init,cloudfoundry/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init,forrestsill/bosh-init,forrestsill/bosh-init
integration/integration_suite_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage buildcfg\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n)\n\nfunc loadGoConfig(remote string, c *Config) {\n\tu, _ := url.Parse(remote)\n\timportPath := u.Hostname() + strings.Replace(u.Path, \".git\", \"\", 1)\n\n\t// Most part of this jus...
go
edit
3
4
mit
d32d773dd9216db72bef86d94168d1fb53399c6f
rikvdh/ci,rikvdh/ci,rikvdh/ci
lib/buildcfg/cfg_lang_go.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package time contains functions to help work with date and time\npackage time\n\nimport (\n\t\"time\"\n)\n\n// ZoneName - a convenience function for determining the current timezone's name\nfunc ZoneName() string {\n\tn, _ := time.Now().Zone...
go
edit
0
2
mit
2ce20bdde18b062b19261a850e7342bb28087eec
hairyhenderson/gomplate
time/time.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage logic\n\nimport (\n\t\"github.com/jclebreton/opensirene/database\"\n\t\"github.com/pkg/errors\"\n)\n\ntype track struct {\n\tDatabase database.PgxClient\n}\n\ntype Tracker interface {\n\tSave(action, msg, filename string, isSuccess bool...
go
edit
0
2
mit
b86751bb49937553fd31cb90b7bbf64f46db193a
jclebreton/opensirene,jclebreton/opensirene
logic/track.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage h2spec\n\nimport (\n\t\"github.com/bradfitz/http2\"\n\t\"github.com/bradfitz/http2/hpack\"\n)\n\nfunc FrameSizeTestGroup() *TestGroup {\n\ttg := NewTestGroup(\"4.2\", \"Frame Size\")\n\n\ttg.AddTestCase(NewTestCase(\n\t\t\"Sends large s...
go
edit
30
1
mit
a646265e8b28ffbc543f320c98346eeea54e3fce
summerwind/h2spec,shane-kearns/h2spec,rmoorman/h2spec
4_2.go
rejected_lint
Too many lint violations: 30
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage goat\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n)\n\n// LogManager is responsible for creating the main loggers\nfunc LogManager() {\n\t// Create log directory and file, and pull current date to add to logfile...
go
edit
9
3
mit
1e0b729163c3ff9c01813fd459bd668ca17db0a9
mdlayher/goat
goat/logger.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage pkg\n\nimport \"sync\"\n\nfunc fn() {\n\ts := []int{}\n\n\tv := sync.Pool{}\n\tv.Put(s) // MATCH /Non-pointer type /\n\tv.Put(&s)\n\n\tp := &sync.Pool{}\n\tp.Put(s) // MATCH /Non-pointer type /\n\tp.Put(&s)\n}\n\n```\n\nApply this chang...
go
edit
6
1
mit
0e2ca28f15f35ace2f4ee78ff7413de5c1909ab7
dominikh/go-tools,dominikh/go-tools,dominikh/go-tools,dominikh/go-tools
staticcheck/testdata/dubious/sync-pool-pointers.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage wav\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBasicWav(t *testing.T) {\n\tfmt.Println(\"Running Basic Wav\")\n\tf, err := os.Open(\"test.wav\")\n\tfmt.Println...
go
edit
3
4
apache-2.0
527403397ba06f09f0278e370f4e7b87386d6106
200sc/klangsynthese
wav/wav_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage web\n\nimport (\n\t\"html/template\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/johnmaguire/wbc/database\"\n)\n\ntype IndexHandler struct {\n\taddress string\n\tdatabase string\n}\n\nfunc (ih *IndexHandler) ServeHTTP(w http.ResponseW...
go
edit
12
3
mit
20616f9c98218533d9fc1f997a30bed0342f1716
barracudanetworks/wbd
web/handlers.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015, Cyrill @ Schumacher.fm and the CoreStore contributors\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...
go
edit
0
3
apache-2.0
3c3b8dd9949dc34cee495bb7050d510f912599b0
joao-parana/csfw,corestoreio/csfw,corestoreio/csfw
directory/currency.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\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/labstack/echo\"\n)\n\nfunc (h *Handler) getGithubRepoHealth(c echo.Context) error {\n\tdb := h.DB.Clone()\n\tdefer db.Close()\n\n\towner := c.Param(\"o...
go
edit
12
3
mit
ef81eac9f1cb1355afc9f079bbaef2a2baf1dfe9
hasit/healthyrepo,hasit/healthyrepo,hasit/healthyrepo
handlers.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage azure_test\n\nimport (\n\t\"io/ioutil\"\n\n\t\"github.com/cloudfoundry/bosh-bootloader/storage\"\n\t\"github.com/cloudfoundry/bosh-bootloader/terraform/azure\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ ...
go
edit
18
1
apache-2.0
60bb144532a799d3151daceb77e41568cb1c129c
pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader
terraform/azure/template_generator_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage slack\n\n// https://api.slack.com/docs/attachments\n// It is possible to create more richly-formatted messages using Attachments.\ntype AttachmentField struct {\n\tTitle string `json:\"title\"`\n\tValue string `json:\"value\"`\n\tShort ...
go
edit
0
0
mit
485935a9fc776a65e38b67d2d3746f8da4f57993
bluele/slack
attachments.go
rejected_duplicate
Near-duplicate of sample 119114
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage skin\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"image/png\"\n\t\"net/http\"\n)\n\nconst (\n\tskinURL = \"http://skins.minecraft.net/MinecraftSkins/%s.png\"\n)\n\n// Follow all redirects\nvar skinClient = &http.Client{\n\tCheckRedirect: f...
go
edit
6
5
mit
d577ce14dea31583cc6c6dd6eec1906fad872896
LapisBlue/Lapitar,LapisBlue/Lapitar,LapisBlue/Lapitar
skin/mojang.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage data\n\nimport (\n\t\"time\"\n\n\t\"gopkg.in/mgo.v2\"\n\t\"gopkg.in/mgo.v2/bson\"\n)\n\ntype Memeber struct {\n\tID bson.ObjectId \"bson:`_id`\"\n\tProjectID bson.ObjectId \"bson:`project_id`\"\n\tAccountID bson.ObjectId \"bson:`...
go
edit
6
3
bsd-3-clause
7a0212fd653bfb7c12b8099477e50e63ae5ef105
FurqanSoftware/papyrus,FurqanSoftware/papyrus,FurqanSoftware/papyrus
data/member.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage metadata\n\n// Restrict to Linux because, although omreport runs fine on Windows, the\n// Windows metadata uses WMI to fetch this information.\n\nimport (\n\t\"strings\"\n\n\t\"bosun.org/util\"\n)\n\nfunc init() {\n\tmetafuncs = append(...
go
edit
9
4
mit
de6d1b848f0245955467fb6e0fe9a38748cebe13
Dieterbe/bosun,Dieterbe/bosun,vimeo/bosun,vimeo/bosun,Dieterbe/bosun,vimeo/bosun,Dieterbe/bosun,vimeo/bosun
metadata/metadata_dell_linux.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage parse\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n\n\t\"github.com/tdewolff/test\"\n)\n\nfunc TestPosition(t *testing.T) {\n\tvar newlineTests = []struct {\n\t\tpos int\n\t\ts string\n\t\tline int\n\t\tcol int\n\t\terr erro...
go
edit
3
2
mit
d3006931ec68b97e671866950af48a9c6de8970c
tdewolff/parse
pos_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fs\n\nimport (\n\t\"time\"\n)\n\nvar vfs map[string]*Item\n\ntype Item struct {\n\tContents string\n\tDir bool\n\tUser string\n\tGroup string\n\tMode uint\n\tCreatedAt time.Time\n\tUpdatedAt time.Time\n}\n\nfunc ini...
go
edit
0
1
bsd-3-clause
11e2f3677a12b873ca92e8d61d1c1553cfa3fea2
lukevers/arp147,lukevers/arp147
src/arp147/computer/fs/fs.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build appengine\n\npackage main\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t_ \"gnd.la/admin\" // required for make-assets command\n\t_ \"gnd.la/cache/driver/memcache\" // enable memcached cache driver\n\t_ \"gnd.la/orm/dri...
go
edit
12
3
apache-2.0
e8e5304cc387c482a2cd407b0ae3b1cddecae5f4
rainycape/gondolaweb,rainycape/gondolaweb,rainycape/gondolaweb,rainycape/gondolaweb
templates/_appengine/main_appengine.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage isdomain\n\n// ExtendedTLDs is a set of additional \"TLDs\", allowing decentralized name\n// systems, like TOR and Namecoin.\nvar ExtendedTLDs = map[string]bool{\n\t\"BIT\": true,\n\t\"ONION\": true,\n\t\"ETH\": true,\n}\n\n```\n\nA...
go
edit
0
0
mit
5dc526b01ae688ba5d3c89b21a580675898cdd34
jbenet/go-is-domain,jbenet/go-is-domain
tlds_custom.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2015 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
0b0300cfe6887861745518a25646383936cccb79
tenxcloud/kubernetes,invenfantasy/kubernetes,ixdy/kubernetes,khenidak/kubernetes,fejta/kubernetes,kokhang/kubernetes,colemickens/kubernetes,mdshuai/kubernetes,nckturner/kubernetes,tpepper/kubernetes,cadmuxe/kubernetes,njuicsgz/kubernetes-1,vmware/kubernetes,castrojo/kubernetes,ingvagabund/kubernetes,humblec/kubernetes,...
staging/src/k8s.io/code-generator/cmd/go-to-protobuf/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"hello world\")\n\n}\n\n```\n\nApply this change: Add slack token test function" }, { "role": "assistant", "content": "package main\n\nimport (\n\t\"fmt\"\n\n\tslackPkg...
go
edit
0
5
mit
4f4589135ce5b4d6bfaeb0b39abc4117a4010737
junwangustc/slackbot
slackAPI.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2011 Google Inc. All Rights Reserved.\n// This file is available under the Apache license.\n\n// +build gofuzz\n\npackage vm\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n)\n\nfunc Fuzz(data []byte) int {\n\t// Enable this when ...
go
edit
3
3
apache-2.0
f163fb286961e518f0472b4b731d70182b7179ce
SuperQ/mtail,google/mtail,google/mtail,SuperQ/mtail
internal/vm/fuzz.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build appenginevm\n\npackage google\n\nimport (\n\t\"strings\"\n\n\t\"github.com/golang/oauth2\"\n\t\"google.golang.org/appengine\"\n)\n\ntype AppEngineConfig struct {\n\tcontext appengine.Context\n\tscopes []string\n\tcache oauth2.Cache...
go
edit
0
2
bsd-3-clause
a443e46636c6eb2d84f6b24d05efb32f39895bab
tpiha/oauth2,djalal/oauth2,flowlo/oauth2,hoysoft/oauth2,pengwynn/oauth2-1,cw2018/oauth2,lancecarlson/oauth2,qtzheng/oauth2,jboeuf/oauth2,hoonmin/oauth2,walmartlabs/oauth2,drewwells/oauth2,heshed/oauth2,Kuzmin/oauth2,paul-at-start/oauth2,wmydz1/oauth2,EagerIO/oauth2,equinux/oauth2,helojo/oauth2,broady/oauth2,cllu/oauth2...
google/appenginevm.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage psql\n\nimport (\n\t\"errors\"\n\n\t_ \"github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/jinzhu/gorm/dialects/postgres\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com...
go
edit
0
4
apache-2.0
a1c76c2d4798fc7f7f75279eb002d4eeb089288b
eyecuelab/kit
db/psql/psql.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package pu makes solving projecteuler problems easier and reduces boilerplate.\npackage pu\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\n// Problem is a Project Euler (.net) problem\ntype Problem str...
go
edit
0
2
mit
794b4dcd83c62ded650d58a198f3764f5fcc74b7
jacobhands/pu
pu.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/almighty/almighty-core/app\"\n\t\"github.com/almighty/almighty-core/swagger\"\n\t\"github.com/goadesign/goa\"\n\t\"github.com/goadesign/goa/middleware\"\n)\n\nvar (\n\t// Commit current buil...
go
edit
3
1
apache-2.0
0b97853e9e164661c95c08e8bbf0a2ed45ddee9c
ALMighty/almighty-core,ldimaggi/almighty-core,ldimaggi/almighty-core,ldimaggi/almighty-core,ldimaggi/almighty-core
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t_ \"net/http/pprof\" // import for side effects\n\n\t\"github.com/gorilla/mux\"\n)\n\nfunc main() {\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/hello/{name}\", helloHandler)\n\n\thttp.Handle...
go
edit
0
2
mit
020f42ecec9952e6407aa8c03348377bf0427589
hack4impact/audio-transcription-service,hack4impact/transcribe4all,hack4impact/transcribe4all,hack4impact/transcribe4all
main.go
rejected_duplicate
Near-duplicate of sample 117632
true