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// Copyright 2015 The Prometheus Authors\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.a...
go
edit
12
1
apache-2.0
d1789be33e3535b381d7e2700b45b3d5499b4ee6
cbstewart9393/node_exporter,siavashs/node_exporter,mslocrian/flexswitch_exporter,fefelovgroup/node_exporter,prometheus/node_exporter,siavashs/node_exporter,chosenken/node_exporter,bs-github/node_exporter,knweiss/node_exporter,derekmarcotte/node_exporter,derekmarcotte/node_exporter,mslocrian/flexswitch_exporter,chosenke...
collector/interrupts_common.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build release\n\npackage libkb\n\n// Production run mode currently still unsafe.\n// This will cause the build to fail for this tag on purpose.\n//const DefaultRunMode = ProductionRunMode\n\n```\n\nApply this change: Enable DefaultRunMode f...
go
edit
3
0
bsd-3-clause
a6737b81e19912648b5b9d5d9afab9c643aa54c7
keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client
go/libkb/constants_release.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage letter\n\n// FreqMap records the frequency of each rune in a given text.\ntype FreqMap map[rune]int\n\n// Frequency counts the frequency of each rune in a given text and returns this\n// data as a FreqMap.\nfunc Frequency(s string) Freq...
go
edit
0
4
mit
3f71ca2f2ff9a6028600294e80846d205ebc8ad0
rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism
go/parallel-letter-frequency/parallel_letter_frequency.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage acme\n\n// ChallengeProvider presents the solution to a challenge available to be solved\n// CleanUp will be called by the challenge if Present ends in a non-error state.\ntype ChallengeProvider interface {\n\tPresent(domain, token, key...
go
edit
0
0
mit
f70a48e28af671a7ffe8f631510c66270e43ec29
xenolf/lego,fxposter/lego,xenolf/lego
acme/provider.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gitmedia\n\nimport (\n\t\"..\"\n\t\"../queuedir\"\n\t\"strings\"\n)\n\ntype QueuesCommand struct {\n\t*Command\n}\n\nfunc (c *QueuesCommand) Run() {\n\terr := gitmedia.WalkQueues(func(name string, queue *queuedir.Queue) error {\n\t\tgit...
go
edit
15
2
mit
3425ae831dd809140f6094813bba8ebce0c962b1
Aorjoa/git-lfs,JeckoHeroOrg/-git-lfs_miilkyway,larsxschneider/git-lfs,PeterDaveHello/git-lfs,beni55/git-lfs,PeterDaveHello/git-lfs,jsroads/git-lfs,ttaylorr/git-lfs,dakotahawkins/git-lfs,ssgelm/git-lfs,WillHipschman/git-lfs,aleb/git-lfs,beni55/git-lfs,iSC-Labs/git-lfs,larsxschneider/git-lfs,bozaro/git-lfs,ModernTechnolo...
commands/command_queues.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\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/imdario/mergo\"\n\t\"io/ioutil\"\n)\n\n// Configuration is the configuration type\ntype Configuration struct {\n\tEnvironment\n\tEnvironments map[string]Environment `json:...
go
edit
9
3
unlicense
45654876e6fc61a66e02a02b8c92b20162e874c3
rsterbin/rambler,elwinar/rambler
configuration.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage meta\n\n// SeekTable contains one or more precalculated audio seek points.\n//\n// ref: https://www.xiph.org/flac/format.html#metadata_block_seektable\ntype SeekTable struct{}\n\n```\n\nApply this change: meta: Add SeekTable and SeekPoi...
go
edit
0
0
unlicense
b6f88e1fc83e767749e5857a3835d0e05557376e
mewkiz/flac
meta/seektable.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sanitized_anchor_name_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/shurcooL/go/github_flavored_markdown/sanitized_anchor_name\"\n)\n\nfunc ExampleCreate() {\n\tanchorName := sanitized_anchor_name.Create(\"This is a header\")\n\n\tfmt.P...
go
edit
0
1
mit
9a8b7d4e8f347bfa230879db9d7d4e4d9e19f962
shurcooL/sanitized_anchor_name
main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage test_relate\n\nimport (\n\t\"github.com/stephenalexbrowne/zoom\"\n\t. \"launchpad.net/gocheck\"\n\t\"testing\"\n)\n\n// Gocheck setup...\nfunc Test(t *testing.T) {\n\tTestingT(t)\n}\n\ntype RelateSuite struct{}\n\nvar _ = Suite(&RelateS...
go
edit
27
3
mit
9a561908c56af83ceb092a33d00fca712dc73410
albrow/zoom
test_relate/relate_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\n Copyright The containerd Authors.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://w...
go
edit
0
0
apache-2.0
6bcf463b019461454fb2164b725ad343b42bc386
mikebrow/containerd,thaJeztah/containerd,dmcgowan/containerd,estesp/containerd,vdemeester/containerd,vdemeester/containerd,estesp/containerd,dmcgowan/containerd,thaJeztah/containerd,crosbymichael/containerd,containerd/containerd,crosbymichael/containerd,mikebrow/containerd,containerd/containerd
client_windows_test.go
rejected_duplicate
Near-duplicate of sample 118540
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage pewpew\n\nimport (\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"time\"\n)\n\nfunc runRequest(req http.Request, client *http.Client) (response *http.Response, stat RequestStat) {\n\treqStartTime := time.Now()\n\tresponse, responseErr :=...
go
edit
9
2
mit
8c4fe6db84c5e80d4218912d004108f7efbda5e6
bengadbois/pewpew
lib/requester.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage distribution\n\nimport \"net/rpc\"\n\n// Waiter is a struct that is returned by Go() method to be able to\n// wait for a Node response. It handles the rpc.Call to be able to get\n// errors if any.\ntype Waiter struct {\n\tNode *Node\...
go
edit
3
2
mit
1582f71461543c700a1c0ca34df3440f58a4b7ce
metal3d/distribution
waiter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage storage\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/docker/distribution\"\n\t\"github.com/docker/distribution/digest\"\n)\n\n// layerReader implements Layer and provides facilities for reading and\n// seeking.\ntype layerR...
go
edit
18
2
apache-2.0
fdd631477622bdb475a6078007ea2975b2231175
thaJeztah/distribution,thaJeztah/distribution
docs/storage/layerreader.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage search_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/wasanx25/sreq/search\"\n)\n\nfunc TestNew(t *testing.T) {\n\tactual := search.New(\"testK\", \"testS\")\n\tif actual.Keyword != \"testK\" {\n\t\tt.Errorf(\"expected=%q, got=%q\", ...
go
edit
0
3
apache-2.0
c46a983c3819e0eb5cfcffdd4cad5707fe7ff48e
wataru0225/sreq
search/search_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mesos\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/CiscoCloud/mesos-consul/registry\"\n)\n\nfunc (sj *StateJSON) GetFollowerById(id string) (string, error) {\n\tfor _, f := range sj.Followers {\n\n\t\tif f.Id == id {\n\t\t\tr...
go
edit
6
6
apache-2.0
450bfb2d7d5b360ec484c98299db03dcf69e701d
CiscoCloud/mesos-consul,mantl/mesos-consul
mesos/state.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage action\n\nimport (\n\t\"encoding/gob\"\n\t\"fmt\"\n)\n\ntype CreateSchema struct {\n\tSchemaName string\n}\n\n// Register type for gob\nfunc init() {\n\tgob.Register(&CreateSchema{})\n}\n\nfunc (a *CreateSchema) Execute(c *Context) erro...
go
edit
6
1
mit
f36b74f606249367ed007a9d91c92f4b1b5c0ecb
pagarme/teleport,pagarme/teleport
action/createschema.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage identity\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\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\tEmail string `json:\"email\"`\n\tRo...
go
edit
0
4
mit
1ea65072845fb84ba6a6a7e3a1b569396bbdea15
vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate
pkg/auth/identity/identity.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tracker\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/powerman/narada-go/narada/staging\"\n)\n\nfunc TestMain(m *testing.M) { os.Exit(staging.TearDown(m.Run())) }\n\n```\n\nApply this change: Add helper function to readfiles fr...
go
edit
0
2
mit
2e2989610520b3b02963733416e4ec040938a89e
qarea/jirams,qarea/jirams
tracker/init_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"testing\"\n)\n\nfunc TestDefaultDisco(t *testing.T) {\n\tv := discoAliases[defaultDisco]\n\tif v == \"\" {\n\t\tt.Fatalf(\"alias for %q is zero; all aliases: %v\", defaultDisco, discoAliases)\n\t}\n}\n\...
go
edit
15
4
apache-2.0
0063d23233fff0d4ec6326885828d5fbbbaefc85
google/acme
cmd/goacme/main_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\"os\"\n\t\"testing\"\n\n\t\"github.com/rollbar/rollbar-go\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestSetupEnv(t *testing.T) {\n\tsetupEnv()\n\tport := os.Getenv(\"PORT\")\n\tassert.NotEqual(t, port, ...
go
edit
21
1
mit
ed827467c759468ccfbff451be6f34886db4f58a
albertyw/reaction-pics,albertyw/reaction-pics,albertyw/reaction-pics,albertyw/reaction-pics
main_test.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc init() {\n\tRootCmd.AddCommand(&cobra.Command{\n\t\tUse: \"cp [name]\",\n\t\tShort: \"Copy a credential to the clipboard\",\n\t\tLong: `The copy comm...
go
edit
15
4
mit
5e593f6c2a774e85319c13d23a9436fa32a93a71
bndw/pick,bndw/pick
commands/copy.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (C) 2016 AppNeta, Inc. All rights reserved.\n\npackage tv_test\n\nimport (\n\t\"github.com/appneta/go-traceview/v1/tv\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc ExampleBeginProfile(ctx context.Context) {\n\tdefer tv.BeginProfile(...
go
edit
0
1
apache-2.0
8d436c8d2297250f8f25373156462eb633fe81f7
appneta/go-appneta,appneta/go-appneta
v1/tv/profile_example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage configeur\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestFlags(t *testing.T) {\n\tf := Flag{\n\t\targs: []string{\"exec\", \"--x=2\", \"--y=four five six seven\"},\n\t}\n\n\tif v, _ := f.String(\"x\"); v != \"2\" {\n\t\tfmt.Printl...
go
edit
18
1
mit
3c0fe2d3bfa96f65da18b63a2aec34a84b32dc62
paked/configure
flag_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2020 Frederik Zipp. 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 gocyclo\n\nimport (\n\t\"go/ast\"\n\t\"strings\"\n)\n\ntype directives []...
go
edit
0
4
bsd-3-clause
28ccd9b63abf673cb565e143297a3a45f4233202
fzipp/gocyclo
directives.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage riak_cs_service\n\nimport (\n\t\"github.com/cloudfoundry-incubator/cf-test-helpers/runner\"\n\t. \"github.com/onsi/ginkgo\"\n)\n\nvar _ = Describe(\"Riak CS Nodes Register a Route\", func() {\n\tIt(\"Allows users to access the riak-cs s...
go
edit
24
1
apache-2.0
60a9a19ae0fcc57f1e100341b3d3117f8652582d
cloudfoundry-incubator/cf-riak-cs-acceptance-tests,cloudfoundry-incubator/cf-riak-cs-acceptance-tests,cloudfoundry-incubator/cf-riak-cs-acceptance-tests
riak-cs-service/route_register_test.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage darts\n\nimport \"math\"\n\nfunc Score(x, y float64) int {\n\tif isInnerCircle(x, y) {\n\t\treturn 10\n\t} else if isMiddleCircle(x, y) {\n\t\treturn 5\n\t} else if isOuterCircle(x, y) {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc isInner...
go
edit
0
4
mit
cada5a8ba7b80987b2b3a935fcce1cef0f1d8294
rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism
go/darts/darts.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage action\n\nimport (\n\t\"github.com/Masterminds/glide/godep\"\n\t\"github.com/Masterminds/glide/msg\"\n)\n\n// ImportGodep imports a GPM file.\nfunc ImportGodep(dest string) {\n\tbase := \".\"\n\tconfig := EnsureConfig()\n\tif !godep.Has...
go
edit
9
3
mit
270b034de1e7039194fead11f7d0b7b92500e7bc
avvmoto/glide,cmars/tools,cmars/tools,cmars/tools,franciscocpg/glide,franciscocpg/glide,cmars/tools,avvmoto/glide
action/import_godep.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cf\n\nimport (\n\t\"encoding/json\"\n\t\"strings\"\n\t\"time\"\n\n\t. \"github.com/onsi/gomega\"\n\n\t\"github.com/cloudfoundry-incubator/cf-test-helpers/runner\"\n)\n\n//var CfApiTimeout = 30 * time.Second\n\ntype GenericResource struc...
go
edit
6
3
apache-2.0
be97699700d8615a9b005065c34ae8ec981795bc
cloudfoundry-incubator/cf-test-helpers,cloudfoundry-incubator/cf-test-helpers
cf/api.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package utils contains common shared code.\npackage utils\n\nimport (\n\t\"math\"\n\t\"time\"\n)\n\n// Backoff holds the number of attempts as well as the min and max backoff delays.\ntype Backoff struct {\n\tattempt, Factor float64\n\tMin, ...
go
edit
0
4
mit
c0cdd8d2bb7e5980694459bf2e6f1959c8efd91d
force12io/force12,force12io/force12
utils/backoff.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage kubeconfig\n\nimport \"html/template\"\n\nconst (\n\ttokenTemplateText = `apiVersion: v1\nkind: Config\nclusters:\n{{- range .Nodes}}\n- name: \"{{.ClusterName}}\"\n cluster:\n server: \"{{.Server}}\"\n{{- if ne .Cert \"\" }}\n c...
go
edit
0
0
apache-2.0
95e9a4992456502ec4386f310bc56e0bb64aa262
cjellick/rancher,cjellick/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancherio/rancher,rancher/rancher,cjellick/rancher,rancher/rancher
pkg/kubeconfig/templates.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage builtins\n\nimport \"github.com/coel-lang/coel/src/lib/core\"\n\n// Equal checks if all arguments are equal or not, and returns true if so or false otherwise.\nvar Equal = core.NewStrictFunction(\n\tcore.NewSignature(nil, nil, \"args\",...
go
edit
6
0
mit
05a2f8a91851774fea51766376b1a57ed5e00a07
raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp
src/lib/builtins/equal.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tty\n\nimport (\n\t\"os\"\n\n\t\"github.com/elves/elvish/util\"\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\twantedInMode = windows.ENABLE_WINDOW_INPUT |\n\t\twindows.ENABLE_MOUSE_INPUT | windows.ENABLE_PROCESSED_INPUT\n\twantedOutM...
go
edit
6
3
bsd-2-clause
3f73331ba0e4da8dedd910bcec9edcb383ff16e3
elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish
edit/tty/setup_windows.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2010 The \"go-linoise\" Authors\n//\n// Use of this source code is governed by the Simplified BSD License\n// that can be found in the LICENSE file.\n//\n// This software is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES\n/...
go
edit
12
3
bsd-2-clause
44863b07f48a9ad14fdae5d07786baad96a57cd7
fiber/go-linoise
linoise/linoise_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2019 The Ebiten Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://w...
go
edit
3
2
apache-2.0
ce86a9940c4b9311dce25f8b89511e47d1dbd470
hajimehoshi/ebiten,hajimehoshi/ebiten
internal/uidriver/mobile/graphics_ios.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (c) 2010 AFP Authors\n// This source code is released under the terms of the\n// MIT license. Please see the file LICENSE for license details.\n\npackage afp\n\nimport (\n\t\"os\"\n\t\"log\"\n)\n\nconst CHAN_BUF_LEN = 64\n\n//Const...
go
edit
6
0
mit
dae33b296e2d4eb31debe67e29c75f8c99dc37e2
jesusaurus/afp,jesusaurus/afp,jesusaurus/afp,jesusaurus/afp
lib/afp/types.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gohost\n\n// HosterEndpoint is an interface for an endpoint that can be hosted.\ntype HosterEndpoint interface {\n\t// Serve hosts the endpoint.\n\tServe()\n}\n\n```\n\nApply this change: Update interface to return an error." }, { ...
go
edit
0
0
mit
1d4d34d481b33b5f0a2974081836ebdc40222376
eleniums/gohost,eleniums/gohost
hoster_endpoint.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage uploader\n\nimport (\n\t\"errors\"\n\t\"github.com/matthew-andrews/s3up/objects\"\n\t\"sync\"\n)\n\ntype s3ClientInterface interface {\n\tUploadFile(string, objects.File) error\n}\n\nfunc Upload(service s3ClientInterface, bucket string,...
go
edit
0
5
mit
48f9c45c99c4ea7079c924adcb18b9d167b504d8
matthew-andrews/s3up
uploader/uploader.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage algoliasearch\n\ntype Key struct {\n\tACL []string `json:\"acl\"`\n\tCreatedAt int `json:\"createdAt,omitempty\"`\n\tDescription string `json:\"description,omitempty\"`\n\tIndexes ...
go
edit
0
0
mit
e57e40302fb65a7786892ed00acce07d78887b8b
l4u/algoliasearch-client-go,l4u/algoliasearch-client-go,algolia/algoliasearch-client-go,algolia/algoliasearch-client-go
algoliasearch/types_key.go
accepted
null
true
[ { "role": "user", "content": "Write go code for the following: Add simple test for `rev-parse HEAD`." }, { "role": "assistant", "content": "package git\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestRevParseSingle(t *testing.T) {\n\trepo := createTestRepo(t)\n\tdefer os.RemoveAll...
go
new_file
12
3
mit
1e651aaa22a35bbcaaa1af4da0e05a674833ebdc
libgit2/git2go,orivej/git2go,tiborvass/git2go,treejames/git2go,clns/git2go,orivej/git2go,clearr/git2go,kissthink/git2go,TheDahv/git2go,clearr/git2go,michaeledgar/git2go,ezwiebel/git2go,ezwiebel/git2go,orivej/git2go,TheDahv/git2go,tiborvass/git2go,hwjeong/git2go,libgit2/git2go,clns/git2go,AaronO/git2go,pks-t/git2go,ezwi...
revparse_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n)\n\n// WriteTempFile creates a temporary file and returns its name\nfunc WriteTempFile(prefix string, content string) string {\n\ttmpFile, err := ioutil.TempFile(\"\", \"aptomi-\"+prefix)\n...
go
edit
3
3
apache-2.0
1309e7b9492d9a783287e327f592860a5d3f1ae9
Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi
pkg/util/file.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\nimport \"github.com/blevesearch/bleve\"\n\n// InitIndex initializes the search index at the specified path\nfunc InitIndex(filepath string) (bleve.Index, error) {\n\tindex, err := bleve.Open(filepath)\n\n\t// Doesn't yet exist ...
go
edit
0
3
mit
43ce41236f080f64879c4757b0740f8a198498ce
hoop33/limo
model/index.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage media\n\nimport (\n\t\"net/http\"\n\t\"github.com/gorilla/mux\"\n\t\"strconv\"\n\t\"io/ioutil\"\n)\n\nfunc GetMedia(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tf := vars[\"idMedia\"]\n\tidMedia, _ := strconv.Atoi...
go
edit
6
3
mit
2ae5492ccf7046960e337ccc6aff024216789b33
Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL
backend/media/mediaservice.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestTimestampParser(t *testing.T) {\n\t// nanoseconds\n\ttsNano := ParseTimestamp(\"1411534805453497432\")\n\tif tsNano != 1411534805453497432 {\n\t\tt.Errorf(\"Invalid ns: %v != %v\", tsNano, ...
go
edit
9
1
apache-2.0
817c8271834c618ec99c6358b98c59a7537cefe7
pavel-paulau/perfkeeper,pavel-paulau/perfdb,pavel-paulau/perfdb
time_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage symboltable\n\ntype StringToIntST interface {\n\tPut(key string, val int)\n\tGet(key string) (int, bool)\n\tDelete(key string)\n}\n//changed\n\n```\n\nApply this change: Revert \"test after new machine setup\"\n\nThis reverts commit c5f...
go
edit
0
0
mit
2e4b3b56f19d6b308bf2c453e80313071a9a2bcb
lzcqd/sedgewick
chap3_searching/symboltable/stringtoint.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cli\n\nimport \"fmt\"\n\nimport (\n\t\"sync\"\n\n\t\"github.com/jessevdk/go-flags\"\n)\n\nvar (\n\tglobalParser *flags.Parser\n\tglobalParserSetup sync.Once\n)\n\nfunc parser() *flags.Parser {\n\tglobalParserSetup.Do(func() {\n\t\t...
go
edit
15
4
bsd-3-clause
7629835c7e55ff035c2e5ac18e9cd927a8442bfc
vektra/cypress,vektra/cypress
cli/cli.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage subnet\n\nconst (\n\t//Queue from TUN -> router(server) / remote end (client)\n\tpktInMaxBuff = 150\n\tpktOutMaxBuff = 150\n\n\tdevMtuSize = 1500\n\tdevPktBuffSize = 4096\n\n\t//Queue from network clients to ingestion\n\tservMaxInb...
go
edit
0
0
mit
77a854d793ee5bc1d0029497c3630316befd02df
twitchyliquid64/subnet,twitchyliquid64/subnet
src/subnet/constants.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage switchboard\n\nimport \"encoding/json\"\n\ntype backendsPresenter struct {\n\tbackends Backends\n}\n\nfunc NewBackendsPresenter(backends Backends) backendsPresenter {\n\treturn backendsPresenter{\n\t\tbackends: backends,\n\t}\n}\n\nfunc...
go
edit
6
2
apache-2.0
9900d0380ada6a96b7cf50e847245943de9f65fa
cloudfoundry-incubator/switchboard,cloudfoundry-incubator/switchboard,cloudfoundry-incubator/switchboard,cloudfoundry-incubator/switchboard
backends_presenter.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage api\n\n// RootResponse object which will be formatted to json and sent back to google and onto the user.\ntype RootResponse struct {\n\tConversationToken string `json:\"conversation_token\"`\n\tExpectUserResponse bool ...
go
edit
0
0
apache-2.0
daa3b000d9a9429cfab0d75802bf2a4d491ffdef
wwsean08/go-action-sdk
api/response.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"time\"\n\n\t\"github.com/skygeario/skygear-server/pkg/server/skyerr\"\n)\n\nvar timeNow = func() time.Time { return time.Now().UTC() }\n\ntype serializedError struct {\n\tid string\n\terr skyerr.Error\n}\n\nfun...
go
edit
0
4
apache-2.0
1717bb941ed4035a6b86209089f58cd669cb2941
SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server
pkg/record/handler/handler.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage yaml\n\nimport (\n\t\"github.com/rancher/norman/types\"\n)\n\nfunc NewFormatter(next types.Formatter) types.Formatter {\n\treturn func(request *types.APIContext, resource *types.RawResource) {\n\t\tresource.Links[\"yaml\"] = request.URL...
go
edit
0
2
apache-2.0
531dfc22018fae9d6fa725a2090fed0b65bd5860
rancher/rancher,cjellick/rancher,rancherio/rancher,cjellick/rancher,rancher/rancher,rancher/rancher,rancher/rancher,rancherio/rancher,cjellick/rancher
pkg/api/customization/yaml/formatter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"github.com/Cistern/sflow\"\n\t\"net\"\n)\n\nfunc sFlowParser(buffer []byte) {\n\treader := bytes.NewReader(buffer)\n\td := sflow.NewDecoder(reader)\n\tdgram, err := d.Decode()\n\tif err != nil {\n\t\tp...
go
edit
18
6
mit
06fed06a31753a4f1e54e23a61f2896aaed63acf
TuxPowered42/ddos_detector
sflow_listener.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage packet\n\nimport \"github.com/spf13/cobra\"\n\nfunc deleteCmd() *cobra.Command {\n\tcmd := &cobra.Command{}\n\treturn cmd\n}\n\n```\n\nApply this change: Add support for deleting packet machines" }, { "role": "assistant", "c...
go
edit
3
10
apache-2.0
cece2c35381eba83611603c4c66e4dff0267e96c
sashajeltuhin/ket,apprenda/kismatic-provision,apprenda/kismatic-provision,sashajeltuhin/ket
provision/packet/delete.go
rejected_duplicate
Near-duplicate of sample 117472
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/sosedoff/musicbot/bot\"\n)\n\nfunc main() {\n\tif os.Getenv(\"MOPIDY_HOST\") == \"\" {\n\t\tfmt.Println(\"MOPIDY_HOST is not provided\")\n\t\treturn\n\t}\n\n\tif os.Getenv(\"SLACK_...
go
edit
3
4
mit
ea6afc7f15fa6129b078ea3e176bc352a3cc5d5d
sosedoff/musicbot
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 qpck\n\n/*\n#cgo linux LDFLAGS: -lopenblas -llapack -lgfortran -lm\n\n...
go
edit
0
0
bsd-3-clause
4e5309381e73a3963cb2a82d3704bee4d8cfb73a
cpmech/gosl,cpmech/gosl,cpmech/gosl,cpmech/gosl,cpmech/gosl
num/qpck/flags.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/ecnahc515/gist-playground/gist\"\n\t\"github.com/google/go-github/github\"\n)\n\nvar token string\n\nfunc init() {\n\ttoken = os.Getenv(\"GISTPLAYGROUND_TOKEN\")\n}\n\n...
go
edit
0
5
mit
c46857ce5326753d497a90997a4c38c58f0229a3
chancez/goplayutils,ecnahc515/goplayutils,ecnahc515/goplayutils,chancez/goplayutils
cmd/gp/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage actionerror\n\nimport \"fmt\"\n\n// RevisionNotFoundError is returned when a requested application is not\n// found.\ntype RevisionNotFoundError struct {\n\tVersion int\n\tApp string\n}\n\nfunc (e RevisionNotFoundError) Error() stri...
go
edit
0
1
apache-2.0
9f15722635752cff394b669339c1f641a0723f44
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
actor/actionerror/revision_not_found.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fetcher\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/drkaka/lg\"\n)\n\nfunc TestGetMessage(t *testing.T) {\n\tlg.InitLogger(true)\n\n\tjCmd := fmt.Sprintf(\"journalctl -u hooks -o json -n 20\")\n\tresults, err := GetMessages(...
go
edit
0
0
apache-2.0
318da23a464cc6509b98f8bf7b92bfa57d9681f9
drkaka/j2es,drkaka/j2es
fetcher/fetcher_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage termite\n\nimport (\n\t\"fmt\"\n\t\"http\"\n)\n\nfunc (me *WorkerDaemon) httpHandler(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"<html><head><title>Termite worker</head></title>\")\n\tfmt.Fprintf(w, \"<h1>Termite worke...
go
edit
9
2
bsd-3-clause
6582351c5e2e95caca8dabfb71c6b4bae987f5e9
hanwen/termite,hanwen/termite,hanwen/termite
termite/workerstatus.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/vulcand/oxy/forward\"\n\t\"github.com/vulcand/oxy/roundrobin\"\n\t\"github.com/vulcand/oxy/stream\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\ntype ReverseProxy struct {\n\tstream *stream.Streamer\n}\n\nfunc...
go
edit
0
2
mit
be7db019682845eda420a97b200ff7f9e46f0a59
xaviergodart/gydro
server/reverse_proxy.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/* Demonstrate a streaming REST API, where the data is \"flushed\" to the client ASAP.\n\nThe Curl Demo:\n\n curl -i http://127.0.0.1:8080/stream\n\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/ant0ine/go-json-rest\"\n\t\"net/...
go
edit
9
2
mit
204ceec06b5f048a2ec90e24163c1c3076258c2e
jacobxk/go-json-rest-examples,ant0ine/go-json-rest-examples,snowsnail/go-json-rest-examples
streaming/main.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\"image/color\"\n\t\"time\"\n\n\t\"github.com/voxelbrain/pixelpixel/imageutils\"\n\t\"github.com/voxelbrain/pixelpixel/protocol\"\n)\n\nfunc main() {\n\tc := protocol.PixelPusher()\n\timg := protocol.NewPixel()\n\n\t...
go
edit
0
4
mit
e8aef4b9bf80da660c0374c6d476c87a3233a35e
voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel
examples/crasher/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage regexp\n\nimport (\n\t\"testing\"\n\n\t\"github.com/tonyhb/govalidate/rules\"\n)\n\nfunc TestRegexp(t *testing.T) {\n\tobject := rules.ValidationData{\n\t\tField: \"Test\",\n\t\tArgs: []interface{}{\"^[a-zA-Z]{3,5}[0-9]+$\"},\n\t}\n\n\...
go
edit
6
5
mit
f0c9300b99921e0bc8bd015ec9b2476993fa6b2b
tonyhb/govalidate
rules/regexp/regexp_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage adapter\n\nimport (\n\t\"github.com/domain-query-language/dql-server/src/server/vm/handler\"\n)\n\ntype Adapter interface {\n\n\tNext() (Handleable, error)\n}\n\n// Make it easy to get the correct type out, no need for casting based on ...
go
edit
0
1
mit
c56620cf2f25c751aec3bb4e53d5585b01528116
domain-query-language/dql-server
src/server/adapter/adapter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage path\n\nimport (\n\t\"fmt\"\n\t\"github.com/aybabtme/graph\"\n)\n\ntype PathFinder interface {\n\tHasPathTo(to int) bool\n\tPathTo(to int) []int\n}\n\ntype TremauxDFS struct {\n\tg graph.Graph\n\tfrom int\n\tmarked []bool\n\tedge...
go
edit
0
3
mit
068da3ff0d0e1ac5590458d5d814b6c90a2edb55
aybabtme/graph,aybabtme/graph
path/pathfinder.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNonHandledEndpoint(t *testing.T) {\n\treq := httptest.NewRequest(\"GET\", \"http://exam...
go
edit
15
1
mit
0620c4308eb2a10174d6e261b273927ad5b5e63c
peppelan/ToDoList,peppelan/ToDoList
src/todolist/todolist_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage firewall\n\nimport (\n\t\"net\"\n\n\tdeviceConfig \"github.com/lxc/lxd/lxd/device/config\"\n)\n\n// Firewall represents a LXD firewall.\ntype Firewall interface {\n\tString() string\n\tCompat() (bool, error)\n\n\tNetworkSetupForwardingP...
go
edit
0
0
apache-2.0
90031dd82876b3ffbc2c9e2e829af2e9b2010f21
atxwebs/lxd,lxc/lxd,atxwebs/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,hallyn/lxd,lxc/lxd,hallyn/lxd,stgraber/lxd,hallyn/lxd,stgraber/lxd,lxc/lxd,atxwebs/lxd,lxc/lxd,hallyn/lxd,atxwebs/lxd,hallyn/lxd,hallyn/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd
lxd/firewall/firewall_interface.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage retry\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/cenkalti/backoff/v4\"\n\t\"github.com/pkg/errors\"\n)\n\n// MaybeRetryRequest is an internal implementation detail of this module. It\n// shouldn't be used by users of the ...
go
edit
6
2
apache-2.0
14c649331b5ec886fd283adb545e84ef6db62bd3
maxmind/geoipupdate,maxmind/geoipupdate,maxmind/geoipupdate
pkg/geoipupdate/retry/retry.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage background\n\nimport (\n\t\"image\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"path/filepath\"\n)\n\n// Set the background on windows.\nfunc Set(img image.Image) error {\n\t// Get the absolute path of the directory.\n\tusr, err := user.Current(...
go
edit
0
3
mit
e377444404f140bb5eff13b9cc38d8cc4b362b50
avinashbot/satellite
background/background_linux.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/joaodias/hugito-app/handlers\"\n\t\"net/http\"\n)\n\nfunc main() {\n\trouter := handlers.NewRouter()\n\trouter.Handle(\"repositories get\", handlers.GetRepository)\n\trouter.Handle(\"repositor...
go
edit
0
1
mit
7fbf69f875779c2150c07bf2a8a5fc46ad8c1885
joaodias/hugito-app
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"log\"\n \"os\"\n \"path\"\n)\n\nfunc main() {\n if len(os.Args) != 3 {\n log.Fatalf(\"Usage: %s input-file output-file\", path.Base(os.Args[0]))\n }\n i, err := os.Open(os.Args[1])\n if err != nil {\n l...
go
edit
0
9
apache-2.0
41bed60213c81ccb550342a1efc24fc48d3587dc
pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff,pdbartlett/misc-stuff
go/gedcom/hidify/hidify.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage brats_test\n\nimport (\n\t\"github.com/cloudfoundry/libbuildpack/bratshelper\"\n\t\"github.com/cloudfoundry/libbuildpack/cutlass\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Go buildpack\", ...
go
edit
27
1
apache-2.0
9efc87c0a399c4237c6ab28a0ea5e61fead2ba56
cloudfoundry/go-buildpack,cloudfoundry/go-buildpack,cloudfoundry/go-buildpack
src/go/brats/brats_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\n\t\"github.com/datawire/ambassador/pkg/supervisor\"\n)\n\nvar notifyRAI *RunAsInfo\n\n// Notify displays a desktop banner notification to the user\nfunc Notify(p *supervisor.Process, message...
go
edit
9
7
apache-2.0
7342707271db0551820b099d5a59ecdf5f006490
datawire/telepresence,datawire/telepresence,datawire/telepresence
cmd/edgectl/notify.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"fmt\"\n\t\"html/template\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) {\n\ttmpl, err := template.ParseFiles(\"templates/root.html\")\n\tif ...
go
edit
9
3
unlicense
32f7ef7c1ee4cd252a382be5f1d7d990f7940192
dgottlieb/consensus,dgottlieb/consensus
server/server.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/thomasf/drone-mvn/mavendeploy\"\n\t\"github.com/drone/drone-plugin-go/plugin\"\n)\n\nfunc main() {\n\tworkspace := plugin.Workspace{}\n\trepo := plugin.Repo{}\n\tbuild := plugin.Build{}\n\tvargs := maven...
go
edit
0
4
apache-2.0
9dea517fbe838d0e38b132d1096436e35b014c91
thomasf/drone-mvn
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mock\n\nimport (\n\t\"testing\"\n\n\t\"github.com/micro/go-micro/errors\"\n\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestClient(t *testing.T) {\n\tresponse := []MockResponse{\n\t\t{Method: \"Foo.Bar\", Response: map[string]interface{}...
go
edit
6
3
apache-2.0
9d060bf6e1e43b2ea8c387091ae62909b39cb602
divisionone/go-micro,uffy/go-micro,Taik/go-micro,myodc/go-micro,micro/go-micro
client/mock/mock_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this...
go
edit
0
0
apache-2.0
553260f4c436e63495b3e84c56bdbe0e286fcd07
upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift
lib/go/thrift/server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2011 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 386 arm arm64 ppc64 ppc64le appengine\n\npackage crc32\n\n// The file ...
go
edit
18
2
bsd-3-clause
d4b7f0178c704f63fa66353a058b9b1a7eab31b8
yxd-hde/crc32,klauspost/crc32
crc32_generic.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !linux\n\npackage lxc\n\nimport \"github.com/docker/docker/daemon/execdriver\"\n\nfunc setHostname(hostname string) error {\n\tpanic(\"Not supported on darwin\")\n}\n\nfunc finalizeNamespace(args *execdriver.InitArgs) error {\n\tpanic...
go
edit
3
1
apache-2.0
210db1234dfb8d279bc1e5e2c8438dc8db2ee27d
14rcole/docker,flavio/docker,mikebrow/docker,cyphar/docker,mountkin/docker,xnox/docker,Neverous/docker,ashmo123/docker,solganik/docker,haveatry/docker,mgoelzer/docker,tkopczynski/docker,cnbin/docker,Lanzafame/docker,tklauser/docker,containers/storage,boucher/docker,vdemeester/docker,inversion/docker,majst01/docker,cmeh...
daemon/execdriver/lxc/lxc_init_unsupported.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage g\n\nimport (\n\t\"time\"\n)\n\n// changelog:\n// 3.1.3: code refactor\n// 3.1.4: bugfix ignore configuration\n// 5.0.0: 支持通过配置控制是否开启/run接口;收集udp流量数据;du某个目录的大小\n// 5.1.0: 同步插件的时候不再使用checksum机制\n// 5.1.3: Fix config syntax error when dep...
go
edit
0
0
apache-2.0
1ff17b7a3778c1a539072fc40dcf1f969a1be3d2
Cepave/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,masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,masato25/open...
modules/agent/g/const.go
rejected_duplicate
Near-duplicate of sample 117229
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage runewidth\n\nimport (\n\t\"syscall\"\n)\n\nvar (\n\tkernel32 = syscall.NewLazyDLL(\"kernel32\")\n\tprocGetACP = kernel32.NewProc(\"GetACP\")\n)\n\nfunc IsEastAsian() bool {\n\tr1, _, _ := procGetACP.Call()\n\tif r1 == 0 {\n\t\treturn ...
go
edit
3
3
mit
58a0da4ed7b321c9b5dfeffb7e03ee188fae1c60
mattn/go-runewidth
runewidth_windows.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package callinfo stores custom values into the Context\n// (related to the RPC source)\npackage callinfo\n\nimport (\n\t\"html/template\"\n\n\t\"golang.org/x/net/context\"\n)\n\n// CallInfo is the extra data stored in the Context\ntype CallI...
go
edit
0
1
apache-2.0
a71e7dcd225a4ec00cbca7e1afd1b140f2078c29
nurblieh/vitess,mattharden/vitess,SDHM/vitess,enisoc/vitess,cgvarela/vitess,netroby/vitess,mapbased/vitess,xgwubin/vitess,skyportsystems/vitess,kmiku7/vitess-annotated,cgvarela/vitess,erzel/vitess,davygeek/vitess,erzel/vitess,nurblieh/vitess,vitessio/vitess,fengshao0907/vitess,yangzhongj/vitess,enisoc/vitess,skyportsys...
go/vt/callinfo/callinfo.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n)\n\n// DecodeJSON decodes json\nfunc DecodeJSON(src io.Reader, dst interface{}) error {\n\tdecoder := json.NewDecoder(src)\n\terr := decoder.Decode(dst)\n\treturn err\n}\n\n// EncodeJSON...
go
edit
0
1
mit
383e4f36649b88789333bef1ee3c447fee63ca58
NaExpire/API
src/util/json.go
rejected_duplicate
Near-duplicate of sample 119199
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\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/benbjohnson/sieve\"\n)\n\nvar (\n\taddr = flag.String(\"addr\", \":6900\", \"HTTP address\")\n)\n\nfunc usage() {\n\tfmt.Fprintln...
go
edit
0
4
mit
2d1da289e01d1518aac466cd12b76e7683bbe79a
benbjohnson/sieve,benbjohnson/sieve
cmd/sieve/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"os\"\n\n \"github.com/intelsdi-x/pulse/control/plugin\"\n \"github.com/intelsdi-x/pulse/plugin/publisher/pulse-publisher-hana/hana\"\n)\n\nfunc main() {\n meta := hana.Meta()\n plugin.Start(meta, hana...
go
edit
0
1
apache-2.0
ed1300a4e45471b4504ea63d0e4cb06a44ce219a
intelsdi-x/snap-plugin-publisher-hana,intelsdi-x/snap-plugin-publisher-hana,intelsdi-x/snap-plugin-publisher-hana
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage glock\n\nimport (\n\t\"github.com/stathat/consistent\"\n)\n\nfunc initServersPool(endpoints []string) *consistent.Consistent {\n\tcons := consistent.New()\n\tfor _, endpoint := range endpoints {\n\t\t// TODO: First check if endpoint is ...
go
edit
0
3
mit
aa250b1cbee900e4e6565dce894db6d2078db6e9
iron-io/glock
client/hashing.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage chain\n\nimport \"testing\"\n\nfunc TestFuncEnd(t *testing.T) {\n\tc := New(nestedHandler0, nestedHandler0)\n\tc = c.Append(nestedHandler1, nestedHandler1)\n\n\tmc := New(nestedHandler0, nestedHandler0)\n\tc = c.Merge(mc)\n\n\th := c.En...
go
edit
18
3
mit
47f3a348fa3f15954819f329681beefe9d70d87c
codemodus/chain
chain_func_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage kitsu\n\nimport \"testing\"\n\nfunc TestNewClient(t *testing.T) {\n\tc := NewClient(nil)\n\n\tif got, want := c.BaseURL.String(), defaultBaseURL; got != want {\n\t\tt.Errorf(\"NewClient BaseURL is %v, want %v\", got, want)\n\t}\n}\n\nfu...
go
edit
18
4
mit
31527148797c6ba4910c8a9117172adac6d7581a
nstratos/go-kitsu
kitsu/kitsu_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !linux\n\npackage plugin\n\nimport (\n\t\"fmt\"\n\n\tcnitypes \"github.com/containernetworking/cni/pkg/types\"\n\n\t\"github.com/openshift/origin/pkg/sdn/plugin/cniserver\"\n)\n\nfunc (m *podManager) setup(req *cniserver.PodRequest) (...
go
edit
9
1
apache-2.0
b9dcb9f8da6477719f0b9b825f3ffa66b9a7e1bf
legionus/origin,liangxia/origin,childsb/origin,detiber/origin,rrati/origin,juanvallejo/origin,php-coder/origin,spadgett/origin,xiuwang/origin,JacobTanenbaum/origin,tdawson/origin,miminar/origin,dinhxuanvu/origin,mrogers950/origin,dcbw/origin,PI-Victor/origin,ramr/origin,liggitt/origin,rhcarvalho/origin,dcbw/origin,mdsh...
pkg/sdn/plugin/pod_unsupported.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage uploadService\n\nimport (\n\t\"strings\"\n)\n\nfunc CheckTrackers(trackers []string) bool {\n\t// TODO: move to runtime configuration\n\tvar deadTrackers = []string{ // substring matches!\n\t\t\"://open.nyaatorrents.info:6544\",\n\t\t\"...
go
edit
0
5
mit
90c52bf7d32c3f3daacd59598d6df31dbb1166c5
kipukun/nyaa,yueou/nyaa,Nutjob/nyaa,ipatrol/nyaa,moose65468/nyaa,steindornatorinn/nyaa,Nutjob/nyaa,ipatrol/nyaa,moose65468/nyaa,kipukun/nyaa,yueou/nyaa,ElegantMonkey/nyaa,Nutjob/nyaa,steindornatorinn/nyaa,NyaaPantsu/nyaa,Nutjob/nyaa,ipatrol/nyaa,ElegantMonkey/nyaa,ElegantMonkey/nyaa,steindornatorinn/nyaa,majestrate/nya...
service/upload/upload.go
rejected_duplicate
Near-duplicate of sample 118707
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage middlewares\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/urfave/negroni\"\n\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/pkg/errors\"\n)\n\ntype MetricsMiddleware struct {\n\twriter io.Writer\n}\n\nfunc NewMetricsMiddle...
go
edit
0
2
apache-2.0
0f2616689a35ef0ddf917fe26f60df187dbcc5b7
cloudfoundry-incubator/bits-service,cloudfoundry-incubator/bits-service,petergtz/bitsgo,cloudfoundry-incubator/bits-service,cloudfoundry-incubator/bits-service,petergtz/bitsgo,cloudfoundry-incubator/bits-service
middlewares/metrics_middleware.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows\n\npackage gottyclient\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc notifySignalSIGWINCH(c chan<- os.Signal) {\n\tsignal.Notify(c, syscall.SIGWINCH)\n}\n\nfunc...
go
edit
0
3
mit
989a803a5ba2ea787d3178fd918671e11a5a1871
moul/gotty-client,moul/gotty-client,moul/gotty-client,moul/gotty-client
arch.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"time\"\n\n\t\"github.com/golang/protobuf/proto\"\n\t\"golang.org/x/net/context\"\n)\n\ntype Client interface {\n\tInit()\n\tCall(ctx context.Context, serviceName, endpoint string, req proto.Message, res proto.Mes...
go
edit
3
1
mit
af680b70dd690ccad987ae533abc6197341ee20b
mondough/typhon,monzo/typhon
client/client.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/nlf/dlite/utils\"\n)\n\ntype RebuildCommand struct {\n\tDisk int `short:\"d\" long:\"disk\" description:\"size of disk to create\" default:\"30\"`\n\tSSHKey string `short:\"s\" long:\"ssh-key\" desc...
go
edit
3
1
mit
cd87763200fa1c0c10c3ec18cdc24b6e7ef9d119
nlf/dlite,cmosetick/dlite
rebuild.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage control\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/rancher/os/log\"\n)\n\nfunc yes(question string) bool {\n\tfmt.Printf(\"%s [y/N]: \", question)\n\tvar line string\n\t_, err := fmt.Scan(&line)\n\tif err != nil {\n\t\tlog....
go
edit
0
2
apache-2.0
14257bdde848db45c539c516120e18306006aa97
SvenDowideit/os,juliengk/os,rancher/os,rancherio/os,rancherio/os,ibuildthecloud/os,rancher/os,ibuildthecloud/os,SvenDowideit/os,juliengk/os,gizmotronic/os,gizmotronic/os,rancherio/os
cmd/control/util.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cf\n\nimport (\n\t\"log\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/service/cloudformation\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc deleteStack(ctx *cli.Context) error {\n\tname := ctx.Args().First()\n\tif n...
go
edit
9
3
mit
9a658e04ab95ff0bcb0c708526bd55361fd7309a
sam701/awstools
cf/delete_stack.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package sockets provides helper functions to create and configure Unix or TCP sockets.\npackage sockets\n\nimport (\n\t\"crypto/tls\"\n\t\"net\"\n)\n\n// NewTCPSocket creates a TCP socket listener with the specified address and\n// and the s...
go
edit
0
3
apache-2.0
4fdabcf3f77e6ebbc1d6aa64f4b65549818c0b22
docker/go-connections
sockets/tcp_socket.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage task\n\ntype TaskServer struct {\n}\n\n```\n\nApply this change: Add implementation for PostTask and GetTaskId, untested" }, { "role": "assistant", "content": "package task\n\nimport (\n\t\"net/http\"\n\n\t\"example.com/inte...
go
edit
18
2
unlicense
7e5b72c2b0f7a1fdddbf05351fc3c421c5779052
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/swagger/oapi-server/internal/task/taskserver.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage messenger\n\nimport \"time\"\n\ntype Message struct {\n\tSender Sender `json:\"-\"`\n\tRecipient Recipient `json:\"-\"`\n\tTime time.Time `json:\"-\"`\n\tMid string `json:\"mid\"`\n\tText s...
go
edit
9
1
mit
c2ae2a3f304615a8e193cbe099eebb286fa5d773
paked/messenger
message.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\"errors\"\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc addDeviceSubcommand(client *srpc.Client, args []string) {\n\tif err := addDevice(client, args[0], args...
go
edit
0
3
apache-2.0
1a8399329024dd009a32ab91a94fb7f03bb98423
rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator
cmd/unpacker-tool/addDevice.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build tools\n\npackage hotstuff\n\nimport (\n\t_ \"github.com/relab/gorums\"\n\t_ \"google.golang.org/protobuf/cmd/protoc-gen-go\"\n)\n\n```\n\nApply this change: Fix package name in examples" }, { "role": "assistant", "content"...
go
edit
0
0
mit
0574f5899feac372b447b8218beffe7c91f55ed1
relab/gorums,relab/gorums,relab/gorums
examples/tools.go
accepted
null
true