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 2012 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 ignore\n\npackage main\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\...
go
edit
0
1
bsd-3-clause
977e33a5df684367c50f1443fd861bef4db83ba8
dolmen/go-tour-fr,dolmen/go-tour-fr,dupoxy/go-tour-fr,dolmen/go-tour-fr,dupoxy/go-tour-fr,dupoxy/go-tour-fr
solutions/image.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage heff\n\nimport (\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"sync\"\n)\n\n// DefaultHoneypot is an http.HandlerFunc that serves random HTML from the\n// DefaultMarkovMap, 100KB at a time.\nvar DefaultHoneypot = NewHoneypot(DefaultMarkovMa...
go
edit
6
2
mit
5fee4b4aa750182d42626abf5ee69166b497a3c2
carlmjohnson/heffalump
heff/http.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\nimport (\n \"fmt\"\n \"net/http\"\n \"os\"\n)\nfunc handler(w http.ResponseWriter, r *http.Request) {\n h, _ := os.Hostname()\n fmt.Fprintf(w, \"Hi there, I'm served from %s!\", h)\n}\nfunc main(...
go
edit
3
2
mit
8556b6963bd04687a6a81368b743c16a4fd0677c
fredead/VagrantAnsible
helloWorld.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage saml\n\n// AttributesMap is a type that provides methods for working with SAML\n// attributes.\ntype AttributesMap map[string][]string\n\n// NewAttributesMap creates an attribute map given a third party assertion.\nfunc NewAttributesMap...
go
edit
3
8
mit
2ff019010fc527968c57c1843dbd4c7455619251
goware/saml
attributes.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage libvirt\n\n/*\n#cgo LDFLAGS: -lvirt\n#include <libvirt/libvirt.h>\n\n*/\nimport \"C\"\n\nfunc EventRegisterDefaultImpl() error {\n\tif i := int(C.virEventRegisterDefaultImpl()); i != 0 {\n\t\treturn GetLastError()\n\t}\n\treturn nil\n}\...
go
edit
9
2
mit
0b4afe553632204ad44e202f234c24311f0ad10a
libvirt/libvirt-go,libvirt/libvirt-go,libvirt/libvirt-go,libvirt/libvirt-go
events.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sqsadaptor\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc init() {\n}\n\nfunc TestAdaptorConstruction(t *testing.T) {\n\ttestsqs := NewSQSAdaptor(\"testqueue\")\n\tassert.Equal(t, testsqs.Qu...
go
edit
9
2
mit
baa50700bfec555fa4c912b4db533b15076be8ce
zeph/goad,goadapp/goad,goadapp/goad,goadapp/goad,cwaltken-edrans/goad,betabrand/goad,cwaltken-edrans/goad,cwaltken-edrans/goad,zeph/goad,zeph/goad,betabrand/goad
sqsadaptor/sqsadaptor_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage controllers\n\npackage controllers\n\nimport (\n\t\"github.com/astaxie/beego\"\n)\n\ntype ImageController struct {\n\tbeego.Controller\n}\n\nfunc (this *ImageController) Prepare() {\n\tthis.Ctx.Output.Context.ResponseWriter.Header().Set...
go
edit
6
1
mit
2c1a2293b76c1edaa42a28fa4aaf8a4ff6fcbc24
yonh/wharf,yonh/wharf,maquanyi/wharf,maquanyi/wharf,astaxie/docker-registry
controllers/image.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app\"\n\t\"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/commands/admin\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc generateHelp([]cli.Command) {\n\tf...
go
edit
0
4
mit
d92455ffc0d69cc04539da68643ca0a5314631a8
BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client
cmd/bytemark/generate_help.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package ppsconsts constains constants relevant to PPS that are used across\n// Pachyderm. In particular, the pipeline spec repo is handled specially by PFS\n// and Auth, and those implementations need to refer to its name without\n// dependi...
go
edit
0
0
apache-2.0
fa81847c7a3c12eb74bfa73be4e2ed4a96cfb3f5
pachyderm/pfs,pachyderm/pfs,pachyderm/pfs
src/server/pkg/ppsconsts/ppsconsts.go
accepted
null
true
[ { "role": "user", "content": "Write go code for the following: Add sample manifest, test ValidateManifests" }, { "role": "assistant", "content": "package main\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nconst ManifestFilename = \"test-manifest.yml\"\nconst Manifest string = `---\nname: The Projec...
go
new_file
3
2
bsd-3-clause
76812edd35f5cc40af94822b148cff192cffa382
cored/broadway,macat/broadway,namely/broadway,poopoothegorilla/broadway,namely/broadway,poopoothegorilla/broadway,macat/broadway,cored/broadway,therealplato/broadway,therealplato/broadway
main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage memory\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar filename string = \"/proc/meminfo\"\n\nfunc (p *prober) probe() error {\n\tfile, err := os.Open(filename)\n\tif err != nil {\n\t\treturn err\n\t...
go
edit
3
2
apache-2.0
20401860635e0ab0f225f60d3bd54f1b6f945e29
Symantec/health-agent,Symantec/health-agent,rgooch/health-agent,rgooch/health-agent
probers/memory/probe.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/* Read from /sys/devices/virtual/dmi/id/board_{name,serial,vendor} */\npackage mbinfo\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n)\n\nconst MB_NAME_FILE = \"/sys/devices/virtual/dmi/id/board_name\"\nconst MB_SERIAL_FILE = \"/sys/devices/virtual/dm...
go
edit
0
2
mit
49153e142eacb556d7564033b270bd47b3aa0d18
PiScale/hwinfo-lib
mbinfo/mbinfo.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"flag\"\n\t\"net/http\"\n)\n\nvar (\n\t// Production allows handlers know whether the server is running in a production environment.\n\tProduction bool\n\n\t// Address is the TCP network address on which the server ...
go
edit
3
2
mit
b1c64b7458fff743e194812e8bec6ba90cf30512
volatile/core
server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage metadata\n\nfunc listInternalFieldTypes() []*FieldType {\n\treturn []*FieldType{\n\t\t&FieldType{\n\t\t\tName: \"_bool\",\n\t\t\tDatamanType: Bool,\n\t\t},\n\t\t&FieldType{\n\t\t\tName: \"_datetime\",\n\t\t\tDatamanType: D...
go
edit
27
1
mit
24242869ad8e33abca601771cc9cdc2afa0ab308
jacksontj/dataman
src/storage_node/metadata/field_type_internal.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage libkb\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestEnvDarwin(t *testing.T) {\n\tenv := newEnv(nil, nil, \"darwin\")\n\n\truntimeDir := env.GetRuntimeDir()\n\tsockFile, err := env.GetSocketFile()\n\tif err != nil {\n\t\...
go
edit
3
3
bsd-3-clause
772f4b7d84024ec20e8ea646aad468bbf41b2433
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/env_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build gofig\n\npackage local\n\nimport (\n\t// load the packages\n\t_ \"github.com/codedellemc/libstorage/drivers/storage/vfs/client\"\n)\n\n```\n\nApply this change: Fix for Import VFS Client w Bad Build Tags\n\nThis patch updates an impor...
go
edit
0
0
apache-2.0
4ee0ca83a7cf177ec70aec5d777eae3a765a1796
codedellemc/libstorage,cduchesne/rexray,akutz/rexray,oppodeldoc/rexray,oppodeldoc/rexray,akutz/libstorage,codedellemc/rexray,codedellemc/rexray,thecodeteam/rexray,MatMaul/libstorage,emccode/libstorage,cduchesne/rexray,akutz/libstorage,emccode/libstorage,codedellemc/libstorage,codedellemc/rexray,codedellemc/rexray,akutz...
imports/local/imports_local_gofig.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage skiplist\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n)\n\ntype elementNode struct {\n\tnext []*Element\n}\n\ntype Element struct {\n\telementNode\n\tkey float64\n\tvalue interface{}\n}\n\ntype SkipList struct {\n\telementNode\n\tmaxLeve...
go
edit
0
1
mit
0d5cd9262469dfe20d5e2845b8001afec7b265b2
sean-public/fast-skiplist
type.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"github.com/itchio/wharf/compressors/cbrotli\"\n\t_ \"github.com/itchio/wharf/decompressors/cbrotli\"\n)\n\n```\n\nApply this change: Add gzip compressor/decompressor, doesn't seem to make binary any bigger (proba...
go
edit
0
0
mit
78816ad434b8c60184cf2a46a8c7f17e40f56e99
itchio/butler,itchio/butler,itchio/butler
compression.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nPackage rmsd implements a version of the Kabsch algorithm that is described\nin detail here: http://cnx.org/content/m11608/latest/\n\nA convenience function for computing the RMSD of residue ranges from two PDB\nfiles is also provided.\n*/\...
go
edit
0
0
mit
b3239e49cb77f8dac7bd968d73aab42cfcd51082
TuftsBCB/fragbag
rmsd/doc.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage webserver\n\nimport (\n\t\"log\"\n\n\t\"github.com/gin-gonic/contrib/static\"\n\t\"github.com/gin-gonic/gin\"\n\tcors \"github.com/tommy351/gin-cors\"\n)\n\nfunc Run(listen string) {\n\tgin.SetMode(gin.DebugMode)\n\n\tr := gin.New()\n\t...
go
edit
15
2
mit
5b9e03b89e1c77c3130b9e6fce1f40bc889a51ba
RollingBalls/rollingballs-server
webserver/webserver.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage bitmath4go\n\nimport \"testing\"\n\nfunc testShortAndLongFuncNamesShouldBeSame(t *testing.T, shortName BitmathBase, longName BitmathBase) {\n\tif shortName != longName {\n\t\tt.Errorf(\"%s short and long func names do not produce the sa...
go
edit
3
2
mit
8870ff9562eb1f98042ffa49a97048d3cdf4b13c
kelcecil/bitmath4go
test_utils.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"encoding/json\"\n \"fmt\"\n \"net/http\"\n \"github.com/rkbodenner/parallel_universe/collection\"\n)\n\ntype Player struct {\n Id int\n Name string\n}\n\nvar players = []Player{\n {1, \"Player One\"},\n {2, ...
go
edit
0
3
mit
2ca9cb9712c074821471aca3936c9499f6bf54b6
rkbodenner/meeple_mover,rkbodenner/meeple_mover
meeple_mover.go
accepted
null
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
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage Debounce\n\nimport (\n\t\"time\"\n)\n\nfunc Example_debounce() {\n\n\ti := 1\n\tdue := []time.Duration{\n\t\t0,\n\t\t300 * time.Millisecond,\n\t\t80 * time.Millisecond, // 80ms < 100ms => '2' is ignored\n\t\t110 * time.Millisecond,\n\t\...
go
edit
3
2
mit
3e84fbe28510417aa31508d0bf68cdfa11d96760
ReactiveGo/rx
generic/test/Debounce/example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage petfind\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\nvar ErrNotFound = errors.New(\"item not found\")\n\n// Pet holds information about each pet of the application.\ntype Pet struct {\n\tID int64\n\tName string\n\tAge int\n\tAdded ...
go
edit
0
0
mit
a33f5581aaec1448b58d516ac622991499e4eae6
psimika/secure-web-app
petfind/petfind.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage statistics\n\nimport \"testing\"\n\nfunc TestMedian(t *testing.T) {\n\tmedian, _ := Median([]float64{1,2,3})\n\tif median != 2 {\n\t\tt.Error(\"Median must be 2\")\n\t}\n\n\tmedian, _ = Median([]float64{1,2})\n\tif median != 1.5 {\n\t\t...
go
edit
9
5
mit
ba65a9e5f8f8f152bbf2ab255b2a91a6e540a86e
SiroDiaz/go-statistics
median_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage agent\n\nimport (\n\t\"github.intel.com/hpdd/lustre\"\n\t\"github.intel.com/hpdd/lustre/fs\"\n\t\"github.intel.com/hpdd/lustre/pkg/xattr\"\n)\n\nconst xattrFileID = \"trusted.hsm_file_id\"\n\nfunc updateFileID(mnt fs.RootDir, fid *lustr...
go
edit
0
2
mit
85688bc383685f33e748a151a6f56216772d7d5d
intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur,intel-hpdd/lemur
cmd/lhsmd/agent/fileid.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n)\n\ntype Attributes map[string][]int\ntype Weights map[string]int\n\ntype Classifier struct {\n\tName string\n\tCategories map[string]Attributes\n\tWeig...
go
edit
0
8
isc
d9a58543a197e9e5dc65c2b472334b617871129d
whee/jsonclassify
jsonclassify.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\n * Copyright (c) 2015 Kurt Jung (Gmail: kurt.w.jung)\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this perm...
go
edit
0
1
mit
f0c4fb26374b905ca6e5163fcb984d4a9b932b1d
jung-kurt/gofpdf
internal/example/example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/containerd/containerd/server\"\n)\n\nfunc defaultConfig() *server.Config {\n\treturn &server.Config{\n\t\tRoot: server.DefaultRootDir,\n\t\tState: server.DefaultStateDir,\n\t\tGRPC: server.GRPCConfig{\n...
go
edit
0
1
apache-2.0
f2ba04ffa424c283b5dccd12c8dd347cfbfa640c
miaoyq/containerd,vdemeester/containerd,containerd/containerd,mikebrow/containerd,crosbymichael/containerd,dmcgowan/containerd,kunalkushwaha/containerd,thaJeztah/containerd,mikebrow/containerd,vdemeester/containerd,dmcgowan/containerd,thaJeztah/containerd,crosbymichael/containerd,rajasec/containerd,containerd/container...
cmd/containerd/config_linux.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 premailer\n\nimport (\n\t\"github.com/vanng822/css\"\n)\n\nfunc copyRule(selector string, rule *css.CSSRule) *css.CSSRule {\n\t// copy rule for each selector\n\tcopiedStyle := css.CSSStyleRule{SelectorText: selector, Styles: rule.Style....
go
edit
0
2
mit
5f59e45d281886a81d4ae811fe70da96c836f080
vanng822/go-premailer,vanng822/go-premailer
premailer/util.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage python\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"sourcegraph.com/sourcegraph/toolchain\"\n)\n\nfunc runCmdLogError(cmd *exec.Cmd) {\n\terr := runCmdStderr(cmd)\n\tif err != nil {\n\t\tlog...
go
edit
0
3
mit
ce73256b8ecfdd14428bee5977c453906fc4148a
techdragon/srclib-python,techdragon/srclib-python,techdragon/srclib-python
python/util.go
rejected_duplicate
Near-duplicate of sample 118329
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gothink\n\nimport (\n \"encoding/json\"\n \"io/ioutil\"\n)\n\ntype Net interface {\n Epoch()\n}\n\ntype Layer struct {\n Activation string\n Weights [][]float64\n}\n\n/*\nA feed forward type neural network\n*/\ntype ...
go
edit
0
2
mit
330e205512f849e85a0e01e7c82246eb5aac5927
jaybutera/gothink
net.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage git\n\nimport (\n\t\"errors\"\n\t\"regexp\"\n)\n\ntype GitRemote struct {\n\tName string\n\tURL string\n}\n\nfunc Remotes() ([]GitRemote, error) {\n\tr := regexp.MustCompile(\"(.+)\\t(.+github.com.+) \\\\(push\\\\)\")\n\toutput, err :=...
go
edit
3
5
mit
27d6322eda35d7eefe79eb2a1a5cd26fa36ab155
jingweno/gh,jingweno/gh,beni55/gh,beni55/gh,beni55/gh,jingweno/gh
git/remote.go
rejected_duplicate
Near-duplicate of sample 117791
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage radosAPI\n\n// Usage represents the response of usage requests\ntype Usage struct {\n\tEntries []struct {\n\t\tBuckets []struct {\n\t\t\tBucket string `json:\"bucket\"`\n\t\t\tCategories []struct {\n\t\t\t\tBytesReceived int `jso...
go
edit
0
0
mit
ff758e9bb9ca6a6750d21f17cd9653126c467cef
QuentinPerez/go-radosgw
pkg/api/resources.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015 Google Inc. All Rights Reserved.\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/...
go
edit
0
2
apache-2.0
eadbe6d5a4a92da8eef924ac9cbe953131ccef73
Matir/webborer,Matir/gobuster,Matir/gobuster,Matir/webborer
settings/config_unix.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage horizon\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/jagregory/halgo\"\n\t\"github.com/stellar/go-horizon/render/hal\"\n)\n\n// RootResource is the initial map of links into the api.\ntype RootResource struct {\n\thalgo.Links\n}\n\nvar...
go
edit
0
1
apache-2.0
854ef6c2e241d628c6d221b6b015bcfcbe77f3bd
lackac/horizon,stellar/horizon,masonforest/horizon,masonforest/horizon,irisli/horizon,masonforest/go-horizon,lackac/horizon,stellar/horizon,nullstyle/go-horizon,masonforest/go-horizon,masonforest/go-horizon,irisli/horizon,irisli/horizon,lackac/horizon,nullstyle/go-horizon,nullstyle/go-horizon,masonforest/horizon,stella...
src/github.com/stellar/go-horizon/actions_root.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mdbd\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/mdb\"\n\t\"log\"\n)\n\nfunc StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb {\n\treturn startMdbDaemon(mdbFileName, logger)\n}\n\n```\n\nApply this change: A...
go
edit
3
1
apache-2.0
f5bf74361f81fab20c8a59e25f4e7038a05380f1
rgooch/Dominator,Symantec/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,rgooch/Dominator
lib/mdb/mdbd/api.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/zerowidth/alfred-gh-shorthand/alfred\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar input string\n\tif len(os.Args) < 2 {\n\t\tinput = \"\"\n\t} else {\n\t\tinput = os.Args[1]\n\t...
go
edit
0
2
mit
80676500e346b75b91a3b7c73de891e029660bbe
zerowidth/gh-shorthand,zerowidth/gh-shorthand
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage database\n\nimport (\n\t\"github.com/boltdb/bolt\"\n\trss \"github.com/hawx/go-pkg-rss\"\n)\n\ntype Bucket interface {\n\trss.Database\n}\n\ntype bucket struct {\n\tname string\n\tdb *bolt.DB\n}\n\nvar in []byte = []byte(\"in\")\n\nfu...
go
edit
0
2
mit
e0ec43757f559d041d9bab426d5fa27348f8e964
hawx/riviera
river/database/bucket.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"net/http\"\n \"fmt\"\n \"encoding/json\"\n)\n\nfunc handlePing(w http.ResponseWriter, r *http.Request) {\n fmt.Fprint(w, \"OK\")\n}\n\nfunc handleRequest(w http.ResponseWriter, r *http.Request) {\n ty...
go
edit
0
4
mit
f1971811af539a0799064d6bd89785d79b322fef
mhaligowski/paperboy-crawler
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nconst none = 0 // same const identifie...
go
edit
6
0
bsd-3-clause
ed1eb770f0ec882af805b452c904f29db6050110
npe9/noahevans-go9,webfd/go-zh,npe9/noahevans-go9,npe9/noahevans-go9,scirelli/scirelli-go,webfd/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,bryanxu/go-zh,bryanxu/go-zh,d0f/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh,scirelli/s...
test/bugs/bug126.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage system\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\ntype FileSystem struct{}\n\nfunc (self *FileSystem) Walk(root string, step filepath.WalkFunc) {\n\terr := filepath.Walk(root, func(path string, info os.Fi...
go
edit
0
4
mit
57b4eebab3f63c37e892bfd57ca0f719a9b02697
wallclockbuilder/goconvey,zj8487/goconvey,springning/goconvey,wallclockbuilder/goconvey,springning/goconvey,zj8487/goconvey,aquilax/goconvey,yaoshipu/goconvey,wallclockbuilder/convey,ansiz/goconvey,springning/goconvey,ansiz/goconvey,wallclockbuilder/assertions,springning/assertions,zj8487/goconvey,leeola/goconvey,aquil...
web/server/system/file_system.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage monitor\n\nimport \"fmt\"\n\n// Target is a URL, which has to be polled for availability.\ntype Target struct {\n\t// Unique identifier of this target. Targets' IDs cannot intercept. Target's\n\t// ID must be constant between GetTargets...
go
edit
3
2
mit
53539e67f175062c95ab3ee351fb05bcc2c7ed00
yamnikov-oleg/avamon-bot,yamnikov-oleg/avamon-bot
monitor/monitor.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage webapp\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gorilla/csrf\"\n)\n\ntype CSRFMiddleware struct {\n\tKey string\n\tUseInsecureCookie bool\n}\n\nfunc (m *CSRFMiddleware) Handle(next http.Handler) http.Handler {\n\tgori...
go
edit
3
2
apache-2.0
b4109ebcdf58102c456076bf921a45ad396f005c
SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server
pkg/auth/dependency/webapp/csrf_middleware.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc testfprintf() {\n\tf, err := os.Create(\"/tmp/blah\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tbuf := bytes.Buffer{}\n\ts := strings.Builder{}\n\tfmt.Fprintl...
go
edit
0
2
mit
0e51b561eae9a6716e7e73c7220538771ab6f2ed
kisielk/errcheck
testdata/main3.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"net/http\"\n\t\"strconv\"\n)\n\nvar fs http.Handler\n\nfunc main() {\n\t// setup, then parse flags\n\tvar port int\n\tvar host string\n\n\tflag.IntVar(&port, \"port\", 3000, \"The port to bin...
go
edit
3
1
mit
765ea25c049fb91fcaf116204a30b7580dbea674
ciarand/deserv
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"testing\"\n)\n\nfunc TestMain(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tdir, err := os.Getwd()\n\t...
go
edit
15
2
apache-2.0
44c917ee05e63a4f32cec3abc6990f4137a1a08b
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
main/main_suite_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage requests\n\nimport \"github.com/etcinit/gonduit/requests\"\n\n// PhabulousToSlackRequest represets a request to phabulous.toslack.\ntype PhabulousToSlackRequest struct {\n\tUserPHIDs []string `json:\"userPHIDs\"`\n\trequests.Request\n}\...
go
edit
0
0
mit
34c54dde28d2f253f8c7e265150cf64422f1dc1e
etcinit/phabricator-slack-feed,etcinit/phabulous,etcinit/phabulous
app/gonduit/extensions/requests/phabulous_toslack.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n// \"bufio\"\n// \"fmt\"\n//\t\"os\"\n// \"regexp\"\n\n)\n\nfunc findDeviceFromMount (mount string) (string, error) {\n\n // stub for Mac devel\n return \"/dev/xvda\", nil\n /* \n var device string = \"\"\n // ...
go
edit
0
6
mit
c3a633c440d6658490191a819be4f33b909f808a
pforman/ebs-snap
util.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage net\n\nfunc errorLabelValue(err error) string {\n\tif err == nil {\n\t\treturn \"0\"\n\t}\n\treturn \"1\"\n}\n\n```\n\nApply this change: Change values of «error» label." }, { "role": "assistant", "content": "package net\n\n...
go
edit
0
3
mit
9db810bb337191c53e3c548149c3343c63dbb4cc
gophergala2016/gophers,go-gophers/gophers
net/base.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Count lines of input per second on stdin\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\t\"flag\"\n)\n\nfunc readLines(c chan int) {\n\tcount := 0\n\tbio := bufio.NewReader(os.Stdin)\n\tfor {\n\t\t_, more, err := b...
go
edit
0
5
mit
5fb651ea19dce69cf0fba0cfe945cafc5cb1e76f
aerissecure/lps
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ginerus\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/gin-gonic/gin\"\n)\n\nfunc Ginerus() gin.HandlerFunc {\n\treturn GinerusWithLogger(logrus.StandardLogger())\n}\n\nfunc GinerusWithLogger(logg...
go
edit
0
1
mit
0631e1f5e0d86b724410a7dd292551c95d8ccdf7
stephenmuss/ginerus
ginerus.go
accepted
null
true
[ { "role": "user", "content": "Write go code for the following: Test coverage for export template helper" }, { "role": "assistant", "content": "package output\n\nimport (\n\t\"testing\"\n)\n\nfunc TestExport(t *testing.T) {\n\tif r := export(\"\"); r != \"\" {\n\t\tt.Errorf(`Empty input, the same...
go
new_file
9
4
bsd-2-clause
fcf2fb08bc454237d55c88c6e0331735703962fd
runner-mei/goal,runner-mei/goal,runner-mei/goal
generation/output/helpers_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\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/Shyp/bump_version\"\n)\n\nconst VERSION = \"4.1.1\"\n\nfunc usage() {\n\tfmt.Fprintf(os.Stderr, \"Usage: bump_version <major|minor|patch> <fil...
go
edit
0
3
mit
5901da0a257566afd9dd19059ec55bfa3bbc78c6
Shyp/bump_version
bump_version/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage nessusProcessor\n\n// PolicyViolationMatchCriteria holds what criteria should be checked when checking for a\n// policy violation.\ntype PolicyViolationMatchCriteria struct {\n\tExternallyAccessible bool\n\tIgnoreViolationWi...
go
edit
0
0
apache-2.0
abcb562402dffca3006b3e20273841c0293c21cf
kkirsche/nessusControl
resultProcessor/structsMatchCriteria.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage asciidocgo\n\nimport (\n\t\"testing\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nvar dm = new(Document).Monitor()\nvar dnm = new(Document)\nvar notMonitoredError = &NotMonitoredError{\"test\"}\n\nfunc TestDocumentMonitor(t ...
go
edit
27
2
mit
11d69ff86621a407de96ed5562e3df58d411d873
VonC/asciidocgo,bep/asciidocgo
document_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage io_test\n\nimport (\n\t\"os\"\n\n\t. \"github.com/cloudfoundry/cli/testhelpers/io\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"io helpers\", func() {\n\tIt(\"will never overflow the pipe\", ...
go
edit
0
2
apache-2.0
bf9afc53bd061aa9ecf2805a313305eb5d01228d
cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli
testhelpers/io/io_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage github\n\nimport (\n\t\"context\"\n)\n\ntype Repo struct {\n\tName *string `json:\"name, omitempty\"`\n}\n\nfunc (github *Client) Repos(user string) ([]*Repo, error) {\n\tctx := context.Background()\n\n\trepos, _, err := github.client.R...
go
edit
6
3
mit
ace7cf53104f050034a239d462a12d56cfd1368d
proshik/githubstatbot,proshik/githubstatbot
github/repository.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tagreplication\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"code.uber.internal/infra/kraken/core\"\n\t\"code.uber.internal/infra/kraken/utils/randutil\"\n\t\"code.uber.internal/infra/kraken/utils/testuti...
go
edit
12
3
apache-2.0
759cbd58e1770a7e3c176e9e1727805640d9247e
uber/kraken,uber/kraken,uber/kraken,uber/kraken,uber/kraken
lib/persistedretry/tagreplication/fixtures.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage turtle\n\n// Version of the turtle library\nconst Version = \"v0.1.0\"\n\n// Emojis maps a name to an Emoji\nvar Emojis = make(map[string]*Emoji)\n\n// EmojisByChar maps a character to an Emoji\nvar EmojisByChar = make(map[string]*Emoji...
go
edit
24
2
mit
c7d2135698065951b052631de42bfdea3983bf06
hackebrot/turtle
turtle.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sack\n\nimport (\n\t\"fmt\"\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc shellInit(c *cli.Context) {\n\tsh := `\n sack=$(which sack)\n\n alias S=\"${sack} -s\"\n alias F=\"${sack} -e\"\n `\n\n\tfmt.Println(sh)\n}\n\nfunc she...
go
edit
0
1
mit
8d4a94bd00f829b4d290625a6870ca30f2614e5f
zph/go-sack,zph/go-sack
sack/shell_init.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2017 The Hugo Authors. All rights reserved.\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\...
go
edit
3
4
apache-2.0
37438757788d279c839506d54f460b2ab37db164
fedelibre/hugo,gohugoio/hugo,mdhender/hugo,gohugoio/hugo,anthonyfok/hugo,gohugoio/hugo,fedelibre/hugo,mdhender/hugo,fedelibre/hugo,anthonyfok/hugo,mdhender/hugo,fedelibre/hugo,anthonyfok/hugo,mdhender/hugo
tpl/tplimpl/amber_compiler.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage log_test\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n)\n\nfunc ExampleLogger_LogRequest() {\n\tl := log.New(\"development\")\n\th := l.LogRequest(\"testserver\")(http.HandlerFunc(func(_ http.ResponseWriter, _ *http....
go
edit
0
1
mit
bd5ebd96d250ee7108b1b22688eb14546a618b1a
vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate
pkg/common/log/example_test.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)\n\nfunc main() {\n\thttp.HandleFunc(\"/\", handler)\n\tlog.Fatal(http.ListenAndServe(\"localhost:8000\", nil))\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tfmt...
go
edit
0
4
mit
7c14876990f9fa0b204a25aa1333613e75296611
jimlawton/gopl
ch1/server/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hdfs\n\nimport (\n\t\"os\"\n\t\"syscall\"\n)\n\nconst (\n\tfileNotFoundException = \"java.io.FileNotFoundException\"\n\tpermissionDeniedException = \"org.apache.hadoop.security.AccessControlException\"\n\tpathIsNotEmptyDirExceptio...
go
edit
0
6
mit
aa9e4840c5789a65d2fd9c35d5475b01360dc7bf
ashishgandhi/hdfs,ashishgandhi/hdfs,colinmarc/hdfs,colinmarc/hdfs
error.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
4
mit
301bd192d1f81ed0eb95d86f8eb028586e8dbf6b
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\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nvar output string\n\nfunc init() {\n\tflag.Usage = func() {\n\t\tfmt.Printf(\"Usage: %s [-out=out.path] in.path\\n\\n\", os.Args[0])\n\t\tflag.PrintDefaults()\n\t}\n...
go
edit
0
3
mit
d1f45de88f0c5fe6b27fde59015b156294bda1be
konjoot/go-inspect
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build lambdabinary\n\npackage sparta\n\n// Provides NOP implementations for functions that do not need to execute\n// in the Lambda context\n\nimport (\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc Delete(serviceNam...
go
edit
9
1
mit
2276e12adf11903225eec3ee2b33c6195685eab0
mweagle/Sparta,mweagle/Sparta,mweagle/Sparta,mweagle/Sparta
lambdabinaryshims.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build go1.8\n\npackage avatica\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n)\n\ntype namedValue struct {\n\tName string\n\tOrdinal int\n\tValue driver.Value\n}\n\nfunc driverValueToNamedValue(values []driver.Value) []namedValue ...
go
edit
0
3
apache-2.0
2e145609dbccdae3f245b9699bab5d550de591c1
Boostport/avatica,Boostport/avatica
compat_go18.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage aranGO\n\n// Configure to start testing\nvar (\n\tTestCollection = \"\"\n\tTestDoc DocTest\n\tTestDbName = \"\"\n\tTestUsername = \"\"\n\tTestPassword = \"\"\n\tTestString = \"test string\"\n\tverbose = false\n...
go
edit
6
0
apache-2.0
094bc9c35b9711ea101138af9cd7cc4aa464b1f9
diegogub/aranGO
config_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage clang\n\n// #cgo LDFLAGS: -lclang\n// #cgo linux CFLAGS: -I.\nimport \"C\"\n\n//EOF\n\n```\n\nApply this change: Add the repository root to CFLAGS -I\n\nWe are compiling this under MacOSX. Removing the \"linux\" constraint solved our co...
go
edit
0
0
bsd-2-clause
7486296ced4144579eb8d02c2931870d37056b00
surullabs/go-clang,sbinet/go-clang,surullabs/go-clang,sbinet/go-clang
cgoflags.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage app\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/urfave/cli\"\n\n\t\"github.com/appPlant/alpinepass/src/filters\"\n\t\"github.com/appPlant/alpinepass/src/io\"\n\t\"github.com/appPlant/alpinepass/src/util\"\n\t\"github.c...
go
edit
0
4
apache-2.0
ed994e1fe2ae37e6e5c9a8bff5db021af5e154ad
appPlant/alpinepass,appPlant/alpinepass
src/app/execution.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"hagerbot.com/vox\"\n \"time\"\n)\n\nfunc main() {\n err := vox.Init(\"\", 44100, 2, 0)\n if err != nil {\n panic(err)\n }\n defer vox.Quit()\n\n println(vox.Version)\n\n song, err := v...
go
edit
0
4
bsd-2-clause
2ccc308efac8988744e595f759464c2bbcb92904
ajhager/vox,ajhager/vox
demos/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestFibonacci(t *testing.T) {\n\ttcs := map[string]struct {\n\t\tn int\n\t\texpected int\n\t}{\n\t\t\"n = 1\": {1, 1},\n\t\t\"n = 2\": {2, 1},\n\t\t\"n = 50\": {50, 12586269025},\n\t\t\"n =...
go
edit
3
3
cc0-1.0
deb89e2191301c40a58fb67ab02331d9859300fe
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
dp/fibonacci/go/fibonacci_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apac...
go
edit
0
2
apache-2.0
8819410721824ce2557617419905398aa75cee1f
google/kf,google/kf,google/kf
cmd/kf/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fate\n\nimport \"strings\"\n\n// Stemmer normalizes a string to its stem.\ntype Stemmer interface {\n\tStem(string) string\n}\n\ntype stemFunc func(string) string\n\nfunc (s stemFunc) Stem(str string) string {\n\treturn s(str)\n}\n\n// ...
go
edit
0
2
mit
c2fe954e806086fe16ac318dc078914d0a715d54
pteichman/fate
stemmer.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"bytes\"\n)\n\n// ClosingBuffer implement Closer interface for Buffer\ntype ClosingBuffer struct {\n\t*bytes.Buffer\n}\n\n// Close implement Closer interface for Buffer\nfunc (ClosingBuffer) Close() error {\n\tretu...
go
edit
0
1
mit
1db70d420169efbde41b768ca8a4d24ec2162ac1
qor/qor,qor/qor,qor/qor
utils/buffer.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Direct IO for darwin\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n)\n\nconst (\n\t// OSX doesn't need any alignment\n\tAlignSize = 0\n)\n\nfunc OpenFile(name string, flag int, perm os.FileMode) (file *os.File, err error) ...
go
edit
3
3
mit
cd5de9eb93772540bc8d72de87c1b5883c3d0460
ncw/stressdisk
direct_io_darwin.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage jap\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestGoogleHandlerPanicsWithoutCID(t *testing.T) {\n\tdefer func() {\n\t\tif r := recover(); r == nil {\n\t\t\tt.Error(\"Expected GoogleLogin to panic if CID mis...
go
edit
6
2
bsd-2-clause
a6c9aa2d29e727ff0ea252a2040fd347e0c07e80
jitsi/jap,jitsi/jap
google_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage workq\n\nimport \"sync\"\n\ntype Queue struct {\n\titems []*Item\n\tmutex sync.Mutex\n}\n\nfunc (q *Queue) Push(item *Item) {\n\tq.mutex.Lock()\n\tdefer q.mutex.Unlock()\n\n\tq.items = append(q.items, item)\n\tgo item.Translate()\n}\n\n...
go
edit
9
2
mit
499e64eac56f7c6563ea3ca028c0d19d9f9718e8
MStoykov/mazungumzo
workq/queue.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fs\n\nimport (\n\t\"testing\"\n\n\t\"github.com/robertkrimen/otto\"\n)\n\nfunc TestFS(t *testing.T) {\n\tvm := otto.New()\n\tvm.Set(\"error\", func(call otto.FunctionCall) otto.Value {\n\t\tname, _ := call.Argument(0).ToString()\n\t\tt....
go
edit
3
2
mit
d97eec611f2048911f229909ea6d49c22ca6d035
gernest/wuxia,gernest/wuxia,gernest/wuxia,gernest/wuxia
modules/fs/fs_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/neilvallon/cmplr/project\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tcfg, err := project.ReadConfig()\n\tif err != nil {\n\t\tpanic(\"Error parsing config file.\")\n\t}\n\n\tfmt.Printf(\"Project: %s\\n\", cfg.Pr...
go
edit
0
4
mit
1f47358226bda2017dc37720fc7e1666ae2a4b06
neilvallon/Cmplr
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/url\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/lxc/lxd/client\"\n)\n\ntype cmdImport struct {\n\tglobal *cmdGlobal\n\n\tflagForce bool\n\tflagProject string\n}\n\nfunc (c *cmdImp...
go
edit
3
1
apache-2.0
2b404dbe33ca5562ef5ac67b8040a4b86a067cb4
lxc/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,atxwebs/lxd,hallyn/lxd,hallyn/lxd,lxc/lxd,hallyn/lxd,lxc/lxd,atxwebs/lxd,hallyn/lxd,stgraber/lxd,lxc/lxd,hallyn/lxd,stgraber/lxd,atxwebs/lxd,atxwebs/lxd,lxc/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd,stgraber/lxd,stgraber/lxd
lxd/main_import.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage daemon\n\nimport (\n\t\"io\"\n\t\"testing\"\n\n\t\"src.elv.sh/pkg/daemon/daemondefs\"\n\t\"src.elv.sh/pkg/testutil\"\n)\n\nfunc TestActivate_WhenServerExists(t *testing.T) {\n\tsetup(t)\n\tstartServer(t)\n\t_, err := Activate(io.Discard...
go
edit
21
2
bsd-2-clause
7f8ab450a5fc5a210bdfa4eb54ac1735e3d1a4c1
elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish
pkg/daemon/activate_test.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\nconst (\n\tEventPush = \"push\"\n\tEventPull = \"pull_request\"\n\tEventTag = \"tag\"\n\tEventDeploy = \"deployment\"\n)\n\nconst (\n\tStatusSkipped = \"skipped\"\n\tStatusPending = \"pending\"\n\tStatusRunning = \"runni...
go
edit
0
0
apache-2.0
c60f4f5c4be6769f1cdbf05712d295bc9238ccdb
vaijab/drone,masarakki/drone,bsauvajon/drone,vtolstov/drone,donatj/drone,donatj/drone,masarakki/drone,NamPNQ/drone,carnivalmobile/drone,vaijab/drone,NamPNQ/drone,donatj/drone,bsauvajon/drone,vtolstov/drone,lins05/drone,veghead/drone,carnivalmobile/drone,veghead/drone,carnivalmobile/drone,lins05/drone
model/const.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cryptopals\n\nimport \"math/big\"\n\ntype privateKey struct {\n\te *big.Int\n\tn *big.Int\n\td *big.Int\n}\n\ntype publicKey struct {\n\te *big.Int\n\tn *big.Int\n}\n\nfunc generateRsaPrivateKey(bits int) *privateKey {\n\tp := randPrime...
go
edit
6
4
mit
1b6a07ca98ce4b6630a1a8fca288aac9837345c5
Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go
rsa.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage nimble\n\ntype Pixel uint32\n\nconst (\n\talphaShift = 24\n\tredShift = 16\n\tgreenShift = 8\n\tblueShift = 0\n)\n\nfunc component(c float32) Pixel {\n\treturn Pixel(c*255 + (0.5 - 1.0/256))\n}\n\n// RGB constructs a Pixel from its ...
go
edit
0
1
apache-2.0
0bf0ec4ab65777753fb87d3dc3cdf4204349e84d
ArchRobison/Gophetica
nimble/Color.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gospel\n\nimport \"testing\"\n\nfunc TestDescribe(t *testing.T) {\n\tDescribe(t, \"gospel.Expectation#ToEqual\", func(context Context, it It) {\n\t\tcontext(\"with 1 & 1\", func() {\n\t\t\tit(\"compares integers by ==\", func(expect Exp...
go
edit
18
1
mit
7ec75cab4de3ebcae40b90076b893b74bd08e3da
r7kamura/gospel
gospel_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage twitterbot\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/ChimeraCoder/anaconda\"\n)\n\ntype TBot struct {\n\tapi *anaconda.TwitterApi\n\tkeys *Keys\n}\n\nfunc New(config string) (*TBot, error) {\n\tkeys, err := ReadConfig(config...
go
edit
3
4
mit
4cc944bb3ac0e56e31524943e51afc0c6349ea76
timwilkens/twitterbot
generate_bot.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gofakeit\n\nimport \"testing\"\n\nfunc TestRandIntRange(t *testing.T) {\n\tif randIntRange(5, 5) != 5 {\n\t\tt.Error(\"You should have gotten 5 back\")\n\t}\n}\n\nfunc TestGetRandValueFail(t *testing.T) {\n\tif getRandValue([]string{\"n...
go
edit
12
2
mit
77c0614b21649263e59a5bd61d60ebdcf75dc16d
brianvoe/gofakeit
misc_test.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage goluago\n\nimport (\n\t\"github.com/Shopify/go-lua\"\n\t\"github.com/Shopify/goluago/encoding/json\"\n\t\"github.com/Shopify/goluago/regexp\"\n\t\"github.com/Shopify/goluago/strings\"\n)\n\nfunc Open(l *lua.State) {\n\tregexp.Open(l)\n\...
go
edit
3
1
mit
9cdd2bae74534668c45e561bd266a2518bcf9c3c
Shopify/goluago,Shopify/goluago
goluago.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mayaclient\n\nimport \"testing\"\n\nfunc TestMayaClient(t *testing.T) {\n\tinstanceID := \"\\\"any-compute\\\"\"\n\tc := Client{URL: \"http://127.0.0.1:5656/latest/meta-data/instance-id\"}\n\n\tresponse := c.MayaClient()\n\tif response ...
go
edit
3
2
apache-2.0
cf147b5746d4d323fbca2ffb3bf479965146b754
satyamz/mayaclient
client_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage asyncpi\n\n//go:generate go tool yacc -p asyncpi -o parser.y.go asyncpi.y\n\nimport \"io\"\n\n// Lexer for asyncpi.\ntype Lexer struct {\n\tscanner *Scanner\n\tErrors chan error\n}\n\n// NewLexer returns a new yacc-compatible lexer.\nf...
go
edit
15
1
apache-2.0
35328eeaa96910031af7f667559e2f992d6ac010
nickng/asyncpi
lexer.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gpsutil\n\nimport (\n\t\"math\"\n)\n\ntype LatLng struct {\n\tlat float64\n\tlng float64\n}\n\nfunc (latlng *LatLng) Lat() float64 {\n\treturn latlng.lat\n}\n\nfunc (latlng *LatLng) Lng() float64 {\n\treturn latlng.lng\n}\n\ntype Geohas...
go
edit
0
1
mit
026ef6da6aa58df7488c8a374c979926554445ba
vanng822/gpsutil
gpsutil.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage matrix\n\nimport \"point\"\n\ntype Matrix [8][8]byte\n\nvar starting = Matrix{\n\t{'r', 'n', 'b', 'k', 'q', 'b', 'n', 'r'},\n\t{'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p'},\n\t{' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},\n\t{' ', ' ', ' ', ' '...
go
edit
0
4
mit
743ec61addb8426bf8692a5c63c830c393bd5f12
Roadagain/Chess
src/matrix/matrix.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2011 Google Inc. 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// The uuid package generates and inspects UUIDs.\n//\n// UUIDs are based on RFC 41...
go
edit
0
0
bsd-3-clause
a0cb02c4ea2aee903bad6b7762887e1830337e77
yxd-hde/uuid,pborman/uuid
doc.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage piglatin\n\nimport \"strings\"\n\nfunc Sentence(sentence string) string {\n\tif startsWithVowel(sentence) ||\n\t\tstrings.HasPrefix(sentence, \"xr\") ||\n\t\tstrings.HasPrefix(sentence, \"yt\") {\n\t\treturn sentence + \"ay\"\n\t}\n\tre...
go
edit
0
5
mit
e426c2fd3d932a3fe6cbc5d054c46d73e6eefe02
rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism
go/pig-latin/pig_latin.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage plist\n\n// #include <CoreFoundation/CoreFoundation.h>\nimport \"C\"\nimport \"reflect\"\nimport \"strconv\"\n\n// An UnsupportedTypeError is returned by Marshal when attempting to encode an\n// unsupported value type.\ntype Unsupported...
go
edit
9
1
bsd-3-clause
ea6091c031f366da49f1357136357956e7008e42
kballard/go-osx-plist
errors.go
rejected_lint
Too many lint violations: 9
true