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 peerstore\n\nimport (\n\tcore \"github.com/libp2p/go-libp2p-core/peer\"\n\tma \"github.com/multiformats/go-multiaddr\"\n)\n\n// Deprecated: use github.com/libp2p/go-libp2p-core/peer.Info instead.\ntype PeerInfo = core.AddrInfo\n\n// Dep... | go | edit | 0 | 1 | mit | 00b792cf6c38a5a62c9b5964957675b8257113f6 | libp2p/go-libp2p,libp2p/go-libp2p | p2p/host/peerstore/peerinfo.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage singleton\n\nimport(\n\t\"errors\"\n\n\t\"golang.org/x/net/context\"\n)\n\nvar(\n\tErrNoSuchEntity = errors.New(\"util/singleton: no such entity\")\n\tErrSingletonTooBig = errors.New(\"util/singleton: object too big to write\")\n)\n\nty... | go | edit | 0 | 0 | apache-2.0 | 2f585443eac8c7ca26be923542fcf933b9e84baf | skypies/util | singleton/singleton.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// IIIFInfo represents the simplest possible data to provide a valid IIIF\n// information JSON response\ntype IIIFInfo struct {\n\tContext string `json:\"@context\"`\n\tID string `json:\"@id\"`\n\tProtocol string `j... | go | edit | 0 | 1 | cc0-1.0 | 431fa015d71a78abafdb71b8ae659088893caa98 | uoregon-libraries/rais-image-server,uoregon-libraries/newspaper-jp2-viewer,uoregon-libraries/newspaper-jp2-viewer,uoregon-libraries/rais-image-server,uoregon-libraries/newspaper-jp2-viewer,uoregon-libraries/rais-image-server,uoregon-libraries/rais-image-server | cmd/jp2tileserver/iiif_json.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage control\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\n\t\"github.com/rancher/os/pkg/log\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc udevSettleAction(c *cli.Context) {\n\tif err := UdevSettle(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\... | go | edit | 0 | 3 | apache-2.0 | 3c998bef451ae3e32b9966d4eeaa634665dc2d02 | rancherio/os,rancher/os,rancherio/os,rancher/os,rancherio/os | cmd/control/udevsettle.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mobile\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/mosaicnetworks/babble/src/crypto/keys\"\n)\n\n// GetPrivPublKeys generates a new public key pair and returns it in the\n// following formatted string <public key hex>=!@#@!=<priv... | go | edit | 0 | 3 | apache-2.0 | c603ecbfb1621f79ebba6dc4af33e6825fbfbc42 | babbleio/babble,babbleio/babble | src/mobile/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage auth\n\nimport (\n\t\"github.com/robfig/revel\"\n\t//_ \"github.com/pjvds/acvte/modules/auth/routes\"\n)\n\ntype AuthenticatedResource struct {\n\tResource interface{}\n\tRole string\n}\n\nfunc init() {\n\trevel.OnAppStart(func() {\... | go | edit | 3 | 3 | mit | 418bddf7a30e2788d9c1c93ea6628035f165b44e | slogsdon/acvte,slogsdon/acvte | app/modules/auth/app/plugin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"os\"\nimport \"fmt\"\nimport \"net\"\nimport \"bufio\"\nimport \"bytes\"\n\nimport \"github.com/UniversityRadioYork/ury-rapid-go/tokeniser\"\n\nfunc main() {\n\tconn, err := net.Dial(\"tcp\", \"127.0.0.1:1350\")\n\tif e... | go | edit | 0 | 6 | mit | 695d264c9e955632c09a74741d21f31b26e31d2a | UniversityRadioYork/heimdallr,UniversityRadioYork/bifrost,UniversityRadioYork/bifrost,UniversityRadioYork/bifrost,UniversityRadioYork/heimdallr,UniversityRadioYork/heimdallr | ury-rapid-go.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ratelimit\n\nimport \"time\"\n\ntype basicLimiter struct {\n\tt *time.Ticker\n\tbc ByteCount\n\tcbc chan ByteCount\n}\n\nfunc (bl *basicLimiter) Start() {\n\tfor {\n\t\t<-bl.t.C\n\t\tbl.cbc <- bl.bc\n\t}\n}\n\nfunc (bl basicLimiter) ... | go | edit | 9 | 2 | mit | 5949c5419c466f4f34f9a9cfded31c17d05f185a | andrewstuart/limio | basic_limiter.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport \"net\"\n\ntype Client struct {\n\tconn net.Conn\n}\n\nfunc NewClient(o *Options) (*Client, error) {\n\tconn, err := o.getDialer()()\n\treturn &Client{\n\t\tconn: conn,\n\t}, err\n}\n\n```\n\nApply this change: Define e... | go | edit | 9 | 2 | mit | 6db9c34f30fa321693da22bb171bdb91a0a3bc1a | kofj/redlot | client/client.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scipipe\n\nimport (\n\t\"testing\"\n)\n\nconst (\n\tTESTPATH = \"somepath.txt\"\n)\n\nfunc TestFileTargetPath(t *testing.T) {\n\tft := NewFileTarget(TESTPATH)\n\tpath := ft.GetPath()\n\tif path != TESTPATH {\n\t\tt.Errorf(\"Path not pro... | go | edit | 3 | 1 | mit | 648c37b49ce6dceb49300c524c7b192c5c970e67 | scipipe/scipipe,samuell/scipipe,scipipe/scipipe | file_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Command aws-gen-gocli parses a JSON description of an AWS API and generates a\n// Go file containing a client for the API.\n//\n// aws-gen-gocli EC2 apis/ec2/2014-10-01.api.json service/ec2/ec2.go\npackage main\n\nimport (\n\t\"flag\"\n\... | go | edit | 0 | 4 | apache-2.0 | 04200b94882914d8ff470f219713813344291ddd | devx/aws-sdk-go,vito/aws-sdk-go,Onefootball/aws-sdk-go,marcosnils/aws-sdk-go,xibz/aws-sdk-go,fwiesel/aws-sdk-go,rikuayanokozy/aws-sdk-go,yxd-hde/aws-sdk-go,calgaryscientific/aws-sdk-go,marcosnils/aws-sdk-go,matematik7/aws-sdk-go,bpot/aws-sdk-go,rail/aws-sdk-go,jacobxk/aws-sdk-go,jacobxk/aws-sdk-go,rail/aws-sdk-go,skypo... | cmd/aws-gen-gocli/aws-gen-gocli.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\nimport (\n\tOS \"os\" // should requir... | go | edit | 6 | 1 | bsd-3-clause | 622a6679403dd07c987d8b148e41d54d557ed185 | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | test/bugs/bug125.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage transport\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/linuxkit/virtsock/pkg/vsock\"\n\t\"github.com/pkg/errors\"\n)\n\nconst (\n\tvmaddrCidHost = 2\n\tvmaddrCidAny = 0xffffffff\n)\n\n// VsockTransport is an implementa... | go | edit | 6 | 3 | mit | 33d89b69e4babb73c3025eb15a34d3bc49f6ca68 | jterry75/opengcs,rn/opengcs,jterry75/opengcs,jterry75/opengcs,rn/opengcs,Microsoft/hcsshim | service/gcs/transport/vsock.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013-2016 Adam Presley. All rights reserved\n// Use of this source code is governed by the MIT license\n// that can be found in the LICENSE file.\n\npackage global\n\nimport \"github.com/mailslurper/libmailslurper/storage\"\n\ncons... | go | edit | 0 | 0 | mit | 529a0697a96a4cdac5e872d54072b90c4a0ae454 | mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper | global/Global.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// SPDX-License-Identifier: Apache-2.0\n// Copyright 2020 Authors of Cilium\n\npackage node\n\nconst (\n\ttemplateHostEndpointID = uint64(0xffff)\n)\n\nvar (\n\tlabels map[string]string\n\tendpointID = templateHostEndpointID\n)\n\n// GetLab... | go | edit | 0 | 1 | apache-2.0 | ac0d184d51d67fe9eeabd5683bd21c263c55c9e6 | cilium/cilium,cilium/cilium,michi-covalent/cilium,cilium/cilium,cilium/cilium,michi-covalent/cilium,tklauser/cilium,michi-covalent/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,tklauser/cilium,michi-covalent/cilium,tklauser/cilium,tklauser/cilium | pkg/node/host_endpoint.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server_test\n\nimport (\n\t\"github.com/concourse/skymarshal/bitbucket/server\"\n\t\"github.com/concourse/skymarshal/provider\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Bitbucket Server Pr... | go | edit | 15 | 1 | apache-2.0 | 441a6b5ddeb046870c7b82dbe1b0604c737c1557 | concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse | bitbucket/server/team_provider_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lua\n\nfunc (L Lua) CloneTo(newL Lua) error {\n\tL.GetGlobal(\"_G\")\n\tdefer L.Pop(1)\n\terr := L.ForInDo(-1, func(src Lua) error {\n\t\tif !src.IsString(-2) {\n\t\t\treturn nil\n\t\t}\n\t\tkey, err := src.ToString(-2)\n\t\tif err != n... | go | edit | 12 | 5 | bsd-3-clause | 4cc9957c6e7fe5de44fc5cb3dc058af136a22cb4 | tyochiai/nyagos,tsuyoshicho/nyagos,zetamatta/nyagos,nocd5/nyagos | lua/clone.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\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/nicksnyder/go-i18n/i18n\"\n\tmylog \"github.com/patrickalin/GoMyLog\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc TestSomething(t *testing.T) {\n\tviper.SetConfigName(\... | go | edit | 0 | 2 | apache-2.0 | f514130e12b0caf01f55069cf3c4dba5b5aa1d3f | patrickalin/bloomsky-client-go,patrickalin/bloomsky-client-go,patrickalin/bloomsky-client-go | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage parser\n\n// This file contains any whitebox tests (with access to package internals), and wrappers\n// to enable blackbox tests to set up environment.\n\n// InitParserVersionForTest allows tests to rerun initParserVersion after initial... | go | edit | 3 | 0 | apache-2.0 | a6dd8fe58de3df4ccf463e0c9ba17cae699abf42 | m-lab/etl,m-lab/etl,m-lab/etl | parser/parser_whitebox_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage testhelpers\n\nimport \"fmt\"\n\nconst (\n\t// ERROR MESSAGEs - Used as first argument in Error() call\n\tEM_NEED_ERR = \"Should have gotten an error, but didn't\"\n\tEM_UN_ERR = \"Unexpected Error\"\n\n\t// ERROR STRINGS - embed in\n... | go | edit | 6 | 1 | mit | 242fd1e6faa4fa76aaa6d5688930bfaa82764b6d | ErebusBat/go-testhelpers | msg.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport \"gopkg.in/mgo.v2\"\n\n// Interface for generic data source (e.g. database).\ntype DataSource interface {\n\t// Returns collection by name\n\tC(name string) Collection\n\n\t// Returns copy of data source (may be copy of ses... | go | edit | 18 | 1 | mit | 68220865cd8923f551d0c6aeba4229c27916fd6a | DVI-GI-2017/Jira__backend | db/datasource.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage xml\n\ntype TextNode struct {\n\t*XmlNode\n}\n\n```\n\nApply this change: Allow output escaping to be disabled on an xml.TextNode"
},
{
"role": "assistant",
"content": "package xml\n\n/*\n#include \"helper.h\"\n#include <str... | go | edit | 9 | 1 | mit | 0b1a110f6cb03bf54ab64ff6d58a6d73a807bd5c | ThomsonReutersEikon/gokogiri,jmcgill0brightcove/gokogiri,jbowtie/gokogiri,jmcgill0brightcove/gokogiri,ThomsonReutersEikon/gokogiri,moovweb/gokogiri,jmcgill0brightcove/gokogiri,moovweb/gokogiri,jbowtie/gokogiri,moovweb/gokogiri,jbowtie/gokogiri | xml/text.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage oauth\n\nimport (\n\t\"github.com/skygeario/skygear-server/pkg/auth/dependency/principal\"\n\t\"github.com/skygeario/skygear-server/pkg/core/config\"\n)\n\ntype GetByProviderOptions struct {\n\tProviderType string\n\tProviderKeys ma... | go | edit | 0 | 3 | apache-2.0 | 1f8de67efed99d3e94f689b83a897f9af6d70529 | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | pkg/auth/dependency/principal/oauth/oauth.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2019 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 | 6 | 1 | apache-2.0 | 8bfd3a54a4142c397cab69bfa9699e5b5db9b40b | gohugoio/hugo,anthonyfok/hugo,gohugoio/hugo,anthonyfok/hugo,gohugoio/hugo,anthonyfok/hugo | hugolib/siteJSONEncode_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"github.com/JacobHayes/locus\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc open(filename string) *os.File {\n\tfil... | go | edit | 0 | 2 | mit | e4276c1fd8bc13eae2bcd6fc84ccd9055b3d64f6 | JacobHayes/gIPl | gipl.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// index=3\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t_ \"veyron.io/veyron/veyron/profiles\"\n\t\"veyron.io/veyron/veyron2/rt\"\n\n\t\"fortune\"\n)\n\nfunc main() {\n\tvar err error\n\truntime, err := rt.New()\n\tif err !=... | go | edit | 0 | 4 | bsd-3-clause | 2202c34207ac92ebd0821274aaed9a018de609d3 | vanadium/playground,vanadium/playground,vanadium/playground,vanadium/playground | client/content/playgrounds/code/fortune/ex0-go/src/client/client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pool\n\nimport (\n\t\"runtime\"\n\t\"sync\"\n)\n\ntype Pool struct {\n\twg *sync.WaitGroup\n\tcompletion chan bool\n\tm sync.Mutex\n}\n\nconst (\n\tMaxConcurrencyLimit = -1\n)\n\nfunc New(concurrencyLimit int) *Pool {\n... | go | edit | 0 | 3 | mit | 512df45ca4878766730a97c819edbb41499e7c6c | buildkite/agent,buildkite/agent,buildkite/agent | pool/pool.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage events\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\ntype Event struct {\n\tTime time.Time\n\tData map[string]*float64\n\t// TODO: change to map[string]struct{}\n\tTags []string\n}\n\nfunc NewEvent(data map[stri... | go | edit | 0 | 3 | mit | 0ae2689d0ae8593d6cba0d6dc7ee4c59ac3080cf | jonog/redalert,jonog/redalert,jonog/redalert | events/events.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fasthttp\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"runtime/debug\"\n\t\"sync\"\n)\n\n// StreamWriter must write data to w.\n//\n// Usually StreamWriter writes data to w in a loop (aka 'data streaming').\n//\n// StreamWriter must return im... | go | edit | 3 | 2 | mit | cd2eb9bd90de46575d362cbec07246a1cd949dae | valyala/fasthttp | stream.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/adrien-f/gotify/config\"\n\tsp \"github.com/op/go-libspotify\"\n)\n\nfunc Ascii() {\n\tfmt.Println(\" _ _ __\")\n\tfmt.Println(\" __ _ ___ | |_(_)/ _|_ _\")\n\tfmt.Println(\... | go | edit | 0 | 1 | mit | 0c367e466de5c5345593d1846a62493883084981 | adrien-f/gotify | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage chalmers_chop\n\nimport \"time\"\n\ntype Menu struct {\n\tTitle string `json:\"title\"`\n\tDate string `json:\"date\"`\n\tDishes []Dish `json:\"dishes\"`\n}\n\nfunc (m *Menu) AddDish(dish Dish) {\n\tm.Dishes = append(m.Dishes, dish)\... | go | edit | 12 | 3 | mit | 9fb34977a61320eca65e75e33c01c6ef71fbb6eb | kayex/chalmers-chop | menu.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\"fmt\"\n\t\"os\"\n\n\t\"github.com/codegangsta/cli\"\n\t_ \"github.com/go-sql-driver/mysql\"\n\n\t\"github.com/containerops/vessel/cmd\"\n\t\"github.com/containerops/wrench/setting\"\n)\n\nfunc main() {\n\tif err :=... | go | edit | 0 | 2 | mit | f016d747d66357e2fb84572f4eb8f0d2e1d5360a | zenlinTechnofreak/vessel,huangliangjun/vessel | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar log = logrus.New()\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Commands = Commands\n\tapp.CommandNotFound = cmdNotFound\n\tapp... | go | edit | 6 | 1 | mit | 79fe0be276b2b2573016d7d8e0aa7a09ce972c1a | damonkelley/hostsup,damonkelley/hostsup | 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 \"fmt\"\n \"net/http\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n fmt.Fprintf(w, \"Hi there, I love %s!\", r.URL.Path[1:])\n}\n\nfunc main() {\n http.HandleFunc(\"/\", handler)\n htt... | go | edit | 3 | 1 | mit | dd7f31d6c54a7d16fb4bc9a2b0e10899b09c08c6 | RStankov/cyoa,RStankov/cyoa,RStankov/cyoa | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tlog \"github.com/sirupsen/logrus\"\n\tfirego \"gopkg.in/zabawaba99/firego.v1\"\n)\n\nfunc apiRemove(path string) {\n\tf := firego.New(baseURL+\"/\"+path, nil)\n\tf.Auth(authToken)\n\tdefer f.Unauth()\n\tif err := f.R... | go | edit | 12 | 2 | mit | 9e13e77631828c04a5cb7ab9b323bd35440a8c97 | sapk/sca | api.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage app\n\nimport (\n\t\"database/sql\"\n\n\t\"github.com/goph/stdlib/errors\"\n\t\"github.com/goph/stdlib/log\"\n)\n\n// ServiceOption sets options in the Service.\ntype ServiceOption func(s *Service)\n\n// DB returns a ServiceOption that ... | go | edit | 0 | 4 | mit | 073ebeca719f9de2e5aa38cad1d95b68b4766983 | deshboard/boilerplate-model-service | app/service.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"log\"\n\t\"github.com/gorilla/mux\"\n)\n\nconst BIND_ADDRESS string = \":8000\"\nconst STATIC_DIRECTORY string = \"static\"\nconst STATIC_MOUNT_POINT string = \"/\"\n\nfunc RootHandler(w http.Respon... | go | edit | 0 | 1 | apache-2.0 | db7f190906b960321e79afe72fd4ff648a9c0006 | hexaglow/webviz-vr,hexaglow/webviz-vr | main.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)\n\nfunc main() {\n\ttester, err := NewTTFB()\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tflag.Parse()\n\n\tresults, err := tester.Report(flag.Arg(0))\n\n\tif err != nil {\n... | go | edit | 3 | 5 | mit | 787052dd7298862cacb84d88a850807667e4a173 | cixtor/webttfb | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage runner\n\nimport (\n\t\"log\"\n\n\t\"github.com/sivel/overseer/monitor\"\n\t\"github.com/sivel/overseer/notifier\"\n\t\"github.com/sivel/overseer/status\"\n)\n\ntype Runner struct {\n\tStatusChan chan *status.Status\n\tMonitors []moni... | go | edit | 0 | 4 | apache-2.0 | 64edb02b81fe179d18dedcb737ecf09281a50795 | sivel/overseer | runner/runner.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// This is a \"stub\" file. It's a little start on your solution.\n// It's not a complete solution though; you have to write some code.\n\n// Package twofer should have a package comment that summarizes what it's about.\n// https://golang.org/... | go | edit | null | null | mit | ef638ee2ba371b1ff2a59155652cc16c6885c838 | exercism/xgo,leenipper/xgo,leenipper/xgo,exercism/xgo | exercises/triangle/triangle.go | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"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 common\n\nimport \"testing\"\n\nfunc TestNoop(t *testing.T) {\n\t// This is just to make this package included in the code-coverage statistics\n}... | go | edit | 9 | 1 | apache-2.0 | fb1092583950f18375ac0dfa5ec62a9d5d9077ea | lukehuangch/fabric,muralisrini/fabric,binhn/fabric,manish-sethi/fabric-sidedb,binhn/fabric,manish-sethi/fabric-sidedb,lukehuangch/fabric,ckeyer/fabric,ckeyer/fabric,xixuejia/fabric,stemlending/fabric,manish-sethi/fabric-sidedb,jimthematrix/fabric,stemlending/fabric,lukehuangch/fabric,hyperledger/fabric,ckeyer/fabric,xi... | gossip/common/common_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage minion\n\nimport (\n\t\"time\"\n\n\t\"code.google.com/p/go-uuid/uuid\"\n)\n\ntype Minion interface {\n\t// Get minion identifier\n\tGetUUID() uuid.UUID\n\n\t// Set name of minion\n\tSetName(name string) error\n\n\t// Get name of minion\... | go | edit | 6 | 0 | mit | f3431e75c15a4653d3160125bc5bb38dd6edcb23 | ranjithamca/gru | minion/minion.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage channels\n\nimport (\n \"io\"\n \"os\"\n helperModels \"github.com/SpectraLogic/ds3_go_sdk/helpers/models\"\n)\n\n// Implements the WriteChannelBuilder interface and uses a file as the WriteCloser implementation.\n// This chann... | go | edit | 0 | 2 | apache-2.0 | 867d25f21f55fa6400e68e2bf82f98159fbc97f6 | SpectraLogic/ds3_go_sdk,SpectraLogic/ds3_go_sdk,RachelTucker/ds3_go_sdk,RachelTucker/ds3_go_sdk | helpers/channels/objectWriteChannelBuilder.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"github.com/codegangsta/cli\"\n\t\"os\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"go-http-server\"\n\tapp.Usage = \"Start web server and public your current directory.\"\n... | go | edit | 0 | 2 | mit | 5fab9da21eef9999d57c681322d4e27ef5e5261a | k-kawa/go-http-server,k-kawa/go-http-server | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage packet\n\nimport \"github.com/spf13/cobra\"\n\nfunc deleteCmd() *cobra.Command {\n\tcmd := &cobra.Command{}\n\treturn cmd\n}\n\n```\n\nApply this change: Add support for deleting packet machines"
},
{
"role": "assistant",
"c... | go | edit | 3 | 10 | apache-2.0 | cece2c35381eba83611603c4c66e4dff0267e96c | sashajeltuhin/ket,apprenda/kismatic-provision,apprenda/kismatic-provision,sashajeltuhin/ket | provision/packet/delete.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage text\n\n// This package contains strings to be used in error messages and calls to\n// action for the enterprise product.\n\nconst (\n\t// OpenSourceProduct is the name of opensource Pachyderm.\n\tOpenSourceProduct = \"Pachyderm Communi... | go | edit | 0 | 0 | apache-2.0 | e19823dd5d8228c1c3bbaaeb67f9413906792950 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs | src/server/enterprise/text/text.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/cloudtools/ssh-cert-authority/util\"\n\t\"github.com/codegangsta/cli\"\n\t\"os\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"ssh-cert-authority\"\n\tapp.EnableBashCompletion = true\n\tapp.... | go | edit | 27 | 1 | bsd-2-clause | a5da770fe9d2a5850f8bd36a4ae0c20fd0b9d5a6 | awu-platfora/ssh-cert-authority,postfix/ssh-cert-authority,awu-platfora/ssh-cert-authority,cloudtools/ssh-cert-authority,cloudtools/ssh-cert-authority,postfix/ssh-cert-authority | main.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"C\"\nimport (\n\t\"github.com/unigornel/go-tcpip/ethernet\"\n\t\"github.com/unigornel/go-tcpip/icmp\"\n\t\"github.com/unigornel/go-tcpip/ipv4\"\n)\n\nfunc main() {}\n\n//export Main\nfunc Main(unused int) {\n\tsourceIP ... | go | edit | 3 | 5 | bsd-2-clause | 1335b6df03f034a7a3be064f4126ad11fd520dc8 | unigornel/unigornel,unigornel/unigornel | integration_tests/tests/network/ping/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"github.com/ibrt/go-oauto/oauto/api\"\n\t\"net/http\"\n\t\"fmt\"\n\t\"encoding/json\"\n\t\"github.com/go-errors/errors\"\n\t\"bytes\"\n\t\"io/ioutil\"\n)\n\nfunc Authenticate(baseURL string, request *api.Authentic... | go | edit | 0 | 6 | mit | d141ae3c35f5711fb78b9b134cdf14927a84b79c | ibrt/go-oauto,ibrt/go-oauto | oauto/client/authenticate.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/asdine/storm\"\n\t\"github.com/labstack/echo\"\n\n\t\"github.com/genesor/cochonou/http\"\n\t\"github.com/genesor/cochonou/os\"\n)\n\nfunc main() {\n\te := echo.New()\n\n\tdb, err := storm.Open(os.GetEnvW... | go | edit | 0 | 2 | mit | 34f0b673e632a18d4cd94c692838a4f79aeb17f8 | genesor/cochonou,genesor/cochonou,genesor/cochonou | cmd/cochonou/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage medtronic\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\tbolus Command = 0x42\n\n\tmaxBolus = 25000 // milliUnits\n)\n\n// Bolus delivers the given amount of insulin as a bolus.\n// For safety, this command is not attempted more than once.\nfu... | go | edit | 12 | 6 | mit | 66be70de94c668405564be0221c594bbfaded72c | ecc1/medtronic,ecc1/medtronic | bolus.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\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nfunc rootVolPath() string {\n\tvolumes, err := filepath.Glob(\"/Volumes/*\")\n\tif err != nil || volumes == nil {\n\t\tlog.Println(\"Unable t... | go | edit | 0 | 6 | mit | 90fc1aa88eb8100117bce546aee751951cf51b2f | rselph/sumcheck | fs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"expvar\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/bmizerany/pat\"\n\t\"github.com/codegangsta/negroni\"\n\t\"github.com/meatballhat/negroni-logrus\"\n\t\"github.com/unrolled/render\"\n)\n\nfunc main() {\n\tRun... | go | edit | 3 | 2 | mit | e992a8d75516a96dcfd718d028a58ab55d599330 | mattbostock/leavediary | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2010 The W32 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 w32\n\nimport (\n \"fmt\"\n \"syscall\"\n \"unicode/utf16\"\n ... | go | edit | 0 | 4 | bsd-3-clause | cf97444fc21cb98950213d042b248e540e706be9 | bnagy/w32,NeilBryant/w32,yamnikov-oleg/w32,MeGaPk/w32,yyljlyy/w32,shirou/w32,VividCortex/w32,alaska/w32 | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"io/ioutil\"\n\t\"flag\"\n\t\"log\"\n)\n\nvar (\n\telim = flag.String(\"e\", \"\", \"Eliminate this (one-character) function.\")\n)\n\nfunc main() {\n\tflag.Parse()\n\tvar input []byte\n\tif fla... | go | edit | 35 | 8 | bsd-3-clause | 021f0c1b6a844b4160a06bd59076dd08adc1d1e9 | anschelsc/pure,anschelsc/pure | main.go | rejected_lint | Too many lint violations: 35 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2021 The Tekton Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/l... | go | edit | 0 | 2 | apache-2.0 | 1e00760623cc4e12c2cab308b0d39e600b1877e9 | tektoncd/pipeline,tektoncd/pipeline | pkg/apis/pipeline/v1beta1/version_validation.go | accepted | null | 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\"net\"\n)\n\nconst PORT = \"2525\"\n\nfunc main() {\n\tserver := createServer(PORT)\n\n\tdefer server.Close()\n\n\tfor {\n\t\tconn, err := server.Accept()\n\n\t\tif err != nil {\n\... | go | edit | 9 | 5 | mit | bd3fcdc8170e1d3f1ac544463e4babf2df00969f | frodsan/mat | mt.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage projects\n\nimport (\n\t\"testing\"\n)\n\nfunc TestIsValidInventoryPath(t *testing.T) {\n\tif !IsValidInventoryPath(\"inventories/test\") {\n\t\tt.Fatal(\" a path below the cwd should be valid\")\n\t}\n\n\tif !IsValidInventoryPath(\"inv... | go | edit | 0 | 7 | mit | d27a91cca43780ec8dd0f3c02d7e7d7b49bdcb06 | ansible-semaphore/semaphore,ansible-semaphore/semaphore,ansible-semaphore/semaphore,youhong316/semaphore,youhong316/semaphore,ansible-semaphore/semaphore,youhong316/semaphore,youhong316/semaphore | api/projects/inventory_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"misc/calc/eval\"\n\t\"os\"\n)\n\nvar version = \"0.1\"\n\nfunc main() {\n\tflag.Parse()\n\tif flag.NArg() >= 1 {\n\t\tdata, err := ioutil.ReadFile(flag.Arg(0))\n... | go | edit | 0 | 7 | bsd-2-clause | 23482f307420b8369a3e0277b3d46da0f3205dd8 | rthornton128/gocalc | repl.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Gockle simplifies and mocks github.com/gocql/gocql.\n//\n// Gockle provides the basic abilities to insert, query, and mutate data, as\n// well as access to basic keyspace and table metadata.\n//\n// The entry point is NewSession or NewSimple... | go | edit | 0 | 0 | apache-2.0 | 2d9ac52ee8b32555a86662eefa8361cdf0fe02e5 | willfaught/gockle | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage octokit\n\nimport (\n\t\"github.com/lostisland/go-sawyer\"\n\t\"net/url\"\n)\n\ntype M map[string]interface{}\n\ntype Hyperlink string\n\n// TODO: find out a way to not wrapping sawyer.Hyperlink like this\nfunc (l *Hyperlink) Expand(m M... | go | edit | 0 | 3 | mit | 82d6616b8cff53de886f1d5fc9cca64ee9e68deb | calavera/go-octokit,half-ogre/go-octokit,octokit/go-octokit,pcasaretto/go-octokit,half-ogre/go-octokit,octokit/go-octokit,pcasaretto/go-octokit,calavera/go-octokit | hyperlink.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage oddb\n\nimport (\n\t\"fmt\"\n)\n\n// A RecordNotFoundError is an implementation of error which represents\n// a record is not found in a Database\ntype RecordNotFoundError struct {\n\tKey string\n\tConn Conn\n}\n\nfunc (e *RecordNotFou... | go | edit | 0 | 1 | apache-2.0 | ed9b4cfbfcd651a08713d30fcd556ac4ec4699b6 | SkygearIO/skygear-server,SkygearIO/skygear-server,rickmak/skygear-server,rickmak/skygear-server,SkygearIO/skygear-server,rickmak/skygear-server,SkygearIO/skygear-server | oddb/database.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage memory_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/ulule/limiter/v3\"\n\t\"github.com/ulule/limiter/v3/drivers/store/memory\"\n\t\"github.com/ulule/limiter/v3/drivers/store/tests\"\n)\n\nfunc TestMemoryStoreSequentialA... | go | edit | 0 | 1 | mit | 621f96386155fd79afc42b50aa2d840ddf025fea | ulule/limiter,ulule/limiter | drivers/store/memory/store_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"net/url\"\n\t\"strconv\"\n\n\t\"github.com/docker/docker/api/types/swarm\"\n\t\"golang.org/x/net/context\"\n)\n\n// SecretUpdate updates a Secret. Currently, the only part of a secret spec\n// which can be update... | go | edit | 6 | 1 | apache-2.0 | 26816a911a5e12b2b78c66b958030fbc18193b6f | e11137/cli,thaJeztah/cli,allencloud/cli,cpuguy83/cli,gdevillele/cli,riyazdf/cli,redpanda/cli,docker/cli,cpuguy83/cli,riyazdf/cli,dnephin/cli,thaJeztah/cli,Zebrilee/cli,docker/cli,e11137/cli,ashfall/cli,redpanda/cli,Zebrilee/cli,dnephin/cli,ashfall/cli,allencloud/cli | secret_update.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stager\n\nimport (\n\t\"fmt\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n)\n\ntype backend struct {\n\tproxy *httputil.ReverseProxy\n}\n\ntype backendManager struct {\n\tbackends map[string]*backend\n\tsuffixLength int\n}\n\nfunc (m b... | go | edit | null | null | mit | fa51889b9816ee7456d5e98b32572cca3f32abdb | go-stager/stager,go-stager/stager | backends.go | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"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\n// Used to crash the compiler.\n// http://code.google.c... | go | edit | 3 | 1 | bsd-3-clause | 83372e07c5f355e275822be2b47e6d0bde1b4084 | sanjosh/sanjos100-tipc,webfd/go-zh,rflanagan/reginaldflanagan-project1,mhennings/marcohennings-go,scirelli/scirelli-go,d0f/go-zh,rflanagan/reginaldflanagan-project1,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-str... | test/fixedbugs/bug215.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"os\"\n\t\"os/user\"\n)\n\n/*GetUserHomeDir returns the home directory of the current user.\n */\nfunc GetUserHomeDir() string {\n\tusr, err := user.Current()\n\t// If the current user cannot be reached, get the HO... | go | edit | 0 | 2 | mit | c6a6a0cfc1752b48763d764c92b8caf74b0cf522 | k0pernicus/goyave | utils/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage imageproxy\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n)\n\ntype Image struct {\n\tType string\n\tData []byte\n}\n\nfunc (image *Image) serialize() (serialized []byte, err error) {\n\tbuffer := bytes.NewBuffer([]byte{})\n\tencoder := ... | go | edit | 0 | 2 | mit | 92a7e3585fa8811d151f3447afecd3809645ae01 | pierrre/imageserver | image.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage beam\n\ntype Verb uint32\n\nconst (\n\tAck Verb = iota\n\tAttach\n\tConnect\n\tError\n\tFile\n\tGet\n\tLog\n\tLs\n\tSet\n\tSpawn\n\tStart\n\tStop\n\tWatch\n)\n\n```\n\nApply this change: Add string representation of verb enum\n\nDocker-... | go | edit | 0 | 14 | apache-2.0 | 878e88e777419ad5bd69ba537c062df7db26a7d4 | dmcgowan/libchan,docker/libchan,wangtuanjie/libchan,beni55/libchan | verbs.go | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lb\n\nimport (\n\t\"math/rand\"\n\t\"time\"\n)\n\n// Implement a load balancer that given a set of requests distributes those\n// requests to an arbitrary number of weighted backends\n\ntype Backend struct {\n\tName string\n\tWeight ... | go | edit | 0 | 3 | apache-2.0 | 7760ebe659fcc116bab1eaf747362e62849cd507 | negz/practice | lb/lb.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sarama\n\nimport \"encoding/binary\"\n\n// LengthField implements the PushEncoder and PushDecoder interfaces for calculating 4-byte lengths.\ntype lengthField struct {\n\tstartOffset int\n}\n\nfunc (l *lengthField) saveOffset(in int) {\... | go | edit | 9 | 2 | mit | 385ffd4bee9501add7c6495bbe2dd3896c248751 | remerge/sarama,Shopify/sarama,vrischmann/sarama,DataDog/sarama,mailgun/sarama,VividCortex/sarama,mailgun/sarama,vrischmann/sarama,DataDog/sarama,remerge/sarama,VividCortex/sarama,Shopify/sarama | length_field.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux solaris\n\npackage sys\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\n// StatAtime returns the Atim\nfunc StatAtime(st *syscall.Stat_t) syscall.Timespec {\n\treturn st.Atim\n}\n\n// StatCtime returns the Ctim\nfunc StatCtime(st *s... | go | edit | 0 | 1 | apache-2.0 | d994d08664b9e1184696b2a91264f27a556afb70 | estesp/containerd,crosbymichael/containerd,kunalkushwaha/containerd,dmcgowan/containerd,containerd/containerd,miaoyq/containerd,dmcgowan/containerd,kunalkushwaha/containerd,vdemeester/containerd,thaJeztah/containerd,estesp/containerd,mikebrow/containerd,miaoyq/containerd,containerd/containerd,vdemeester/containerd,thaJ... | sys/stat_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage edn\n\nimport . \"testing\"\n\nfunc TestEmptyGivesOnlyEOF(t *T) {\n\tlexer := Lex(\"\")\n\ttoken, _ := lexer.Next()\n\n\tif token.kind != tEOF {\n\t\tt.Error(\"expecting EOF\")\n\t}\n}\n\n// I suspect there's a potential race condition ... | go | edit | 21 | 5 | mit | 0af0f26d8af43efe804388beb50a27e6ed10ce94 | bjeanes/gojure,bjeanes/gojure | edn/lexer_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage image\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/hash\"\n\t\"github.com/Symantec/Dominator/lib/objectserver\"\n)\n\nfunc (image *Image) listObjects() []hash.Hash {\n\thashes := make([]hash.Hash, 0, image.FileSystem.NumRegularIno... | go | edit | 6 | 4 | apache-2.0 | ba437768c79289b8d84b26353b61201b3796d69a | keep94/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator | lib/image/list.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// Split the buffer by '\\n' (0x0A) characters, return an byte[][] of\n// indicating each metric, and byte[] of the remaining parts of the buffer\nfunc ParseBuffer(buffer []byte) ([][]byte, []byte) {\n\tmetrics := make([][]byte,... | go | edit | 0 | 5 | mit | f6b8e58644155275d67b069d596f1ae6ac3b46b8 | samgiles/graphiteauthd | buffer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2019 The Ebiten Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://w... | go | edit | 0 | 0 | apache-2.0 | ba08a5bb55dd7766417e1f7446107efd3966d038 | hajimehoshi/ebiten,hajimehoshi/ebiten | event/modifier.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage newedit\n\n// Elvish code for default bindings, assuming the editor ns as the global ns.\nconst defaultBindingsElv = `\ninsert:binding = (binding-map [\n &Ctrl-D= $commit-eof~\n &Default= $insert:default-handler~\n])\n`\n\n// vi: set... | go | edit | 0 | 0 | bsd-2-clause | c42b1214288dd32d6bcfb89ef5a9926f6228889b | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | newedit/default_bindings.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ntdll\n\nimport (\n\t\"fmt\"\n)\n\ntype NtStatus uint32\n\nfunc (s NtStatus) Error() error {\n\tif s == 0 {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"NtStatus %08x\", s)\n}\n\n```\n\nApply this change: Add NtStatus convenience functio... | go | edit | 6 | 2 | bsd-2-clause | c6c45d55bf0362253e6473038367e4e8193472ad | hillu/go-ntdll | ntstatus.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage kwiscale\n\nimport (\n\t\"crypto/md5\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// StaticHandler handle static files handlers. Use App.SetStatic(path) that create the static handler\ntype staticHandler struct {\n\... | go | edit | 21 | 2 | bsd-3-clause | b6b146241d628d7a5502c05d01f879366be69ec6 | kwiscale/framework | statichandler.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"github.com/summerwind/h2spec/config\"\n\t\"github.com/summerwind/h2spec/spec\"\n\t\"golang.org/x/net/http2\"\n)\n\nfunc StreamIdentifiers() *spec.ClientTestGroup {\n\ttg := NewTestGroup(\"5.1.1\", \"Stream Identi... | go | edit | 3 | 2 | mit | e0e48abada5f038dae0321969b7c0d5c682b5984 | summerwind/h2spec | client/5_1_1_stream_identifiers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage text\n\nimport \"unicode\"\n\ntype Query interface {\n\tMatch(string) int\n}\n\n// Word matches complete words only.\n// The \"complete words\" of a string s is defined as the result of\n// splitting the string on every single Unicode w... | go | edit | 0 | 13 | mit | a1e20592162092a9c076bac666692b0786b8fe40 | kayex/sirius | text/query.go | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage worker\n\nimport (\n\t\"github.com/pachyderm/pachyderm/src/client/pps\"\n)\n\n// MatchDatum checks if a datum matches a filter. To match each string in\n// filter must correspond match at least 1 datum's Path or Hash. Order of\n// filt... | go | edit | 0 | 5 | apache-2.0 | b0e269039696dee572daf065f323b6f3f3007ee4 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs | src/server/pkg/worker/worker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dockerguard\n\ntype DockerInfo struct {\n\t// Infos from docker api /version\n\tAPIVersion string `json:\"ApiVersion\"`\n\tArch string `json:\"Arch\"`\n\tExperimental bool `json:\"Experimental\"`\n\tGitCommit string `... | go | edit | 0 | 0 | mit | 6d61cab90a93a50d01842c45e8c610686fdcb5af | 90TechSAS/libgo-docker-guard | docker-structs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 Apcera Inc. All rights reserved.\n\npackage graft\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\tClusterNameErr = errors.New(\"grafty: Cluster name can not be empty\")\n\tClusterSizeErr = errors.New(\"grafty: Cluster size can not ... | go | edit | 0 | 0 | apache-2.0 | e778dd4714d9b9cd2c69ca7b8437cbda94328ce6 | nats-io/graft,nats-io/graft,glycerine/graft | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/evandbrown/dm/googlecloud\"\n\t\"github.com/evandbrown/dm/util\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar statCmd = &cobra.Command{\n\tUse: \"stat\",\n\tShort: \"Stat a deployment, list... | go | edit | 6 | 2 | apache-2.0 | 8c0792e5bd75542088bef7d5c65b98d431d11be3 | evandbrown/dm,evandbrown/dm,evandbrown/dm | commands/stat.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fizzbuzz\n\nconst (\n\tfizz = \"Fizz\"\n\tbuzz = \"Buzz\"\n)\n\nfunc Run(limit int) []string {\n\tv := make([]string, 0)\n\tfor i := 1; i <= limit; i++ {\n\t\tthrees := i%3 == 0\n\t\tfives := i%5 == 0\n\t\tswitch {\n\t\tcase threes && f... | go | edit | 0 | 6 | mit | d962d51677f56f8b81f4d8d2d6428ead848f3e11 | devinschulz/experiments | fizzbuzz/fizzbuzz/fizzbuzz.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage grayt\n\ntype Camera interface {\n\tMakeRay(x, y float64) ray\n}\n\ntype RectilinearCamera struct {\n\tscreenX, screenY Vect\n\tscreenLoc Vect\n\teyeLoc Vect\n}\n\nfunc NewRectilinearCamera() *RectilinearCamera {\n\tret... | go | edit | 18 | 1 | mit | 978b79394c5c93dc9eb98c32a2bd648b6a73a28c | peterstace/grayt,peterstace/grayt,peterstace/grayt | camera.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sarama\n\nimport (\n\t\"encoding/binary\"\n\t\"hash/crc32\"\n)\n\n// crc32Field implements the pushEncoder and pushDecoder interfaces for calculating CRC32s.\ntype crc32Field struct {\n\tstartOffset int\n}\n\nfunc (c *crc32Field) saveOf... | go | edit | 3 | 2 | mit | 8fa523b125135bbd6f7965798f7fd33f0cfbff26 | vrischmann/sarama,Shopify/sarama,DataDog/sarama,crast/sarama,Neuw84/sarama,HelixEducation/sarama,raisemarketplace/sarama,kmiku7/sarama,scalingdata/sarama,cep21/sarama,Neuw84/sarama,Shopify/sarama,DataDog/sarama,HelixEducation/sarama,cep21/sarama,raisemarketplace/sarama,remerge/sarama,jimmykuo/sarama,jepst/sarama,VividC... | crc32_field.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/* This example demonstrates reading a string from input, rather than a \n * single character. Note that only the 'n' versions of getstr have been\n * implemented in goncurses to ensure buffer overflows won't exist */\n\npackage main\n\nimport ... | go | edit | 0 | 1 | bsd-3-clause | fdb36c2c6e8f3691253317620fa7c59380933dd8 | nodar-chkuaselidze/goncurses,aquarat/goncurses,snuk182/goncurses,cha87de/goncurses,bluzye/goncurses,cha87de/goncurses,nodar-chkuaselidze/goncurses,bluzye/goncurses,aquarat/goncurses,cha87de/goncurses,snuk182/goncurses | examples/getstr/getstr.go | rejected_duplicate | Near-duplicate of sample 117198 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage prober\n\ntype Prober interface {\n\tProbe() error\n}\n\n```\n\nApply this change: Add a tiny bit of documentation for lib/prober package."
},
{
"role": "assistant",
"content": "package prober\n\n// Prober defines a type tha... | go | edit | 0 | 0 | apache-2.0 | 06791dc89fd65f43d16adde568510ae1eda3e089 | rgooch/health-agent,Symantec/health-agent,Symantec/health-agent,rgooch/health-agent | lib/prober/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/tomlanyon/toy-gobot/robot\"\n\nfunc main() {\n\tr := robot.NewRobot(0,5,0,5)\n\tr.Dump()\n}\n\n```\n\nApply this change: Test new functionality in \"robot\" cmd tool."
},
{
"role": "assistant",
"c... | go | edit | 0 | 6 | mit | ff1954998bc49a634c3f759f0d280aa28c75108d | tomlanyon/toy-gobot | cmd/robot/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"github.com/phss/fcal/calendar\"\n\t\"log\"\n\t\"time\"\n)\n\nfunc main() {\n\tdate := parseOptions()\n\tc := calendar.CalendarMonthFrom(date)\n\tcalendar.PrintMonth(c)\n}\n\nfunc parseOptions() time.Tim... | go | edit | 0 | 3 | mit | d7c29acdf0691d2cd6d8b9ce13c485f524c6747c | phss/fcal | fcal.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os/exec\"\n\t\"testing\"\n)\n\nfunc TestDmesg(t *testing.T) {\n\t\n\tout, err := exec.Command(\"go\", \"run\", \"dmesg.go\", \"-c\").Output()\n\tif err != nil {\n\t\tt.Fatalf(\"can't run dmesg: %v\", err)\n\t}\n\n\... | go | edit | 3 | 6 | bsd-3-clause | 1b77ec6c018fe09f29bebf556e9ac0a5d6d09faa | u-root/u-root,GanShun/u-root,u-root/u-root,u-root/u-root,hugelgupf/u-root,GanShun/u-root,rminnich/u-root,hugelgupf/u-root,hugelgupf/u-root,rminnich/u-root,hugelgupf/u-root,rminnich/u-root,rminnich/u-root,GanShun/u-root | cmds/dmesg/dmesg_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logmatic\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"time\"\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"os\"\n)\n\nconst defaultTimestampFormat = time.RFC3339\nvar markers = [2]string{\"sourcecode\", \"golang\"}\n\ntype JSONFormatte... | go | edit | 0 | 3 | mit | 8ed5e483884e6af524b0447a30b6911d33dad172 | logmatic/logmatic-go | json_formatter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ws\n\nimport (\n\t\"code.google.com/p/go.net/websocket\"\n\t\"time\"\n)\n\ntype Connection struct {\n\tRawConn *websocket.Conn\n\tReceivedMessages []string\n\tTimeout time.Duration\n\tunreadMessages []string\n}\n\nfu... | go | edit | 0 | 3 | mit | 4b4186c07b3fe7d00ba97423ebd6feea28e9f9c7 | straytaoist/testflight,drewolson/testflight,Thermeon/testflight | ws/connection.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dsbldr\n\nimport (\n\t\"fmt\"\n)\n\n// BasicOAuthHeader spits out a basic OAuth Header based on access token\nfunc BasicOAuthHeader(consumerKey, nonce, signature, signatureMethod,\n\ttimestamp, token string) string {\n\treturn fmt.Sprin... | go | edit | 0 | 5 | mit | 69ad5d9568b51cc5fc191a428e054b9f5128dce9 | Korede-TA/dsbldr | util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"holux\"\n)\n\nfunc main() {\n\tc, err := holux.Connect()\n\n\tif err != nil {\n\t\t// TODO LOG\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tc.Hello()\n\tdefer c.Bye()\n\n\tindex, err := c.GetIndex()\n\tif e... | go | edit | 0 | 4 | bsd-2-clause | 49d01b6090743bec555987680eba18b776ad76f8 | arsatiki/gpsport260tool | holux-dl/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metadata\n\n// Restrict to Linux because, although omreport runs fine on Windows, the\n// Windows metadata uses WMI to fetch this information.\n\nimport (\n\t\"strings\"\n\n\t\"bosun.org/util\"\n)\n\nfunc init() {\n\tmetafuncs = append(... | go | edit | 9 | 4 | mit | de6d1b848f0245955467fb6e0fe9a38748cebe13 | Dieterbe/bosun,Dieterbe/bosun,vimeo/bosun,vimeo/bosun,Dieterbe/bosun,vimeo/bosun,Dieterbe/bosun,vimeo/bosun | metadata/metadata_dell_linux.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015, David Howden\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage index\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"os\"\n)\n\n// PersistStore is a type whic... | go | edit | 0 | 6 | bsd-2-clause | e226888544bee976cb18b25c0ae0f648f990dc22 | GrahamGoudeau21/tchaik,tchaik/tchaik,GrahamGoudeau21/tchaik,tchaik/tchaik,tchaik/tchaik,GrahamGoudeau21/tchaik,tchaik/tchaik,GrahamGoudeau21/tchaik | index/persist.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"board\"\n\t\"color\"\n\t\"fmt\"\n\t\"point\"\n)\n\nfunc scanMove() (*point.Move, error) {\n\tvar file byte\n\tvar rank int\n\n\t_, err := fmt.Scanf(\"%c%d\", &file, &rank)\n\treturn point.NewMove(file, rank), err\n... | go | edit | 0 | 7 | mit | 5ed85c6b3ffa1a647cda61b7ce3aa0c7ec2f372e | Roadagain/Chess | src/chess/main.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.