messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/pterodactyl/wings/parser\"\n\t\"sync\"\n)\n\n// Parent function that will update all of the defined configuration files for a server\n// automatically to ensure that they always use the specified value... | go | edit | 3 | 3 | mit | 5366d0f6520765b658f89d90f161f78378bbeccb | Pterodactyl/wings,Pterodactyl/wings | server/config_parser.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package spamc is a client library for SpamAssassin's spamd daemon.\n//\n// The protocol specification can be found here:\n// http://svn.apache.org/repos/asf/spamassassin/trunk/spamd/PROTOCOL\npackage spamc\n\n```\n\nApply this change: Enforc... | go | edit | 0 | 0 | mit | a9a54676032829724be1a414d73fa95f2cb337d6 | Teamwork/go-spamc,xepa/go-spamc,xepa/go-spamc,Teamwork/go-spamc | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/docker/api/client\"\n)\n\ntype rmOpts struct {\n\tforce bool\n}\n\n// RmCommand deletes containers\nfunc RmCommand(... | go | edit | 0 | 5 | apache-2.0 | 507caabf49c71fd1b2a1f789d781d9ec6b99abc9 | docker/compose,docker/compose,docker/compose | cli/cmd/rm.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tests\n\nimport \"github.com/robfig/revel\"\n\ntype ApplicationTest struct {\n\trevel.TestSuite\n}\n\nfunc (t ApplicationTest) Before() {\n\tprintln(\"Set up\")\n}\n\nfunc (t ApplicationTest) TestThatIndexPageWorks() {\n\tt.Get(\"/\")\n... | go | edit | 9 | 1 | mit | c88d46cf5c3340e1f02f32f218ef183acbae3eb6 | birkirb/revel,mattbaird/revel,zacklin923/revel,jmptrader/revel,cokeboL/revel,cavaliercoder/revel,huacnlee/revel,pathirana/revel,imjerrybao/revel,salixvideo/revel,folpindo/revel,veliamsli/revel,w4ngyi/revel,jmptrader/revel,hustbill/revel,lgscofield/revel,tempbottle/revel,revel/revel,shima-park/revel,roblillack/mars,lgsc... | samples/booking/tests/apptest.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage context\n\n//Setup calls all provided setup functions and return all raised errors\nfunc Setup(setupFuncs ...SetupFunc) []error {\n\tvar errs []error\n\tfor _, v := range setupFuncs {\n\t\tif err := v(); err != nil {\n\t\t\terrs = appen... | go | edit | 3 | 3 | mit | 45302a1da26980d53a61f3dfa71697edb1e17a65 | rjansen/haki | context.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage appcast\n\nimport \"io/ioutil\"\n\n// LocalSourcer is the interface that wraps the LocalSource methods.\ntype LocalSourcer interface {\n\tSourcer\n\tFilepath() string\n}\n\n// LocalSource represents an appcast source from the local file... | go | edit | 18 | 2 | mit | 7d7fc6d217e916c0e1f469cf064c911764ff4571 | victorpopkov/go-appcast | local_source.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 The OPA Authors. All rights reserved.\n// Use of this source code is governed by an Apache2\n// license that can be found in the LICENSE file.\n\npackage storage\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n)\n\n// Dump writes... | go | edit | 9 | 2 | apache-2.0 | 747580ae4a2ff7e65398e815eef60b45fe87491a | timothyhinrichs/opa,open-policy-agent/opa,Eva-xiaohui-luo/opa,tsandall/opa,open-policy-agent/opa,tsandall/opa,timothyhinrichs/opa,tsandall/opa,timothyhinrichs/opa,tsandall/opa,Eva-xiaohui-luo/opa,open-policy-agent/opa,tsandall/opa,tsandall/opa,timothyhinrichs/opa,open-policy-agent/opa,open-policy-agent/opa,Eva-xiaohui-... | storage/dump.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metrics\n\nimport (\n\t\"encoding/json\"\n\t\"net/url\"\n\t\"os/exec\"\n\n\t\"github.com/cerana/cerana/acomm\"\n)\n\n// Hardware returns information about the hardware.\nfunc (m *Metrics) Hardware(req *acomm.Request) (interface{}, *url.... | go | edit | 3 | 3 | mit | 647f1b48893f42ab016ee7f9cfea692615145cbe | cerana/cerana,cerana/cerana,cerana/cerana,cerana/cerana | providers/metrics/hardware.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright IBM Corp. All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n*/\n\npackage privdata\n\nimport \"github.com/hyperledger/fabric/protos/ledger/rwset\"\n\n// SerializedPolicy defines a persisted policy\ntype SerializedPolicy... | go | edit | 0 | 0 | apache-2.0 | 0461b24a25b1aca05adb282cf0fed557f25a6ec6 | lukehuangch/fabric,muralisrini/fabric,manish-sethi/fabric-sidedb,muralisrini/fabric,ckeyer/fabric,lukehuangch/fabric,lukehuangch/fabric,binhn/fabric,mqshen/fabric,jimthematrix/fabric,ckeyer/fabric,manish-sethi/fabric-sidedb,binhn/fabric,manish-sethi/fabric-sidedb,xixuejia/fabric,ckeyer/fabric,lukehuangch/fabric,mqshen/... | core/common/privdata/policies.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cryptanalysis\n\nimport ()\n\n\nfunc Chunk(data []byte, size int) [][]byte {\n var chunks [][]byte\n\n for i:=0; i<len(data); i=i+size {\n chunks = append(chunks, data[i:i+size])\n }\n\n return chunks\n}\n\n\nfunc Tra... | go | edit | 0 | 3 | bsd-3-clause | 2c5dddc7f190e9edddd2296182b88e0212fa8069 | averagesecurityguy/cryptanalysis | transform.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/alex1sz/shotcharter-go/utilities\"\n\t// gorilla/mux used for req params\n\t// \"github.com/gorilla/mux\"\n\t// \"log\"\n\t\"net/http\"\n\t// neccessary to catch sql.ErrNoRows... | go | edit | 6 | 3 | mit | f2cd35ad5c7b793475c8647230683d713676b205 | Alex1sz/shotcharter-go-api | controllers/shot_controller.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage turms\n\nimport (\n\t\"golang.org/x/net/context\"\n)\n\n// A Chain is a chain of Handlers. It implements a Handler.\n// Chains can be nested.\ntype Chain []Handler\n\n// Handle calls each chain element Handle function subsequently.\nfun... | go | edit | 6 | 4 | mit | 348b34b8072000c614740c1981c6900033321c65 | marshauf/turms | chain.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage search\n\ntype search struct {\n\tKeyword string\n\tPagenation int\n\tSort string\n}\n\nfunc New(keyword string, sort string) *search {\n\treturn &search{\n\t\tKeyword: keyword,\n\t\tPagenation: 0,\n\t\tSort: sort,\n\t... | go | edit | 0 | 1 | apache-2.0 | 5c95bc4528b2bc0dcd9bb1609e28ee0fa0d7008c | wataru0225/sreq | search/new_search.go | rejected_duplicate | Near-duplicate of sample 118352 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2012, 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// Package ioutil2 provides extra functionality along similar lines to io/ioutil.\n... | go | edit | 0 | 6 | apache-2.0 | 6619cd089593564d3e438b02fe64e9400a7de7e7 | anusornc/vitess,HubSpot/vitess,skyportsystems/vitess,SDHM/vitess,dcadevil/vitess,HubSpot/vitess,applift/vitess,AndyDiamondstein/vitess,aaijazi/vitess,mlc0202/vitess,SDHM/vitess,atyenoria/vitess,tirsen/vitess,anusornc/vitess,HubSpot/vitess,yangzhongj/vitess,atyenoria/vitess,alainjobart/vitess,xgwubin/vitess,anusornc/vit... | go/ioutil2/ioutil.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/alex1sz/shotcharter-go/utilities\"\n\t\"github.com/gorilla/mux\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/alex1sz/shotcharter-go/models\"\n)\n\n// GET /games/:id\nfunc Get... | go | edit | 9 | 4 | mit | cb7937baed0a0057305e347315b6ba9cdf55d8d4 | Alex1sz/shotcharter-go-api | controllers/game_controller.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Albert Nigmatzianov. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage util\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\... | go | edit | 0 | 3 | mit | a1737718dc644e736fd6023d6ba465edea3654ee | bogem/nehm | util/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n)\n\n// a function that provides a means to retrieve a token\ntype TokenGetter func() (string, error)\n\n// goes through the provided TokenGetter chai... | go | edit | 0 | 4 | isc | 12a6d86a2f7fc26d100cbb6118e91c7f2eab6b67 | ciarand/sinkship | token.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/gorilla/websocket\"\n)\n\ntype Message struct {\n\tName string `json:\"name\"`\n\tData interface{} `json:\"data\"`\n}\n\ntype FindHandler func(string) (Handler, bool)\n\ntype Client struct {\n\tsend... | go | edit | 3 | 4 | mit | 27790cd250ad2f97a25884d678f4afcec25eb8f0 | MajorMJR/factorio-server-manager,MajorMJR/factorio-server-manager,sean-callahan/factorio-server-manager,sean-callahan/factorio-server-manager,MajorMJR/factorio-server-manager,sean-callahan/factorio-server-manager,sean-callahan/factorio-server-manager,MajorMJR/factorio-server-manager | src/wsclient.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage systemt\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestDaemonize(t *testing.T) {\n\tDaemonize(func() {})\n\tassert.Equal(t, 1, len(ds))\n}\n\nfunc TestRunDaemons(t *testing.T) {\n\tc := make(chan b... | go | edit | 12 | 2 | mit | 72cf3dd92020b63df59d8bbe917c5c88b93233e4 | raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp,tisp-lang/tisp | src/lib/systemt/daemon_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"fmt\"\n\tctypes \"github.com/tendermint/tendermint/rpc/core/types\"\n\t\"github.com/tendermint/tendermint/types\"\n\ttmsp \"github.com/tendermint/tmsp/types\"\n)\n\n//-----------------------------------------------... | go | edit | 9 | 2 | apache-2.0 | 6a209ba3a8c283fb2ffe78182675ad00be22c878 | tendermint/tendermint,tendermint/tendermint,tendermint/tendermint,tendermint/tendermint | rpc/core/mempool.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dbServices\n\nimport (\n\t\"github.com/DanielRenne/GoCore/core/extensions\"\n\t\"reflect\"\n)\n\n//GetIndexes provides a way to reflect on your structure to get structs tagged with `dbIndex`.\n//This function is used to generate Indexes... | go | edit | 0 | 6 | mit | a5a2e7a8d09bdc1ce3eff0634cbac6b6c2ddcb8e | DanielRenne/GoCore,DanielRenne/GoCore | core/dbServices/indexHelper.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage uuid\n\nimport (\n\t\"regexp\"\n\n\t\"github.com/tonyhb/govalidate/helper\"\n\t\"github.com/tonyhb/govalidate/rules\"\n)\n\nfunc init() {\n\trules.Add(\"UUID\", UUID)\n}\n\n// Used to check whether a string has at most N characters\n// ... | go | edit | 0 | 3 | mit | 82fa7d2a2a42bf7e32b943e578cdee406cfe8270 | tonyhb/govalidate | rules/uuid/uuid.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"syscall\"\n)\n\nvar BASH_SCRIPT = `\nDIR=\"$(cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd)\"\nCOMMAND=\"$@\"\ntrap \"rm -f ${DIR}/$$.stderr\" EXIT\nfor i in {1..10}; do\n\tSEEN=0\n\t... | go | edit | 0 | 4 | apache-2.0 | 8884885a3d96d79a9f0cfae1d807233f53f32f67 | control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced | utils/nsinit.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage trousseau\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// Global data store file path\nvar gStorePath string\nfunc SetStorePath(storePath string) { gStorePath = storePath }\nfunc GetStorePath() string { return gStorePath }\... | go | edit | 6 | 1 | mit | ddcd844fe8317ebd0db3279c0e15333a0a5e0ff9 | tomykaira/trousseau,oleiade/trousseau,oleiade/trousseau,tomykaira/trousseau,tomykaira/trousseau,mrnugget/trousseau,mrnugget/trousseau,mrnugget/trousseau | globals.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack\n\n// reactionItem is a lighter-weight item than is returned by the reactions list.\ntype reactionItem struct {\n\tType string `json:\"type\"`\n\tChannel string `json:\"channel,omitempty\"`\n\tFile string `json:\... | go | edit | 0 | 0 | bsd-2-clause | b226e70fe599e7548a1cc934fed12523011b01bd | nlopes/slack,james-lawrence/slack,178inaba/slack | websocket_reactions.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage configuration\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n)\n\ntype Configuration struct {\n\tTestObjects []TestObject `json:\"testObjects\"`\n}\n\ntype TestObject struct {\n\tURL string `json:\"url\"`\n\tMatchString stri... | go | edit | 3 | 2 | mit | cad18db860c9488a41f0807b580876df428b4ad5 | jvikstedt/alarm-bot | configuration/configuration.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/client\"\n\t\"github.com/docker/docker/cli\"\n\t\"github.com/spf13/cobra\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc newRemoveCommand(dockerCli *client.D... | go | edit | 0 | 4 | apache-2.0 | cf61cd3a920809f6a0be44a584f365544acaf1a9 | konstruktoid/docker-1,tagomoris/docker,dims/docker,13W/docker,konstruktoid/docker-upstream,POLJM242/docker,maxamillion/docker,sarnautov/moby,tonistiigi/docker,duglin/docker,crosbymichael/docker,xiekeyang/docker,mike1729/docker,duglin/docker,akira-baruah/docker,dongjoon-hyun/docker,mahak/docker,KarthikNayak/docker,ndelo... | api/client/service/remove.go | rejected_duplicate | Near-duplicate of sample 118397 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add test functions for allocate a cache instance."
},
{
"role": "assistant",
"content": "package negronicache\n\nfunc TestCache_NewMemoryCache(t testing.T) {\n c := NewMemoryCache()\n assert.NotNil(t, c.fs)\n assert.NotNil(t... | go | new_file | 21 | 1 | apache-2.0 | b5cf04e6709bca6c29d1b42d4ae9a0fa6d02c222 | trumanw/negroni-cache,trumanw/negroni-cache | cache_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clean\n\nimport (\n\t\"flag\"\n\t\"os\"\n\n\t\"github.com/tueftler/doget/command\"\n\t\"github.com/tueftler/doget/config\"\n\t\"github.com/tueftler/doget/dockerfile\"\n)\n\n// CleanCommand allows to remove the vendor directory and all o... | go | edit | 0 | 2 | bsd-3-clause | b98147f60ac2de7dc2ee77b21d252eafae1af9dc | tueftler/doget,tueftler/doget | command/clean/command.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gotwilio\n\ntype SmsResponse struct {\n\tSid string\n\tDateCreated string // TODO: Change this to date type if possible\n\tDateUpdate string // TODO: Change this to date type if possible\n\tDateSent string // TODO: Change th... | go | edit | 6 | 3 | bsd-2-clause | 4f658348d5d5c920968b77c24b7d402f52b7f87c | metcalf/gotwilio,sfreiberg/gotwilio | sms.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage medtronic\n\nconst (\n\tbutton Command = 0x5B\n)\n\n// PumpButton represents a key on the pump keypad.\ntype PumpButton byte\n\n//go:generate stringer -type PumpButton\n\n// Pump button codes.\nconst (\n\tBolusButton PumpButton = 0\n\tE... | go | edit | 6 | 1 | mit | 4a0da1a38f4a6e698de2e443003cc04da69839c6 | ecc1/medtronic,ecc1/medtronic | button.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\nimport \"os\"\nimport \"os/exec\"\nimport \"strconv\"\n\nfunc main() {\n fmt.Println(\"Ding!\")\n cmd := exec.Command(\"paplay\", \"/usr/share/sounds/freedesktop/stereo/complete.oga\")\n cmd.Start()\n\n ... | go | edit | 6 | 2 | mit | 2b3880458f679539bca35bc1f3d98b82258606df | Cosiek/ding | src/main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/mkideal/cli\"\n)\n\ntype argT struct {\n\tcli.Helper\n\tConfig string `cli:\"*c,config\" usage:\"Config file\"`\n}\n\nfunc (argv *argT) Validate(ctx *cli.Context) error {\n\tif _, ... | go | edit | 0 | 5 | bsd-2-clause | 592893f3f541ba144b9c79b1183b72c2f893aa57 | eripa/ba_checker,eripa/ba_checker | ba_checker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"math/rand\"\nimport \"time\"\n\ntype Plug struct {\n\tID int\n\tS3ID string\n\tOwner string\n\tViewsRemaining int\n}\n\nfunc ChoosePlug(plugs []Plug) Plug {\n\trand.Seed(time.Now().Unix())... | go | edit | 0 | 5 | mit | 223e789405b8c754f6135204ea1a8f852c74bc63 | liam-middlebrook/csh-plug | plug.go | rejected_duplicate | Near-duplicate of sample 116934 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vlc\n\n// #cgo LDFLAGS: -lvlc\n// #include <vlc/vlc.h>\n// #include <stdlib.h>\nimport \"C\"\nimport \"errors\"\n\nfunc getError() error {\n\tmsg := C.libvlc_errmsg()\n\tif msg != nil {\n\t\treturn errors.New(C.GoString(msg))\n\t}\n\n\t... | go | edit | 3 | 2 | mit | 31e378cda07d03d37511665a9e8cc3cf4d17c62e | adrg/libvlc-go | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gobrake\n\nimport (\n\t\"time\"\n\n\t\"github.com/jonboulle/clockwork\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar fakeClock = clockwork.NewFakeClock()\n\nfunc init() {\n\tclock = fakeClock\n}\n\nvar _ = D... | go | edit | 24 | 1 | mit | d7c0ed9885faf74b55c08fd68dc466434818ebcd | airbrake/gobrake | route_trace_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/linkosmos/gotldmap\"\n)\n\nfunc lastMark() (last int) {\n\tfor _, mark := range gotldmap.Map {\n\t\tif mark > last {\n\t\t\tlast = mark\n\t\t}\n\t}\n\tr... | go | edit | 0 | 5 | bsd-3-clause | d4d62d20819a4d9b6356de7ad57ba9b8093cbdcb | linkosmos/gotldmap,linkosmos/gotldmap | generator/convert.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dom\n\n// Node - Node interface\ntype Node interface{}\n\n// TextNode - a basic dom node\ntype TextNode struct {\n\tchildren string\n}\n\n// ElementNode - an html element consists of tagName and attributes\ntype ElementNode struct {\n\t... | go | edit | 0 | 1 | mit | 5eb90cd6f2d564fae0ba13901e3c0fe1d0ffccf2 | Rhadow/go_toy | browser_engine/dom.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sctp\n\nimport (\n\t\"github.com/pkg/errors\"\n)\n\n/*\nchunkCookieAck represents an SCTP Chunk of type chunkCookieAck\n\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4... | go | edit | 12 | 3 | mit | c9997b4721e100cb7bb28962e624ed5f18dccd76 | pion/webrtc,pion/webrtc,pion/webrtc,pion/webrtc | internal/sctp/chunk_cookie_ack.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc testServer() *httptest.Server {\n\tdb := MockDatabase()\n\ts := NewServer(db)\... | go | edit | 6 | 1 | mit | a509444d94771ec26e898e266368d050705c23e7 | thiderman/drunkenfall,thiderman/drunkenfall,thiderman/drunkenfall | web_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bootstrap\n\nimport \"github.com/flynn/flynn/pkg/random\"\n\ntype GenRandomAction struct {\n\tID string `json:\"id\"`\n\tLength int `json:\"length\"`\n\tData string `json:\"data\"`\n\n\tControllerKey bool `json:\"controller_key... | go | edit | 9 | 7 | bsd-3-clause | 2c82db3a6fb84129c47b4a4cfbfbea449fd9c1fb | Brandywine2161/flynn,whouses/flynn,felixrieseberg/flynn,GrimDerp/flynn,rikur/flynn,justintung/flynn,kgrz/flynn,Brandywine2161/flynn,Brandywine2161/flynn,felixrieseberg/flynn,felixrieseberg/flynn,ozum/flynn,jzila/flynn,TribeMedia/flynn,GrimDerp/flynn,flynn/flynn,felixrieseberg/flynn,technosophos/flynn,josephglanville/fl... | bootstrap/gen_random_action.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage octokit\n\nimport (\n\t\"net/url\"\n)\n\nvar GitTreesURL = Hyperlink(\"repos/{owner}/{repo}/git/trees/{/sha}{?recursive}\")\n\nfunc (c *Client) GitTrees(url *url.URL) (trees *GitTreesService) {\n\ttrees = &GitTreesService{client: c, URL... | go | edit | 12 | 1 | mit | 927939dfc6d6612f488da7a189b4f2299e99eea7 | calavera/go-octokit,pcasaretto/go-octokit,calavera/go-octokit,pcasaretto/go-octokit,octokit/go-octokit,half-ogre/go-octokit,half-ogre/go-octokit,octokit/go-octokit | octokit/git_trees.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bongo\n\nimport (\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"testing\"\n)\n\n// For test usage\nfunc getConnection() *Connection {\n\tconf := &Config{\n\t\tConnectionString: \"localhost\",\n\t\tDatabase: \"bongotest\... | go | edit | 39 | 2 | mit | 53f6a1995204a3ed0ebcf4fc428e1061cf05056d | go-bongo/bongo,ilijamt/bongo,maxwellhealth/bongo | main_test.go | rejected_lint | Too many lint violations: 39 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"testing\"\n\n\trss \"github.com/jteeuwen/go-pkg-rss\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar items []*rss.Item\nvar fixtures = []string{\n\t\"aws-ec2-us-east-1\",\n\t\"cros... | go | edit | 9 | 2 | mit | 1ac1147ccd6b09879f25b880ae6572f19015c3da | justincampbell/lastpost | main_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/uber-go/zap\"\n)\n\nvar (\n\tAccessLogger = zap.New(zap.NewJSONEncoder(zap.RFC3339Formatter(\"ts\")), zap.Output(os.Stdout))\n\tAppLogger = zap.New(zap.NewJSONEncoder(zap.RFC33... | go | edit | 0 | 2 | mit | ae3b73467cdd648021244446c76662f06981fea8 | oinume/lekcije,oinume/dmm-eikaiwa-fft,oinume/lekcije,oinume/dmm-eikaiwa-fft,oinume/lekcije,oinume/dmm-eikaiwa-fft,oinume/lekcije,oinume/lekcije,oinume/lekcije,oinume/dmm-eikaiwa-fft | server/logger/logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cog\n\nimport \"sync\"\n\n// Exit is useful for terminating a group of goroutines that run in a\n// for{select{}}. Be sure to `Exit.Add(n)` before starting goroutines, and\n// `defer Exit.Done()` in the goroutine.\ntype Exit struct {\n\... | go | edit | 0 | 1 | mit | 2e4ab8f277393b8d445a3d2dbeca2be3acb75a48 | thatguystone/cog,thatguystone/assert,thatguystone/assert,thatguystone/assert | exit.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logged\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"sync\"\n)\n\nfunc NewTextSerializer(w io.Writer) Serializer {\n\treturn &textSerializer{\n\t\tw: bufio.NewWriter(w),\n\t}\n}\n\ntype textSerializer struct {\n\tw *bufio.Writer\n\tmu sync.M... | go | edit | 6 | 2 | mit | 329221c95484d5d9e1e382a8537bfd1d959f0803 | andrewhare/logged | text_serializer.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage words\n\nimport (\n\t\"math/rand\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype WordGenerator interface {\n\tBabble() string\n}\n\ntype wordGenerator struct {\n\tsource rand.Source\n\tadjectives []string\n\tnouns []string\n}\n\nfunc (... | go | edit | 6 | 1 | apache-2.0 | 5e40b28fedbeabbdf4b1bad804f6c72bb1f33ffa | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | src/words/generator.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage checkers\n\n// Move describes move for checker\ntype Move struct {\n\tTarget Point\n\tCapturedChecker *Checker\n\tBecomeQueen bool\n}\n\n// IsCapture reports whether the move caused capture.\nfunc (m Move) IsCapture() bool ... | go | edit | 12 | 2 | apache-2.0 | 6d58e94977400501c09fc1c7ceaa29bc524583ef | cl0ne/go-checkers | checkers/move.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc main() {\n\tfor _, f := range os.Args {\n\t\tif f == \"-D\" || f == \"--debug\" || f == \"-debug\" {\n\t\t\tos.Setenv(\"DEBU... | go | edit | 12 | 5 | apache-2.0 | 934ae47555809fc6ea8b70aa68639cf671cd2520 | tpires/machine,tpires/machine,wzymaster/machine,Herbis/machine,pragkent/machine,surgeforward/machine,jgsqware/machine,menglingwei/machine,joelea/machine,jzwlqx/denverdino.github.io,jmelis/machine,brandoncc/machine,bgokden/machine,CenturyLinkLabs/machine,wenlock/machine,aduermael/docker.github.io,13W/machine,askb/machin... | main.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nhttp://www.apache.org/licenses/LICENSE-2.0.txt\n\n\nCopyright 2015 Intel Corporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a co... | go | edit | 0 | 1 | apache-2.0 | b672e0fe2a92ddfb5f692469e2097c06f8dab202 | intelsdi-x/snap-plugin-collector-ceph,intelsdi-x/snap-plugin-collector-ceph,intelsdi-x/snap-plugin-collector-ceph,intelsdi-x/snap-plugin-collector-ceph | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage medtronic\n\nimport (\n\t\"fmt\"\n)\n\nfunc (pump *Pump) DecodePacket(packet []byte) []byte {\n\tdata, err := Decode6b4b(packet)\n\tif err != nil {\n\t\tpump.err = err\n\t\tpump.DecodingErrors++\n\t\treturn data\n\t}\n\tcrc := Crc8(data... | go | edit | 18 | 3 | mit | 52a44356b05d459b48a749522560f1d37ea74206 | ecc1/medtronic,ecc1/medtronic | packet.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc executeCmd(command string, args ...string) {\n\tcmd := exec.Command(command, args...)\n\tcmdReader, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\t... | go | edit | 6 | 5 | mit | 663e01e49cf03fff20eb9a8cf6781c002299027c | go-playground/generate | misc.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage store\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\n// ramDirectory is a implementation that stores index\n// files in RAM\ntype ramDirectory struct {\n\tfiles map[string]*bytes.Buffer\n}\n\n// NewRAMDirectory returns a new instance of RAM ... | go | edit | 15 | 2 | mit | 0a5463a7c54d2cd359430433cb7bb56effa3680d | alldroll/suggest | pkg/store/ram_directory.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ui\n\nimport \"github.com/fatih/color\"\n\nvar PendingColor = color.New(color.FgWhite)\nvar StartedColor = color.New(color.FgYellow)\nvar SucceededColor = color.New(color.FgGreen)\nvar FailedColor = color.New(color.FgRed)\nvar ErroredCo... | go | edit | 0 | 0 | apache-2.0 | c878e1edcb5c5217bb9d4abaf6abf393233335d5 | concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse | fly/ui/colors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage coreutil\n\nimport (\n\t\"net/http\"\n\t\"reflect\"\n)\n\n// ResponseStatus returns the HTTP response status.\n// Remember that the status is only set by the server after \"ResponseWriter.WriteHeader()\"\" has been called.\nfunc Respons... | go | edit | 0 | 2 | mit | 422d0a134cbd5e6ae2e2c62a9789a4820b3b894c | volatile/core | coreutil/response.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage future\n\nimport (\n\t\"time\"\n)\n\nfunc Fuel(initial float32, elap time.Duration) float32 {\n\trate := float32(1.0 / 3.0) // 1 unit every 3 seconds\n\tfuel := initial + rate*float32(int64(elap))/1000000000\n\tif fuel > 10 {\n\t\tfuel ... | go | edit | 0 | 3 | mit | 9e8c81033d66ccda8160d025b05492ad4d2eb31f | udhos/fugo,udhos/fugo | future/future.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nvar defaultFormater = &logrus.TextFormatter{DisableColors: true}\n\n// LogToFileHook saves log entries to a file after applying the Formatter.\ntype LogToFileHook stru... | go | edit | 0 | 2 | mit | ea246948308d86f7578445f8902db301a4c2b6ad | s111/rkv,s111/rkv | cmd/rkvd/ltfhook.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage option\n\nimport \"net/http\"\n\ntype EOSSettings struct {\n\tHTTPClient *http.Client\n}\n\nfunc DefaultSettings() *EOSSettings {\n\treturn &EOSSettings{\n\t\tHTTPClient: http.DefaultClient,\n\t}\n}\n\n//////////////////////////////////... | go | edit | 0 | 1 | mit | 9152646855d907c37c3dade6efba0bd7cea18dd2 | itchio/wharf,itchio/wharf,itchio/wharf.proto,itchio/wharf.proto | eos/option/option.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\ntype Addr int\n\ntype Memory interface {\n\tReadData(Addr) byte\n\tWriteData(Addr, byte)\n\tReadProgram(Addr) uint16\n\tLoadProgram(Addr) byte\n}\n\n```\n\nApply this change: Add MemRead/MemWrite types to core"
},
{
"rol... | go | edit | 0 | 0 | mit | 2b4e36ba074cdea3154c4c4ef919178b0a877e06 | edmccard/avr-sim | core/mem.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schema\n\n// TODO: copy disco schema here.\n\n// Meta contains the archive and parse metadata.\ntype Meta struct {\n\tFileName string `json:\"task_filename,string\" bigquery:\"task_filename\"`\n\tTestName string `json:\"test_id,string... | go | edit | 0 | 1 | apache-2.0 | 28aa55fd38a22e22480db8b9e1bd539462f128b1 | m-lab/etl,m-lab/etl,m-lab/etl | schema/switch_schema.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/coreos/coreinit/agent\"\n\t\"github.com/coreos/coreinit/machine\"\n\t\"github.com/coreos/coreinit/registry\"\n\t\"github.com/coreos/coreinit/scheduler\"\n)\n\nfunc main() {\n\tm := machine.New(machine.Re... | go | edit | 0 | 2 | apache-2.0 | 5b01fd9897a871c52ce6b24dfb85aec0a2beea99 | thepwagner/fleet,jonboulle/fleet,mwitkow-io/fleet,wuqixuan/fleet,paveltiunov/fleet,esatterwhite/fleet,bcwaldon/fleet,ecnahc515/fleet,coreos/fleet,flandr/fleet,jonboulle/fleet,coreos/fleet,WPMedia/fleet,mwitkow/fleet,bviswana101/fleet,giantswarm/fleet,mischief/fleet,hhoover/fleet,giantswarm/fleet,mwhooker/fleet,webwlson... | coreinit.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\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/calavera/dkvolume\"\n)\n\nconst glusterfsId = \"_glusterfs\"\n\nvar (\n\tdefaultDir = filepath.Join(dkvolume.DefaultDockerRootDirec... | go | edit | 3 | 2 | mit | 2b3f0f8c7c9384f73ac29c8e6d9618b256ccc862 | hjdr4/docker-volume-glusterfs,tomcsi/docker-volume-glusterfs,watson81/docker-volume-glusterfs,calavera/docker-volume-glusterfs | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package main initializes a web server.\npackage main\n\nimport (\n\t\"net/http\"\n\t_ \"net/http/pprof\" // import for side effects\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/hack4impact/transcribe4all/config\"\n\t\"gi... | go | edit | 0 | 2 | mit | 12fb98ca05f56e5009cc92dc5eb0ae6f0b1a6d71 | hack4impact/audio-transcription-service,hack4impact/transcribe4all,hack4impact/transcribe4all,hack4impact/transcribe4all | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"time\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nconst (\n\tgameTick = time.Millisecond\n\tstatsTick = time.Second\n)\n\nvar addr = flag.String(\"addr\", \":25200\", \"service address\")\nvar debug = f... | go | edit | 15 | 3 | mit | 8a51aa5909bab38a448e6b75058f87da6964d66e | etheriqa/crescent | main.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright IBM Corp. All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n*/\n\npackage runner\n\nimport (\n\t\"time\"\n\n\t\"github.com/hyperledger/fabric/integration/helpers\"\n)\n\nconst DefaultStartTimeout = 30 * time.Second\n\n/... | go | edit | 0 | 0 | apache-2.0 | a1a9ecd3814854b08d58e8c44e40ca0e94b3d0a7 | stemlending/fabric,jimthematrix/fabric,binhn/fabric,muralisrini/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric,binhn/fabric,manish-sethi/fabric-sidedb,stemlending/fabric,manish-sethi/fabric-sidedb,muralisrini/fabric,binhn/fabric,stemlending/fabric,hyperledger/fabric,manish-sethi/fabric,manish-sethi/fabric-sidedb... | integration/runner/defaults.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows,cgo !windows,osusergo\n\npackage homedir // import \"github.com/docker/docker/pkg/homedir\"\n\nimport (\n\t\"os\"\n\t\"os/user\"\n)\n\n// Key returns the env var name for the user's home dir based on\n// the platform being ru... | go | edit | 0 | 3 | apache-2.0 | 80e338a18db0acce00653a176d82a567eafb0c79 | Mokolea/docker,nawawi/docker,konstruktoid/docker-upstream,cpuguy83/docker,vdemeester/docker,gnailuy/docker,bearstech/moby,pradipd/moby,ibuildthecloud/docker,Ramzec/docker,jvanz/docker,estesp/docker,paralin/docker,dims/docker,trebonian/docker,flavio/docker,moby/moby,estesp/docker,jimjag/docker,bearstech/moby,nawawi/dock... | pkg/homedir/homedir_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/apprenda/kismatic/pkg/inspector/rule\"\n)\n\nfunc getNodeRoles(commaSepRoles string) ([]string, error) {\n\troles := strings.Split(commaSepRoles, \",\")\n\tfor _, r :... | go | edit | 3 | 7 | apache-2.0 | e3803f94b09f41e361bb67ad12d9b68d9806385a | apprenda/kismatic,apprenda/kismatic,apprenda/kismatic | pkg/inspector/cmd/common.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 | 8a139b3b78298bca28de8e558297800413eaf186 | GoogleCloudPlatform/gcsfuse,jacobsa/ratelimit,BanzaiMan/gcsfuse,jacobsa/timeutil,GoogleCloudPlatform/gcsfuse,GoogleCloudPlatform/gcsfuse,kahing/gcsfuse,BanzaiMan/gcsfuse,mbrukman/gcsfuse | mount_gcsfuse/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage messages\n\nimport (\n\t\"code.google.com/p/go-uuid/uuid\"\n\t\"github.com/qp/go/utils\"\n)\n\n// Message is the standard QP messaging object.\n// It is used to facilitate all communication between\n// QP nodes, as well as containing th... | go | edit | 0 | 1 | mit | 75e1284b2c13a1ab3423964c804df1688c9a6dbe | qp/go,qp/go | messages/message.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage interpreter\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nconst onePlusOne = `{\"type\":\"Program\",\"start\":0,\"end\":5,\"body\":[{\"type\":\"ExpressionStatement\",\"start\":0,\"end\":5,\"expression\":{\"type\":\"BinaryExpression\",\"st... | go | edit | 0 | 2 | apache-2.0 | 0ef7b331fbab892b121fa51f7ddd82dbcd040e3f | NeilFraser/CodeCity,google/CodeCity,google/CodeCity,NeilFraser/CodeCity,NeilFraser/CodeCity,google/CodeCity,NeilFraser/CodeCity,google/CodeCity | server/interpreter/interpreter_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"path/filepath\"\n\n\t\"github.com/cloudfoundry/libbuildpack/cutlass\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"running supply buildpacks before the stat... | go | edit | 30 | 3 | apache-2.0 | 665b74e4781ac853bce4919b5ec3987ba862d1fb | cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack | src/staticfile/integration/fake_supply_before_staticfile_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"log\"\n\n\trdb \"github.com/dancannon/gorethink\"\n)\n\nfunc init() {\n\tvar err error\n\tTestConn, err = NewConnection(\"test\", \"localhost:28015\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Could not create a connecti... | go | edit | 12 | 2 | unlicense | cee759beac301264582b4b5a1aaf777d24ad6fef | nylar/miru | db/testutils_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/deshboard/boilerplate-service/app\"\n\t\"github.com/kelseyhightower/envconfig\"\n\t\"gopkg.in/airbrake/gobrake.v2\"\n\tlogrus_airbrake \"gopkg.in/gemnasium/logrus-airbrake-hook.v2\"\n)\n\nfunc init() {\n... | go | edit | 21 | 3 | mit | 9e8973fe8cf9204eaed3eb3c754e4aeb8bce2769 | deshboard/boilerplate-crondaemon,deshboard/boilerplate-service,deshboard/boilerplate-model-service,deshboard/boilerplate-grpc-service | init.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/rogierlommers/logrus-redis-hook\"\n)\n\nfunc init() {\n\thook, err := logredis.NewHook(\"localhost\",\n\t\t\"my_redis_key\", // key to use\n\t\t\"v0\", // logs... | go | edit | 3 | 2 | mit | cb3a51bd38548a67a0d28a57523c98536cd23c5e | rogierlommers/logrus-redis-hook | example-usage/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"flag\"\n\t\"fmt\"\n)\n\nfunc warn(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc usage() {\n\tprogram := os.Args[0]\n\twarn(\"usage: %s [SU... | go | edit | 3 | 3 | mit | 417b08e81290471a26c03e4acaefc9d90c93c5d8 | kourge/hv | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage termination\n\nimport \"github.com/aurelien-rainone/evolve/framework\"\n\n// GenerationCount terminates evolution after a set number of generations have\n// passed.\ntype GenerationCount struct {\n\tgenerationCount int\n}\n\n// NewGener... | go | edit | 0 | 2 | mit | 8a1586e75805ea2f9e4ffdab9269a19410e97e96 | aurelien-rainone/evolve,aurelien-rainone/evolve | termination/generation_count.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schedule\n\nimport (\n\t\"time\"\n)\n\ntype Commit struct {\n\tdateTime time.Time\n\tmessage string\n}\n\n// RandomCommits returns a channel of random commits for a given day.\nfunc RandomCommits(day time.Time, rnd int) chan Commit {\n... | go | edit | 0 | 0 | mit | b4a85849423f59f443e6d2006960d4b759d7cab9 | 0xfoo/punchcard | schedule/commits.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bases\n\nimport \"time\"\n\n// Subscriptor is an interface type which Subscription implements.\ntype Subscriptor interface {\n\tDispose() Subscriptor\n\tSubscribe() Subscriptor\n\tUnsubscribe() Subscriptor\n\tUnsubscribeIn(time.Duration... | go | edit | 0 | 0 | mit | f0ca0bf4deb9ddd9ff92cc5e94b642725440c5e4 | jochasinga/grx,ReactiveX/RxGo | bases/subscriptor.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage a8rcloud\n\nimport (\n\t\"github.com/telepresenceio/telepresence/rpc/v2/manager\"\n)\n\n// API key descriptions to use when requesting API keys from Ambassador Cloud.\nconst (\n\tKeyDescWorkstation = \"laptop\"\n\tKeyDescTrafficManag... | go | edit | 0 | 1 | apache-2.0 | d758ff96e486afc2359f5b958cc213d76c56f89c | datawire/telepresence,datawire/telepresence,datawire/telepresence | pkg/a8rcloud/apikeys.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"cf/api\"\n\t\"cf/configuration\"\n\tterm \"cf/terminal\"\n\t\"github.com/codegangsta/cli\"\n)\n\ntype SetEnv struct {\n\tui term.UI\n\tappRepo api.ApplicationRepository\n}\n\nfunc NewSetEnv(ui term.UI, app... | go | edit | 0 | 4 | apache-2.0 | c2c4fc3a8fadd34a46de2c50686e95b1a1548754 | srikanth88infy/cli,xingzhou/cli,kavoj/cli,markstgodard/cli,rastasheep/trash-can,mcintyred/cli,hyenaspots/cli,nttlabs/cli,cf-routing/cli,mcintyred/cli,evanfarrar/cli,simonleung8/cli,saravana76/cli,cgvarela/cli,SrinivasChilveri/cli,saurabhguptasg/cli,HuaweiTech/cli,simonleung8/cli,evanfarrar/cli,nttlabs/cli,rastasheep/tr... | src/cf/commands/set_env.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage middleware\n\nimport (\n\t\"github.com/TeaMeow/KitSvc/model\"\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/gin-gonic/gin\"\n)\n\nconst configKey = \"config\"\n\nfunc Config(cli *cli.Context) gin.HandlerFunc {\n\treturn func(c *gin.... | go | edit | 0 | 1 | mit | cd644a4615d04793cb8e8ddae859413fabfc5585 | TeaMeow/KitSvc | router/middleware/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage execext\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n\n\t\"mvdan.cc/sh/interp\"\n\t\"mvdan.cc/sh/syntax\"\n)\n\n// RunCommandOptions is the options for the RunCommand func\ntype RunCommandOptions struct {\n\tContex... | go | edit | 0 | 6 | mit | db0d847e03cc94323b4db3f41d6f8b174bb6ec4a | go-task/task,go-task/task | internal/execext/exec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tbleed \"github.com/FiloSottile/Heartbleed/bleed\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tout, err := bleed.Heartbleed(os.Args[1], []byte(\"heartbleed.filippo.io\"))\n\tif err == bleed.ErrPayloadNotFound {\n\t\tl... | go | edit | 0 | 3 | mit | 205cdabcfb9632ea2f8482e13fba3e1e2c8fd60f | mozilla-services/Heartbleed,behzad88/Heartbleed,FiloSottile/Heartbleed,FiloSottile/Heartbleed,saisai/Heartbleed,saisai/Heartbleed,behzad88/Heartbleed,FiloSottile/Heartbleed,mozilla-services/Heartbleed,saisai/Heartbleed,behzad88/Heartbleed | bleed.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/urfave/cli\"\n\t\"os\"\n\t\"log\"\n\t\"fmt\"\n)\n\n// init injects our key-related commands\nfunc init() {\n\tcliCommands = append(cliCommands, cli.Command{\n\t\tName: \"credits\",\n\t\tAliases: []string... | go | edit | 6 | 2 | mit | 680fddfd2f363bb2d249659caec3a41ccdb3a4d6 | keltia/ripe-atlas | cmd/atlas/cmd_credits.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2013 Google Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/license... | go | edit | 0 | 0 | apache-2.0 | 70b886dd5a25a2507624496d5ac5815cad14476f | toshnix/camlistore,kbajey/testrepo,angelcabo/camlistore,henrylee2cn/camlistore,mpl/camlistore,colemickens/camlistore,angelcabo/camlistore,raff/camlistore,stevearm/camlistore,colemickens/camlistore,edrex/camlistore,fgeller/camlistore,pombredanne/camlistore,ginabythebay/camlistore,nimbus/camlistore,minusnine/camlistore,e... | third_party/react/fileembed.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\"log\"\n\t\"net/http\"\n)\n\nvar taskIndex = 0\n\nfunc startHTTP() {\n\thttp.HandleFunc(\"/api/addtask\", addTaskHandler)\n\tlog.Printf(\"api listening on port %d\", *port)\n\tif err ... | go | edit | 18 | 4 | apache-2.0 | bb49895e476c574dc306269bffe41f4ae28845e8 | twitter/gozer,twitter/gozer | gozer/http.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc userModeWarning(withRun bool) {\n\t// everything is supported on windows\n\tif runtime.GOOS == \"windows\" {\n\t\treturn\n\t}\n\n\tsystemMode :... | go | edit | 0 | 9 | mit | 2a5fc0f02f7586f75281bf435a8d2ee71833823d | ayufan/gitlab-ci-multi-runner,soiff/gitlab-ci-multi-runner,ayufan/gitlab-ci-multi-runner,hu19891110/gitlab-ci-multi-runner,soiff/gitlab-ci-multi-runner,hu19891110/gitlab-ci-multi-runner,ayufan/gitlab-ci-multi-runner,soiff/gitlab-ci-multi-runner,hu19891110/gitlab-ci-multi-runner | commands/user_mode_warning.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 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 | 4 | apache-2.0 | f956aeb065658c4621b60324de86f1e1e0bbe344 | rakyll/drivefuse,odeke-em/drivefuse-clone,rakyll/drivefuse | logger/logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage medtronic\n\nconst (\n\tbolus Command = 0x42\n)\n\n// Bolus delivers the given amount of insulin as a bolus.\nfunc (pump *Pump) Bolus(amount Insulin) {\n\tnewer := pump.Family() >= 23\n\tif newer {\n\t\tpanic(\"unimplemented\")\n\t}\n\t... | go | edit | 6 | 2 | mit | ed3c0fc68e43dc3a300b56b20845046875de8883 | ecc1/medtronic,ecc1/medtronic | bolus.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage output\n\ntype DefaultFieldsHaver interface {\n\tDefaultFields(f Format) string\n}\n\n```\n\nApply this change: Add documentation comment to DefaultFieldsHaver"
},
{
"role": "assistant",
"content": "package output\n\n// Defa... | go | edit | 3 | 0 | mit | 76d8e4d2c9fd0ce957a253ea2a972b9423938301 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | lib/output/default_fields_haver.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gtf\n\nimport (\n\t\"html/template\"\n \"strings\"\n)\n\nvar GtfFuncMap = template.FuncMap {\n\t\"stringReplace\": func(s1 string, s2 string) string {\n\t\treturn strings.Replace(s2, s1, \"\", -1)\n\t},\n\t\"stringDefault\": func(s1 ... | go | edit | 0 | 5 | mit | 0a937b01d154fbef7b450892399356bbe342b642 | leekchan/gtf,Parkayun/gtf,RichardKnop/gtf | gtf.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestFindExistingPackage(t *testing.T) {\n\tpath := findPackage(\"github.com/spf13/cobra\")\n\tif path == \"\" {\n\t\tt.Fatal(\"findPackage didn't find the existing package\"... | go | edit | 6 | 3 | apache-2.0 | efbe9b05d89b33e8296e163fa84ffcf43152f3bf | spf13/cobra,anthonyfok/cobra,liggitt/cobra,eparis/cobra | cobra/cmd/project_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage propagator\n\nimport (\n\t\"github.com/AsynkronIT/protoactor-go/actor\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"sync\"\n\t\"testing\"\n)\n\nfunc TestPropagator(t *testing.T) {\n\n\tmutex := &sync.Mutex{}\n\tspawningCounter := 0\n... | go | edit | 3 | 3 | apache-2.0 | 0b59164c1bd4ac11a9622d9703dbafb8cd0dabf1 | rogeralsing/gam,AsynkronIT/gam,AsynkronIT/gam,AsynkronIT/protoactor-go,AsynkronIT/protoactor-go | actor/middleware/propagator/middlewarepropagation_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage filehandler\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// SetUp will create the needed directories\nfunc SetUp() error {\n\n\terrMsg := \"Cannot create resources dir. Consider -checkdir=false.\\n\"\n\n\t// get current p... | go | edit | 3 | 6 | apache-2.0 | 453e13c6271b70f9c7f1f8b92a2ca2d620cd13d5 | gale93/swebs | filehandler/dirmaker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage money\n\nimport (\n\t\"math\"\n\t\"strings\"\n)\n\nfunc separateThousands(value, separator string) string {\n\ts := len(value) / 3\n\tm := int(math.Mod(float64(len(value)), 3))\n\n\tif m > 0 {\n\t\ts++\n\t}\n\n\tif s == 0 {\n\t\treturn ... | go | edit | 0 | 6 | mit | e4be389a3f47b64e3877a42e0124db41c98856ea | jmptrader/money-1,joiggama/money | helpers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc main() {\n\tfor _, f := range os.Args {\n\t\tif f == \"-D\" || f == \"--debug\" || f == \"-debug\" {\n\t\t\tos.Setenv(\"DEBU... | go | edit | 0 | 5 | apache-2.0 | 13fd5f07a36d333d0626764ac27f2cca3bd1cc5f | jeanlaurent/machine,StackPointCloud/machine,anweiss/docker.github.io,LaynePeng/machine,ehazlett/machine,LuisBosquez/docker.github.io,legal90/machine,asalhamed/machine,aidora/yont,denverdino/docker.github.io,kunalkushwaha/machine,pragkent/machine,wenlock/machine,jkingyens/machine,sanscontext/docker.github.io,ehazlett/ma... | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gowebutils\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\nconst MaxRequestSize = 1048576 * 5\n\nfunc PrepareRequestBody(r *http.Request) ([]byte, error) {\n\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, MaxRequestSiz... | go | edit | 0 | 3 | mit | b0cf394a358729674f7b366828483b4745925d45 | wangjohn/gowebutils | requests.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage shell\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGuessFish(t *testing.T) {\n\tif Guess(\"/usr/local/bin/fish\") != Fish {\n\t\tt.Errorf(\"Expected /usr/local/bin/fish to match the fish shell\")\n\t}\n}\n\nfunc TestFishCompiles(t *testing... | go | edit | 21 | 1 | mit | cee85ea466d597f1471fc612c5717540e8ee1208 | gsamokovarov/jump | shell/shell_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helpers\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/ghttp\"\n)\n\nfunc AddFiftyOneOrgs(server *ghttp.Server) {\n\tAddHandler(server... | go | edit | 9 | 1 | apache-2.0 | 13c39cb5100567bf8a504100cc6e16b6b3289d26 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | integration/helpers/fake_data.go | rejected_lint | Too many lint violations: 9 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.