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 commands\n\nimport (\n\t\"github.com/centurylinkcloud/clc-go-cli/base\"\n)\n\ntype CommandBase struct {\n\tInput interface{}\n\tOutput interface{}\n\tExcInfo CommandExcInfo\n}\n\ntype CommandExcInfo struct {\n\tVerb string\n\tUrl... | go | edit | 0 | 1 | apache-2.0 | c2318c34991b1bb129e6db883a0a58b140aa97f1 | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | commands/command_base.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\n// Post represents a Facebook Post\n//\n// https://developers.facebook.com/docs/graph-api/reference/v2.4/post\ntype Post struct {\n\tID string `json:\"id\"`\n\tMessage string `json:\"message,omitempty\"`\n}\n\n```\n\nApply... | go | edit | 0 | 0 | mit | 302d2b0c2d169d8ad898f4a6758a85fd65aa798f | deiwin/facebook | model/post.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gamerules\n\nimport (\n\t\"os\"\n\n\t\"chunkymonkey/command\"\n)\n\n// GameRules is a container type for block, item and recipe definitions.\nvar (\n\tBlocks BlockTypeList\n\tItems ItemTypeMap\n\tRecipes *R... | go | edit | 27 | 6 | mit | 4b096a43a4996addb151418eceee3a595fab61d2 | huin/chunkymonkey,huin/chunkymonkey | src/chunkymonkey/gamerules/gamerules.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nconst (\n\t// Version of Rikka\n\tVersion = \"0.2.0\"\n)\n\n```\n\nApply this change: Revert \"update version to 0.2.0\"\n\nThis reverts commit ce6aec180fda6da1d85af778273805f363b9609f."
},
{
"role": "assistant",
"con... | go | edit | 0 | 0 | mit | 6ac93a38d4af760b588995c3212374b3f3441b51 | 7sDream/rikka,7sDream/rikka,7sDream/rikka | api/consts.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.a... | go | edit | 0 | 3 | apache-2.0 | bb9d4ade0b677d7f84deec9c354e372edba6a2ec | Jean-Daniel/node_exporter,derekmarcotte/node_exporter,bs-github/node_exporter,derekmarcotte/node_exporter,Jean-Daniel/node_exporter,derekmarcotte/node_exporter,chosenken/node_exporter,ema/node_exporter,prometheus/node_exporter,chosenken/node_exporter,siavashs/node_exporter,knweiss/node_exporter,prometheus/node_exporter... | collector/uname_linux_int8.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage txtdirect\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar dockerRegexs = map[string]string{\n\t\"_catalog\": \"^/v2/_catalog$\",\n\t\"tags\": \"^/v2/(.*)/tags/(.*)\",\n\t\"manifests\": \"^/v2/(.*)/manifests/(.*)\",\n... | go | edit | 3 | 4 | apache-2.0 | ff1a208dc8b4cf6dce7d584cc61d1395606d85a5 | txtdirect/txtdirect | dockerv2.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mesos\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/CiscoCloud/mesos-consul/registry\"\n)\n\nfunc (sj *StateJSON) GetFollowerById(id string) (string, error) {\n\tfor _, f := range sj.Followers {\n\n\t\tif f.Id == id {\n\t\t\treturn f.Hostnam... | go | edit | 6 | 6 | apache-2.0 | 57686db26173e59898a68ac9c1631f51d0dd36be | CiscoCloud/mesos-consul,mantl/mesos-consul | mesos/state.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/FiloSottile/CVE-2016-2107/LuckyMinus20\"\n)\n\nfunc main() {\n\tres, err := LuckyMinus20.Test(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Vulnerable:\"... | go | edit | 0 | 3 | mit | 048af03cc80792259958aa3d1761fa6db0247f72 | FiloSottile/CVE-2016-2107 | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sensu\n\nimport \"fmt\"\n\n// GetEvents Return all the current events\nfunc (s *Sensu) GetEvents() ([]interface{}, error) {\n\treturn s.GetList(\"events\", 0, 0)\n}\n\n// GetEventsForClient Returns the current events for given client\nf... | go | edit | 0 | 2 | mit | 10735dacff0d670a47abc378c6823ee3398e9cf9 | bencaron/gosensu | events.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage manifest\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/cli/cli\"\n\t\"github.com/docker/cli/cli/command\"\n\n\t\"github.com/spf13/cobra\"\n)\n\n// NewManifestCommand returns a cobra command for `manifest` subcommands\nfunc NewManifest... | go | edit | 12 | 1 | apache-2.0 | 2d29732f403770d281232e1b08ebe41812600903 | docker/cli,cpuguy83/cli,docker/cli,dnephin/cli,dnephin/cli,thaJeztah/cli,cpuguy83/cli,thaJeztah/cli | cli/command/manifest/cmd.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"github.com/lifesum/configsum/pkg/errors\"\n\n\t\"testing\"\n)\n\nfunc TestLocationInvalidLocale(t *testing.T) {\n\tvar (\n\t\tinput = []byte(`{\"locale\": \"foobarz\"}`)\n\t\tl = location{}\n\t)\n\n\terr := l... | go | edit | 9 | 3 | mit | 3b690f5544505c0d20caa85be5fc1247b3561650 | lifesum/configsum,lifesum/configsum | pkg/config/endpoint_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goat\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"strconv\"\n)\n\n// Listener interface method Listen defines a network listener which accepts connections\ntype Listener interface {\n\tListen(chan bool)\n}\n\n// HTTPListener listens for HTTP ... | go | edit | 12 | 2 | mit | aedd45d86a884cfcf6579a817e7cf8311bc9a6c4 | mdlayher/goat | goat/listener.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/exec\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestMultipleAttachRestart(t *testing.T) {\n\tcmd := exec.Command(dockerBinary, \"run\", \"--name\", \"attacher\", \"-d\", \"busybox\",\n\t\... | go | edit | 24 | 3 | apache-2.0 | eb97163348d88954dbacbcbc7eed71efd666dddc | DBCDK/docker,jvgogh/docker,13W/docker,projectatomic/docker,aboch/docker,kdomanski/docker,rvesse/docker,inatatsu/docker,vdemeester/docker,docker/docker.github.io,vdemeester/docker,jecarey/docker,geekylucas/docker,ntrvic/docker,wzzrd/docker,jthelin/docker,bdwill/docker.github.io,Distrotech/docker,chenrui2014/docker,j-mra... | integration-cli/docker_cli_attach_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nvim\n\nimport \"github.com/garyburd/neovim-go/vim\"\n\nfunc Echomsg(v *vim.Vim, msg string) error {\n\treturn v.Command(\"echomsg '\" + msg + \"'\")\n}\n\nfunc Echoerror(v *vim.Vim, msg string) error {\n\treturn v.Command(\"echoerr '\"... | go | edit | 0 | 1 | bsd-3-clause | 4fb83fc9136f671c5ca5361ac9e940a5e253cdca | zchee/nvim-go,zchee/nvim-go | src/nvim-go/nvim/command.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage viber\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\n// PostData to viber API\nfunc (v *Viber) PostData(url string, i interface{}) ([]byte, error) {\n\tb, err := json.Marshal(i)\n\tif err != nil {\n... | go | edit | 6 | 5 | mit | 46ce29dc34b300f1b704cfcb921d109bdff7ffc4 | mileusna/viber | request.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cyberark\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNewClientHostIsRequired(t *testing.T) {\n\t_, err := NewClient()\n\tassert.NotNil(t, err)\n\tassert.Equal(t, \"host is required\",... | go | edit | 12 | 1 | mit | d425954d435d1c30f3e4790c6889c6e709458b7f | hoop33/go-cyberark | client_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage httpd\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/html\"\n\t\"net/http\"\n)\n\nfunc statusHandler(w http.ResponseWriter, req *http.Request) {\n\twriter := bufio.NewWriter(w)\n\tdefer writer.Flush()\n\tfmt.... | go | edit | 3 | 3 | apache-2.0 | ea3b83d0c4b5767163fd019b3e8ad17e65d724c1 | keep94/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator | imageserver/httpd/status.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux,darwin\n\npackage github\n\nimport (\n\t\"code.google.com/p/go.crypto/ssh/terminal\"\n)\n\nfunc isTerminal(fd uintptr) bool {\n\treturn terminal.IsTerminal(int(fd))\n}\n\n```\n\nApply this change: Use not windows build tag"
},... | go | edit | 0 | 1 | mit | c7a917086e16dd9c2c8200ffaa156d6efc3c893f | ASidlinskiy/hub,dongjoon-hyun/hub,elancom/hub,ASidlinskiy/hub,pankona/hub,boris-rea/hub,elancom/hub,terry2000/hub,RichardLitt/hub,AndBicScadMedia/hub,github/hub,sbp/hub,AndBicScadMedia/hub,cpick/hub,jingweno/hub,github/hub,haikyuu/hub,dev4mobile/hub,ASidlinskiy/hub,nmfzone/hub,adjohnson916/hub,hopil/hub,jpkrohling/hub,... | github/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage read\n\n// Fre scores the Flesch reading-ease.\n// See https://en.wikipedia.org/wiki/Flesch–Kincaid_readability_tests#Flesch_reading_ease.\nfunc Fre(text string) float64 {\n\tsylCnt := float64(CntSyls(text))\n\twordCnt := float64(CntWor... | go | edit | 9 | 1 | mit | f8f10d4218610490587cf7df4230bd8602f2b2c7 | BluntSporks/readability | fre.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage Yafg\n\nimport (\n \"net/http\"\n)\n\n// A wrapper of http.ResponseWriter\ntype Response struct {\n Response http.ResponseWriter\n}\n\nfunc NewResponse(res http.ResponseWriter) *Response {\n response := new(Response)\n response.Resp... | go | edit | 3 | 1 | mit | 057a6b44cfdbfc158d5ee14c92baaa1fd1a37b4c | dinever/golf | response.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fm\n\nimport (\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/token\"\n\t\"os\"\n)\n\ntype ASTWriter interface {\n\tWrite(file *ast.File, filename string) error\n}\n\ntype DiskASTWriter struct{}\n\nfunc (d *DiskASTWriter) Write(file *ast.File, ... | go | edit | 0 | 2 | unlicense | ad9aa00b60b2c8f50a5ba7b3e021bd1183227e14 | enocom/fm,enocom/fm | lib/writer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage discovery\n\nimport (\n\t\"fmt\"\n\t\"github.com/coreos/go-etcd/etcd\"\n)\n\ntype Service interface {\n\tGet(key string) (string, error)\n}\n\ntype Etcd struct {\n\tclient *etcd.Client\n}\n\nfunc NewEtcd(machines []string) *Etcd {\n\tre... | go | edit | 0 | 3 | apache-2.0 | b672f67d45ce77f6bf96834d58f3bd4f3249e1f2 | pquerna/vulcan,vulcand/vulcan,jinzhu/vulcan,FoxComm/vulcan,pquerna/vulcan,mailgun/vulcan | discovery/discover.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dockerignore\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// ReadAll reads a .dockerignore file and returns the list of file patterns\n// to ignore. Note this will trim whitespace from each lin... | go | edit | 0 | 5 | apache-2.0 | 0c2e0491804666bb6c1302bea947eb79ee62a5cd | tonistiigi/buildkit_poc,tonistiigi/buildkit_poc | frontend/dockerfile/dockerignore/dockerignore.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hackedu\n\nimport \"net/http\"\n\nfunc middleware(w http.ResponseWriter, r *http.Request) {\n\tallowCORS(w, r)\n}\n\nfunc allowCORS(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n}\n... | go | edit | 0 | 1 | mit | 3745709c57ebdda8dfb2a4f2c80d5a45ed335a9a | zachlatta/website,hackedu/website,zachlatta/website,hackedu/website,zachlatta/website,hackedu/website | hackedu/middleware.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage unionfs\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\t\"testing\"\n)\n\nvar _ = fmt.Print\nvar _ = log.Print\n\nfunc TestTimedCache(t *testing.T) {\n\tfetchCount := 0\n\tfetch := func(n string) interface{} {\n\t\tfetchCount++\n\t\ti ... | go | edit | 9 | 6 | mit | 0c88a2019cee0329db7c85ecdcc94860a1c7b1e7 | cmars/tools,keybase/go-fuse,cmars/tools,keybase/go-fuse,cmars/tools,keybase/go-fuse,cmars/tools | unionfs/timedcache_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage formatters\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype winsize struct {\n\tRow uint16\n\tCol uint16\n\tXpixel uint16\n\tYpixel uint16\n}\n\nfunc getTerminalWidth() uint {\n\tws := &winsize{}\n\tretCode, _, errno := syscall... | go | edit | 0 | 1 | apache-2.0 | fd3b39aeb7185f81f29cd66794aa980d21257b25 | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | formatters/terminal_width.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage serverlogger\n\nimport (\n\t\"flag\"\n\t\"github.com/Symantec/Dominator/lib/log/debuglogger\"\n\t\"github.com/Symantec/Dominator/lib/logbuf\"\n\t\"io\"\n)\n\nvar (\n\tinitialLogDebugLevel = flag.Int(\"initialLogDebugLevel\", -1,\n\t\t\"... | go | edit | 6 | 1 | apache-2.0 | bac93c136419b0fa148c37d9b15ba7d48eb69cb4 | keep94/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator | lib/log/serverlogger/api.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"github.com/anonx/sunplate/skeleton/assets/views\"\n\n\t\"github.com/anonx/sunplate/action\"\n)\n\n// App is a sample controller that is used for demonstration purposes.\ntype App struct {\n\t*Controller\n}\n... | go | edit | 12 | 1 | bsd-2-clause | 6940bd44abef845b0af9b8c9916799cf3d8450d0 | goaltools/goal,anonx/sunplate,anonx/sunplate,goaltools/goal,goaltools/goal,anonx/sunplate | skeleton/controllers/app.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2021 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apac... | go | edit | 0 | 0 | apache-2.0 | d51ea83cdd1e57e280ae63f6f41927f9455bcbe2 | GoogleCloudPlatform/hpc-toolkit,GoogleCloudPlatform/hpc-toolkit,GoogleCloudPlatform/hpc-toolkit,GoogleCloudPlatform/hpc-toolkit | pkg/reswriter/tfversions.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/sclevine/agouti/core\"\n\t. \"github.com/sclevine/agouti/internal/integration\"\n\n\t\"os\"\n\t\"testing\"\n)\n\nvar (\n\tpha... | go | edit | 45 | 2 | mit | b0c716ac1de7d8d75bb8b5c58efb9c3bf0d93bbd | sclevine/agouti,abourget/agouti,Etienne42/agouti,Etienne42/agouti,sclevine/agouti,abourget/agouti | internal/integration/integration_suite_test.go | rejected_lint | Too many lint violations: 45 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\ntype LoggingConfig struct {\n\tProjectID string\t\t\t\t\t\t`json:\"project_id\"`\n\tLogName\t\t string\t\t\t\t\t\t`json:\"log_name\"`\n\tType string `json:\"type\"`\n\tLabels map[string]... | go | edit | 6 | 3 | mit | d8df6748560f8f1aab8b9ab9f6a4f0ec6402242e | groovenauts/magellan-gcs-proxy,groovenauts/magellan-gcs-proxy,groovenauts/magellan-gcs-proxy | logging.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage armoredcrypt\n\nimport (\n\t\"fmt\"\n\t\"encoding/base64\"\n\t\"strings\"\n)\n\nconst (\n\t_MAGIC_PREFIX = \"saltybox\"\n\t_V1_MAGIC = \"saltybox1:\"\n)\n\nfunc Wrap(body []byte) string {\n\tencoded := base64.RawURLEncoding.EncodeToStri... | go | edit | 0 | 5 | mit | d5954744cb2752f749b0664607bd310cee3a7061 | scode/saltybox,scode/saltybox | varmor/varmor.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\nimport (\n\t\"github.com/BytemarkHosting/bytemark-client/lib/brain\"\n\t\"strconv\"\n)\n\n// CreateBackupSchedule creates a new backup schedule starting at the given date, with backups occuring every interval seconds\nfunc (c *by... | go | edit | 12 | 3 | mit | f4b704df9445882e9eb414638b7fe20c7fe5f4f3 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | lib/backup_schedule_calls.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage blob\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\nconst (\n\tTemplateFiles = \"templates\"\n\tStaticFiles = \"static\"\n)\n\nfunc GetFile(bucket string, name string) ([]byte, error) {\n\trea... | go | edit | 3 | 6 | apache-2.0 | 9bb682040276d4301a7530889bf3025e58b06903 | brancz/prometheus,gcnonato/prometheus,gesellix/prometheus,dpatel06/prometheus,kzittritsch/prometheus,gcnonato/prometheus,slok/prometheus,alileza/prometheus,trigrass2/prometheus,rajthilakmca/prometheus,kzittritsch/prometheus,slok/prometheus,hustbill/prometheus,gcnonato/prometheus,bluecmd/prometheus,prasincs/prometheus,a... | web/blob/blob.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/citadel/citadel\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar (\n\tlogger = logrus.New()\n\tregistry citadel.Registry\n)\n\nfunc main() {\n\tapp := cli.New... | go | edit | 30 | 2 | mit | c9de83836646dabb4214d3f0f6ff81919735453b | liebo/citadel | citadel/main.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage module3rd\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/cubicdaiya/nginx-build/util\"\n)\n\nfunc Load(path string) ([]Module3rd, error) {\n\tvar modules []Module3rd\n\tif len(path) > 0 {\n\t\tif !util.FileExist... | go | edit | 6 | 7 | mit | 5991bce8fcab3dc37ebe551f441ee2b4228e698c | cubicdaiya/nginx-build,cubicdaiya/nginx-build,cubicdaiya/nginx-build | module3rd/load.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"runtime\"\n\n\t\"github.com/overlordtm/trayhost\"\n)\n\n// TODO: Factor into trayhost.\nfunc trayhost_NewSeparatorMenuItem() trayhost.MenuItem { return trayhost.MenuItem{Title: \"\"} }\n... | go | edit | 0 | 2 | mit | 2c915ae40826eea9eb6cc9f2148d4126dd11b29b | pavben/InstantShare,pavben/InstantShare | client/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nv\n\n\nimport (\n \"encoding/json\"\n \"time\"\n)\n\ntype NV_Event struct {\n ServerID string\n Timestamp time.Time\n ARI_Event string\n}\n\nfunc Init(in chan []byte, out chan *NV_Event) {\n go func(in chan []byte, o... | go | edit | 3 | 2 | apache-2.0 | 1b050e033dc330db5f31e1294573705cc6c2342f | leifmadsen/go-ari-library,nvisibleinc/go-ari-library | go-ari-library.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage observers\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/ivan1993spb/snake-server/world\"\n)\n\ntype LoggerObserver struct{}\n\nfunc (LoggerObserver) Observe(stop <-chan struct{}, w *world.World, logger logrus.FieldLogg... | go | edit | 0 | 5 | bsd-2-clause | a692772a0c0b78220cd6a50a76a2f57db1667b72 | ivan1993spb/clever-snake | observers/logger_observer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stripe\n\n// TerminalConnectionTokenParams is the set of parameters that can be used when creating a terminal connection token.\ntype TerminalConnectionTokenParams struct {\n\tParams `form:\"*\"`\n\n\t// This feature has been deprecated... | go | edit | 3 | 0 | mit | ab33ddcbd734e84b273ee508d380e81cf83ae513 | ChannelMeter/stripe-go,ChannelMeter/stripe-go,stripe/stripe-go,stripe/stripe-go | terminal_connectiontoken.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\npackage uilive\n\nimport (\n\t\"os\"\n\t\"unsafe\"\n)\n\nfunc getTermSize() (int, int) {\n\tout, err := os.Open(\"CONOUT$\")\n\tif err != nil {\n\t\treturn 0, 0\n\t}\n\n\tvar csbi consoleScreenBufferInfo\n\tret, _, _ := pro... | go | edit | 6 | 3 | mit | eafd45c022863b0ad01a61a000d0b19ea60d80a6 | gosuri/uilive | terminal_size_windows.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"regexp\"\n\t\"time\"\n)\n\nfunc main() {\n\tfmt.Println(\"Verifying URLs..\")\n\n\treadmeFile, err := ioutil.ReadFile(\"README.md\")\n\tif err != nil {\n\t\tfmt... | go | edit | 0 | 7 | mit | 1e89060d2bab1985ea3004db09ebae075b098a1e | flyeralarm/onboarding | verify_urls.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n)\n\ntype proxii struct {\n\tconfig *Config\n\tetcd *etcdConnector\n}\n\nfunc (p *proxii) handler(w http.ResponseWriter, r *http.Request) {\n\thost := strings.Spli... | go | edit | 21 | 2 | mit | 894819ddaf7e9c806a0d9aae36f3a994dee21f59 | pierrebeaucamp/proxii | main.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage grpcpool\n\nimport (\n\t\"sync\"\n\n\t\"google.golang.org/grpc\"\n)\n\nfunc newConnectionPool(activeCount int, dialFunc func() (*grpc.ClientConn, error)) (*ConnectionPool, error) {\n\tpool := &ConnectionPool{mu: sync.Mutex{}}\n\tfor i :... | go | edit | 6 | 3 | apache-2.0 | 0bb7b286dca6494f379e90ab7fe6e268e3d1c04f | irfn/grpcpool | grpcpool.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nFluux XMPP is a Go XMPP library, focusing on simplicity, simple automation, and IoT.\n\nThe goal is to make simple to write simple adhoc XMPP clients:\n\n - For automation (like for example monitoring of an XMPP service),\n - For building c... | go | edit | 0 | 0 | apache-2.0 | 3e6cf2c8b006a454c412b0b2c3c5662a1cd522c8 | processone/gox | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage processor\n\nimport \"github.com/materials-commons/mcstore/pkg/db/schema\"\n\n// fileProcess defines an interface for processing different\n// types of files. Processing may include extracting data,\n// conversion of the file to a diffe... | go | edit | 0 | 5 | mit | cffd093d62137f315b89b35ca9c4da53f46497ce | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | server/mcstore/uploads/processor/processor.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mcstore\n\nimport (\n\t\"net/http\"\n\n\tr \"github.com/dancannon/gorethink\"\n\t\"github.com/emicklei/go-restful\"\n)\n\ntype databaseSessionFilter struct {\n\tsession func() (*r.Session, error)\n}\n\nfunc (f *databaseSessionFilter) Fi... | go | edit | 3 | 2 | mit | 6ac2d50e63133d140728b2778dacae8fccc89778 | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | server/mcstore/database_session_filter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goldi\n\nimport \"fmt\"\n\ntype TypeRegistry map[string]*Type\n\nfunc NewTypeRegistry() TypeRegistry {\n\treturn TypeRegistry{}\n}\n\nfunc (r TypeRegistry) RegisterType(typeID string, generatorFunction interface{}) error {\n\tt, err := ... | go | edit | 9 | 2 | mit | 592f52aad04c516eae45ea7d9dd670de7b7df336 | fgrosse/goldi | type_registry.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build acceptance\n\npackage app_test\n\nimport (\n\tstdnet \"net\"\n\t\"time\"\n\n\t\"github.com/DATA-DOG/godog\"\n\t\"github.com/deshboard/boilerplate-grpc-service/test\"\n\t\"github.com/goph/stdlib/net\"\n\t\"google.golang.org/grpc\"\n)\n... | go | edit | 0 | 3 | mit | 9bf35b01d3c75b69f851111678fb1767aeae8cdb | deshboard/boilerplate-grpc-service,deshboard/boilerplate-model-service | pkg/app/acceptance_test.go | rejected_duplicate | Near-duplicate of sample 117224 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage grayt\n\nimport (\n\t\"image/png\"\n\t\"log\"\n\t\"os\"\n)\n\n// Runner is a convenience struct to help run grayt from a main() function.\ntype Runner struct {\n\tPxWide, PxHigh int\n\tBaseName string\n\tQuality float64\n}\... | go | edit | 12 | 2 | mit | 8961b23ed64d67cb7843d54521e7c76347af7096 | peterstace/grayt,peterstace/grayt,peterstace/grayt | main_helper.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage gps\n\nimport \"os/exec\"\n\nfunc killProcess(cmd *... | go | edit | 0 | 1 | bsd-3-clause | 74efbb1aae79671ee5e397407d82172da83da0d5 | ibrasho-forks/dep,golang/dep,ibrasho-forks/dep,golang/dep,golang/dep | internal/gps/cmd_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage setupclient\n\nimport (\n\t\"crypto/tls\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"os\"\n)\n\nfunc setupTls(ignoreMissingCerts bool) error {\n\tif *certDirectory == \"\" {\n\t\treturn nil\n\t}\n\t// Load certificates.\n\tcerts... | go | edit | 6 | 5 | apache-2.0 | b7616cd73e9e2f38bfb022d8f1b4ff74df47874e | rgooch/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,Symantec/Dominator | lib/srpc/setupclient/impl.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage py\n\n/*\n#include \"Python.h\"\n*/\nimport \"C\"\nimport (\n\t\"runtime\"\n)\n\n// Object is a bind of `*C.PyObject`\ntype Object struct {\n\tp *C.PyObject\n}\n\n// DecRef decrease reference counter of `C.PyObject`\n// This function is... | go | edit | 9 | 1 | mit | 213813baf2c1651c916ef32feab4c00ccf2ec895 | sensorbee/py,sensorbee/py | py/pyobject.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\n\t. \"github.com/alphagov/publishing-api\"\n\t. \"github.com/alphagov/publishing-api/testhelpers\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\... | go | edit | 18 | 1 | mit | b3b2f14d13a2b59da23dd3bdab55e223390bf81d | alphagov/publishing-api,alphagov/publishing-api | healthcheck_requests_test.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\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/signal\"\n\t\"showrss/handlers\"\n\n\t\"flag\"\n\n\t\"syscall\"\n\n\t\"github.com/braintree/manners\"\n)\n\nconst version = \"1.0.0\"\n\nfunc main() {\n\tvar httpA... | go | edit | 0 | 5 | mit | 78df0a964c8c19d1833cd6855392bf0f37559caf | teambrookie/showrss,teambrookie/showrss | showrss.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utilities\n\nimport (\n\t\"errors\"\n\t\"unicode/utf8\"\n)\n\n// The string encoding options. Currently only support UTF-8. Don't really\n// see the merit in supporting anything else at the moment.\nconst (\n\tUTF8 = iota\n)\n\n// ErrIn... | go | edit | 0 | 6 | mit | fef74e2503721c58ff1ca59ba49f7b2abaf18011 | mikopits/sdbot | utilities/encoding.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cfgfile\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\t\"gopkg.in/yaml.v2\"\n)\n\n// Command line flags\nvar configfile *string\nvar testConfig *bool\n\nfunc CmdLineFlags(flags *flag.FlagSet, name string) {\n\tconfigfile = fla... | go | edit | 3 | 4 | mit | 5fdedbcce2be1450ca0d254973e61ad74d372cac | yapdns/yapdnsbeat,yapdns/yapdnsbeat | cfgfile/cfgfile.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Graceful restarts and shutdowns are not supported\n// on windows, so using usual http.Serve instead.\n//\n// +build windows\n\npackage main\n\nimport (\n\t\"net/http\"\n)\n\n// serve is a wrapper on standard http.Serve method.\nfunc serve(s ... | go | edit | 0 | 1 | bsd-2-clause | 048d623df27426fed084c29773216f08a40de38c | runner-mei/goal,runner-mei/goal,runner-mei/goal | skeleton/win.go | rejected_duplicate | Near-duplicate of sample 116842 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage syntax\n\nimport \"github.com/ksco/slua/scanner\"\n\ntype SyntaxTree interface{}\n\ntype (\n\tChunk struct {\n\t\tBlock SyntaxTree\n\t}\n\n\tBlock struct {\n\t\tStmts []SyntaxTree\n\t}\n\n\tDoStatement struct {\n\t\tBlock SyntaxTree\n\t... | go | edit | 0 | 0 | mit | 77b95e8c8ba57baefd7c492b43d72c3412d87408 | ksco/SLua | syntax/tree.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ebay\n\nimport \"encoding/xml\"\n\ntype RelistFixedPriceItem struct {\n\tItemID string\n\tStartPrice string `xml:\",omitempty\"`\n\tConditionID uint `xml:\",omitempty... | go | edit | 21 | 1 | isc | 1110d9831c116eed2eb45be210e63f779fb8413a | zombor/go-ebay | command_relist_fixed_price_item.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage target\n\nimport (\n\t\"io\"\n\t\"path/filepath\"\n\n\t\"github.com/spf13/hugo/helpers\"\n\t\"github.com/spf13/hugo/hugofs\"\n)\n\ntype Publisher interface {\n\tPublish(string, io.Reader) error\n}\n\ntype Translator interface {\n\tTrans... | go | edit | 0 | 2 | apache-2.0 | 53c9e890a2ae8790c801a7435758b1dedd2304d0 | bogem/hugo,fedelibre/hugo,mayah/hugo,anthonyfok/hugo,mdhender/hugo,ffrizzo/hugo,sprig/hugo,derekperkins/hugo,bogem/hugo,vbatoufflet/hugo,MarkDBlackwell/hugo,vbatoufflet/hugo,tjyang/hugo,tatsushid/hugo,mitchchn/hugo,gohugoio/hugo,tubo028/hugo,ryanclarke/hugo,fedelibre/hugo,abourget/hugo,fedelibre/hugo,abourget/hugo,bram... | target/file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tailtopic\n\nimport (\n\tavro \"github.com/elodina/go-avro\"\n\tkavro \"github.com/elodina/go-kafka-avro\"\n)\n\ntype avroSchemaRegistryDecoder struct {\n\tdecoder *kavro.KafkaAvroDecoder\n}\n\nfunc newAvroDecoder(schemaregURI string) d... | go | edit | 0 | 2 | mit | 8b3ccf7e2a47d2382ed8ed14cf893fb84e7e3c38 | dejan/tailtopic | avroDecoder.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 The Linux Foundation\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:/... | go | edit | 0 | 0 | apache-2.0 | b3e0e1a33d072b542707005f9f6da66d8de2a021 | vbatts/oci-image-spec,jonboulle/image-spec,vbatts/oci-image-spec,opencontainers/image-spec,opencontainers/image-spec,mattspencer-arm/image-spec,mattspencer-arm/image-spec,jonboulle/image-spec | specs-go/v1/layout.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage onedrive\n\nimport (\n\t\"net/http\"\n\t\"time\"\n)\n\nconst (\n\tversion = \"0.1\"\n\tbaseURL = \"https://api.onedrive.com/v1.0\"\n\tuserAgent = \"github.com/ggordan/go-onedrive; version \" + version\n)\n\n// OneDrive is the entry ... | go | edit | 12 | 1 | mit | 4b874e554a23d0b67f962bd08854d2085d9e1098 | ggordan/go-onedrive | onedrive.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\"net\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\nvar (\n\tsocketName = \"/tmp/dinit.sock\"\n\tsocketMaxLen = 512\n)\n\nfunc startCommand(c net.Conn) {\n\tbuf := make([]byte, socketMaxLen)\n\tn, err := c.Read(buf)\n\n\td... | go | edit | 21 | 4 | bsd-3-clause | 05f69c0736ce06228b2c0d7fecb40e3cefd748f5 | miekg/dinit | unix.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage s3gof3r\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype deadlineConn struct {\n\tTimeout time.Duration\n\tnet.Conn\n}\n\nfunc (c *deadlineConn) Read(b []byte) (n int, err error) {\n\tif err = c.Conn.SetDeadline(time.Now().... | go | edit | 6 | 3 | mit | b52e9a021eac4d7b2cee62c3eacf794ec39239ae | eyethereal/s3gof3r,rlmcpherson/s3gof3r,cce/s3gof3r,reem/s3gof3r,hasnickl/s3gof3r,suzuken/s3gof3r,TuneDB/s3gof3r,mhoglan/s3gof3r,haszhixuan/s3gof3r,JamesClonk/s3gof3r,tempbottle/s3gof3r | http_client.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\"log\"\n\t\"net/http\"\n\n\t\"github.com/julienschmidt/httprouter\"\n)\n\nvar data map[string]string = map[string]string{}\n\nfunc Get(w http.ResponseWriter, r *http.Request, params httprouter.Params) {\n... | go | edit | 0 | 2 | mit | 4b630b2c25d000f3e11b4528b4512eb340f1209f | rlayte/toystore | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Add a test for NewHost."
},
{
"role": "assistant",
"content": "package hostsfile\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNewHost(t *testing.T) {\n\thost := NewHost(\"IP\", \"hostname\")\n\n\tid := createHostId(\"hostname\")\n\tstub... | go | new_file | 9 | 2 | mit | 80162e28da232f3daf957964d38ee5f2f8153097 | damonkelley/hostsup,damonkelley/hostsup | hostsfile/host_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"time\"\n)\n\ntype (\n\tInstanceTime int64\n\tInstanceDuration int64\n)\n\nconst (\n\tRealGameTick = time.Second / 20\n\tRealPeriodicalTick = time.Second / 2\n\tRealRegenerationTick = time.Second * 5\n... | go | edit | 3 | 1 | mit | d63b52c0bea7604e7bfa0d2756833397767a113b | etheriqa/crescent | time.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage runtime\n\nimport (\n\t\"io/ioutil\"\n\t\"syscall\"\n\n\t\"github.com/codahale/metrics\"\n)\n\nfunc getFDLimit() (uint64, error) {\n\tvar rlimit syscall.Rlimit\n\tif err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, ... | go | edit | 0 | 2 | mit | 7c37910bc765e705301b159683480bdd44555c91 | codahale/metrics | runtime/fds.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mocks\n\nimport (\n\t\"github.com/mendersoftware/deployments/integration\"\n\t\"github.com/stretchr/testify/mock\"\n)\n\n// APIClient is an autogenerated mock type for the APIClient type\ntype APIClient struct {\n\tmock.Mock\n}\n\n// Ge... | go | edit | 3 | 4 | apache-2.0 | cd9d03f6839cfb5583ebf3bad725372347a43537 | pasinskim/deployments,pasinskim/deployments,pasinskim/deployments,pasinskim/deployments | resources/deployments/generator/mocks/APICLient.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"strings\"\n\n\t\"github.com/sheenobu/go-xco\"\n)\n\nfunc main() {\n\topts := xco.Options{\n\t\tName: \"sms.example.com\",\n\t\tSharedSecret: \"secret shared with the XMPP server\",\n\t\tAddress: \"127.... | go | edit | 9 | 3 | unlicense | 26d1e6a761548f76d1f54a2337800e03397d6bd1 | mndrix/sms-over-xmpp | component.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\t\"./lexer\"\n\t\"./parser\"\n\t\"./print\"\n)\n\nfunc main() {\n\tdat, err := ioutil.ReadFile(\"sample.dtodo\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttodo(string(dat))\n}\n\nfunc ... | go | edit | 0 | 2 | mit | 8fd905cf2715ad2ee55b10e969daee168f7d8340 | alldne/deps-todo | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tsequenses = regexp.MustCompile(`(?:[^~\\\\]|\\\\.)*`)\n\tbranches = regexp.MustCompile(`(?:[^,\\\\]|\\\\.)*`)\n)\n\nfunc newMatcher(expr string) (m *regexp.Reg... | go | edit | 0 | 4 | mit | 500a68483fdd9a330ac58d8c8726d187e9e9b578 | kusabashira/msub | subvert.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logbuf\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nfunc (lb *LogBuffer) write(p []byte) (n int, err error) {\n\tlb.rwMutex.Lock()\n\tdefer lb.rwMutex.Unlock()\n\tval := make([]byte, len(p))\n\tcopy(val, p)\n\tlb.buffer.Value = val\n\tlb.buff... | go | edit | 9 | 2 | apache-2.0 | bbc500b68397b1c747afd4bdcf476010244cbbe9 | Symantec/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator | lib/logbuf/impl.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/ligato/vpp-agent/cmd/agentctl2/restapi\"\n\t\"github.com/spf13/cobra\"\n)\n\n// RootCmd represents the base command when called without any subcommands.\nvar cliConfig = &cobra.Comm... | go | edit | 6 | 2 | apache-2.0 | e1170c0a865127a33daf807c92e47c6e07cc10eb | ondrej-fabry/vpp-agent,ondrej-fabry/vpp-agent,VladoLavor/vpp-agent,VladoLavor/vpp-agent,VladoLavor/vpp-agent,ondrej-fabry/vpp-agent | cmd/agentctl2/cmd/cli_cmd.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage k\n\nimport (\n\t\"encoding/json\"\n\t\"math/rand\"\n)\n\n// StringArray is an alias for an array of strings\n// which has common operations defined as methods.\ntype StringArray []string\n\n// Contains returns true if the receiver arra... | go | edit | 0 | 3 | bsd-3-clause | 27baf41ee3e31b4a3a118d14197667b0df5d0419 | voxelbrain/k | strings.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 | 3 | apache-2.0 | a524c3fd67315266d6c8e14a6605e8dc98a00b1d | clekstro/fuse,jacobsa/fuse | debug.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !go1.5\n\npackage bom\n\nimport \"bufio\"\n\nfunc discardBytes(buf *bufio.Reader, n int) {\n\t// cannot use the buf.Discard method as it was introduced in Go 1.5\n\tif n <= 0 {\n\t\treturn\n\t}\n\tb := make([]byte, n)\n\tbuf.Read(b)\n... | go | edit | 0 | 3 | mit | f5b46e9919c680aa76aabfc810624dda97b9b2b3 | spkg/bom | discard_go14.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The Kubernetes Authors All rights reserved.\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 ... | go | edit | 6 | 3 | apache-2.0 | 90270b430b61b7d46aee0b6c9f2579d56c9baf70 | kubernetes-retired/cluster-registry,kubernetes-retired/cluster-registry | pkg/dnsprovider/providers/google/clouddns/zones.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package errors contains middlewares for converting HTTP response codes to GoLang errors.\npackage errors // import \"go.delic.rs/cliware-middlewares/errors\"\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"io/ioutil\"\n\n\tc \"go.delic.rs/cliw... | go | edit | 0 | 2 | mit | 77a5ec8b0991bafce8f0b3e1c001a69e938ed4a7 | delicb/cliware-middlewares | errors/errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc commandCleanupChecks(done chan bool, printOnly bool) {\n\tif !printOnly {\n\t\tdbOpen()\n\t}\n\n\tstmts := []string{\n\t\t`DELETE FROM check_instance_configurations;`,\n\t\t`DELETE FROM check_instance_conf... | go | edit | 6 | 4 | bsd-2-clause | 29a46de2a2c386cde54826874d5fc082bbd80f5b | 1and1/soma | command_cleanup.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage backend\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"restic/debug\"\n\t\"time\"\n)\n\n// Transport returns a new http.RoundTripper with default settings applied.\nfunc Transport() http.RoundTripper {\n\t// copied from net/http\n\ttr := &... | go | edit | 0 | 1 | bsd-2-clause | 04b262d8f10ba9eacde041734c08f806c4685e7f | restic/restic,fawick/restic,kurin/restic,kurin/restic,fawick/restic,ar-jan/restic,restic/restic,ar-jan/restic,middelink/restic,middelink/restic,jayme-github/restic,jayme-github/restic | src/restic/backend/http_transport.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage gitio shortens github urls using the git.io service.\n*/\npackage gitio\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// Shorten a long github url.\nfunc Shorten(longurl string) (string, error) {\n\tre... | go | edit | 0 | 4 | mit | 9427fbcd5b4753d55c2991b9be06ae5ec041442a | aarondl/gitio | gitio.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"os/signal\"\n\t\"sync\"\n\t\"syscall\"\n)\n\nvar listenerChan = make(chan net.Listener)\n\nvar activeConnections sync.WaitGroup\n\nfunc init() {\n\tgo watchForSIGTERM()\n}\n\nfunc wa... | go | edit | 6 | 6 | bsd-2-clause | b5b9899f87181ceca7d7b3cb6663c33bc22ed8b6 | vishnuvaradaraj/redwood,unixabg/redwood,andybalholm/redwood,unixabg/redwood,vishnuvaradaraj/redwood,yinheli/redwood-filter,yinheli/redwood-filter,andybalholm/redwood,yinheli/redwood-filter,vishnuvaradaraj/redwood | smart_shutdown.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage regressiontests\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\ntype Empty struct{}\n\nfunc TestStructcheck(t *testing.T) {\n\tt.Parallel()\n\tsource := `package test\n\ntype test struct {\n\tunused int\n}\n`\n\tpkgName := reflect.TypeO... | go | edit | 9 | 1 | mit | 681abb201b6cccdd740804f5a7926fd630c711bb | alecthomas/gometalinter,alecthomas/gometalinter,dnephin/gometalinter,alecthomas/gometalinter,dnephin/gometalinter,dnephin/gometalinter | regressiontests/structcheck_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage celery\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype Receipt interface {\n\tReply(string, interface{})\n\tAck()\n\tRequeue()\n\tReject()\n}\n\ntype Task struct {\n\tTask string\n\tId string\n\tArgs []interface{}\n\tKwargs map[string]int... | go | edit | 0 | 3 | bsd-3-clause | c392f6dac2ce7f6a429fdc41365a45e708c06d2d | mattrobenolt/go-celery | task.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage route\n\nimport (\n \"log\"\n \"sync/atomic\"\n)\n\n// HTML Wrapper struct so we can store the html string in an atomic.Value\ntype HTML struct {\n value string\n}\n\n// html stores the no route html string\nvar store atomic.Va... | go | edit | 0 | 2 | mit | 3e08824703812ee6ef1aa0c1c82e068ee68e2fbe | fabiolb/fabio,fabiolb/fabio | route/no_route.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logging\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/viper\"\n)\n\n// ConfigureLogging sets up open match logrus instance using the logging section of the matchmaker_config.json\n// - log line format (text[defaul... | go | edit | 0 | 11 | apache-2.0 | 58ff12f3f8fedb1227f38e0c21557ef2fb1fc7a4 | googleforgames/open-match | internal/logging/helper.go | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"github.com/spf13/cobra\"\n)\n\nvar outCmd = &cobra.Command{\n\tUse: \"out\",\n\tShort: \"Write a file based on key data.\",\n\tLong: `out is for writing a file based on a Consul key.`,\n\tRun: outRun,\n}\n... | go | edit | 3 | 3 | apache-2.0 | f8a2538dae30a30e4f992611ddbf4631bbd9d008 | DataDog/kvexpress,DataDog/kvexpress,DataDog/kvexpress | commands/out.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage atlas\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\tallTypes = []string{\n\t\t\"dns\",\n\t\t\"ntp\",\n\t\t\"ping\",\n\t\t\"sslcert\",\n\t\t\"traceroute\",\n\t\t\"wifi\",\n\t}\n)\n\nvar ErrInvalidMeasurementType = errors.New(\"invalid measure... | go | edit | 9 | 3 | mit | 5d1d8f7b1f24f01f84747fd50437fece3da9b528 | keltia/ripe-atlas | measurements.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage deploy\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/yuuki/droot/mounter\"\n\t\"github.com/yuuki/droot/osutil\"\n)\n\nvar RsyncDefaultOpts = []string{\"-av\", \"--delete\", \"--exclude=/proc/\", \"--exclude=/sys/\"}\n\nfunc Rs... | go | edit | 0 | 5 | mit | 6c5dbf1a30afa633531d574b3226e86fbba9fc96 | yuuki1/droot,yuuki/droot,yuuki1/droot,yuuki/droot | deploy/rsync.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"database/sql\"\n\t\"encoding/json\"\n\t\"fmt\"\n\tsq \"github.com/lann/squirrel\"\n)\n\nvar EffectRecordSelect sq.SelectBuilder = sq.\n\tSelect(\"heff.*\").\n\tFrom(\"history_effects heff\")\n\ntype EffectRecord stru... | go | edit | 0 | 2 | apache-2.0 | 7ad45c1a8d507d204c9af6217ad2088ba48df010 | lackac/horizon,masonforest/horizon,masonforest/horizon,masonforest/go-horizon,stellar/horizon,nullstyle/go-horizon,lackac/horizon,masonforest/go-horizon,masonforest/go-horizon,irisli/horizon,masonforest/horizon,stellar/horizon,lackac/horizon,nullstyle/go-horizon,irisli/horizon,stellar/horizon,irisli/horizon,nullstyle/g... | src/github.com/stellar/go-horizon/db/record_effect.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db2\n\nimport (\n\t\"github.com/Aptomi/aptomi/pkg/slinga/util\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"testing\"\n)\n\nfunc TestKey(t *testing.T) {\n\tcorrectKey := Key(\"72b062c1-7fcf-11e7-ab09-acde48001122$42\")\n\n\tassert.Eq... | go | edit | 12 | 1 | apache-2.0 | c031a75a5033c732635f0d66032a2bb0d7f709ed | Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi | pkg/slinga/db2/base_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// mad - mock ad server\n// (C) copyright 2015 - J.W. Janssen\npackage main\n\nimport (\n\t\"net\"\n\t\"fmt\"\n\n\t\"github.com/coreos/go-systemd/activation\"\n\t\"github.com/coreos/go-systemd/journal\"\n)\n\ntype JournaldLogger struct {\n}\n... | go | edit | 3 | 3 | apache-2.0 | 829082aa06ebd5a84f183b0205fd4b7cf1c6c3f7 | jawi/mad | srv_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ec2\n\nimport (\n\t\"errors\"\n\n\tgoaws \"github.com/aws/aws-sdk-go/aws\"\n\tawsec2 \"github.com/aws/aws-sdk-go/service/ec2\"\n)\n\ntype AvailabilityZoneRetriever struct {\n\tec2ClientProvider ec2ClientProvider\n}\n\nfunc NewAvailabili... | go | edit | 6 | 5 | apache-2.0 | 86bb90498ca29ed3c67e66585cd3cedc80ed0262 | niroyb/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | aws/ec2/availability_zone_retriever.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\npackage network\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/docker/libcontainer/system\"\n)\n\n// crosbymichael: could make a network strategy that instead of returning veth pair names it returns a pid ... | go | edit | 6 | 4 | apache-2.0 | 52f4743aba95c0939ccc134534e4a968b05610f9 | dqminh/libcontainer,keloyang/runc,fabiokung/runc,avagin/libcontainer,dieface/runc,shakamunyi/libcontainer,estesp/libcontainer,ddnbgroup/runc,estesp/libcontainer,thaJeztah/libcontainer,YujiOshima/runc,xiaochenshen/runc,calavera/runc,SaiedKazemi/libcontainer-criu,stefanberger/runc,mrunalp/runc,cxxly/runc,meihuabo/runc,w4... | network/netns.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (C) 2016 AppNeta, Inc. All rights reserved.\n\npackage tv_test\n\nimport (\n\t\"time\"\n\n\t\"github.com/appneta/go-appneta/v1/tv\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc slowFunc(ctx context.Context) {\n\tdefer tv.BeginProfile... | go | edit | 0 | 3 | apache-2.0 | 33e90105f4391f9546d300a182bd155adf1bb00a | appneta/go-appneta,appneta/go-appneta | v1/tv/profile_example_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage reception\n\nimport (\n\t\"testing\"\n\n\t\"github.com/aphistic/sweet\"\n\t\"github.com/aphistic/sweet-junit\"\n\t. \"github.com/onsi/gomega\"\n)\n\nfunc TestMain(m *testing.M) {\n\tRegisterFailHandler(sweet.GomegaFail)\n\n\tsweet.Run(m... | go | edit | 12 | 1 | mit | a1dda6f30fd68ef79c2307187b16e1ec6133bbaa | efritz/reception | main_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage apns2\n\nimport \"time\"\n\nconst (\n\tPriorityLow = 5\n\tPriorityHigh = 10\n)\n\ntype Notification struct {\n\tApnsID string\n\tDeviceToken string\n\tTopic string\n\tExpiration time.Time\n\tPriority int\n\tPayload [... | go | edit | 0 | 0 | mit | cd654378f3a8d1960872bc6a05a32111c65703c5 | sideshow/apns2 | notification.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.