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 rev\n\nimport (\n\t\"path\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestContentTypeByFilename(t *testing.T) {\n\ttestCases := map[string]string{\n\t\t\"xyz.jpg\": \"image/jpeg\",\n\t\t\"helloworld.c\": \"text/x-c; charset=... | go | edit | 15 | 3 | mit | 93a30e648f2001840c5768a840704f2859f85a80 | zacklin923/revel,cavaliercoder/revel,marklap/revel,James0tang/revel,kaneshin/revel-revel,notzippy/revel,cw2018/revel,cw2018/revel,tempbottle/revel,Gazillion-Platform-Team/revel,robfig/revel,veliamsli/revel,jenalgit/revel,yext/revel,cavaliercoder/revel,zog/revel,Gazillion-Platform-Team/revel,veliamsli/revel,trigrass2/re... | util_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package main provide one-line integration with letsencrypt.org\npackage main\n\nimport (\n\t\"github.com/kataras/iris\"\n\t\"github.com/kataras/iris/context\"\n)\n\nfunc main() {\n\tapp := iris.New()\n\n\tapp.Get(\"/\", func(ctx context.Cont... | go | edit | 0 | 1 | bsd-3-clause | 9232b96188407fda25c061d05fb0eadd1848676c | kataras/gapi,kataras/iris,kataras/iris,kataras/iris,kataras/gapi,kataras/iris | _examples/http-listening/listen-letsencrypt/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Command test_serviced is an implementation of the test_service service.\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"veyron.io/veyron/veyron/lib/signals\"\n\t_ \"veyron.io/veyron/veyron/profiles\"\n\t\"veyron.io/veyron/veyron2/rt\"... | go | edit | 3 | 2 | bsd-3-clause | b63f2273d15509238a4665db0acb1f2c76f8b24f | vanadium/js,vanadium/js,vanadium/js,vanadium/js | go/src/test_service/test_serviced/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"fmt\"\n\t\"github.com/Frostman/aptomi/pkg/slinga\"\n\t\"net/http\"\n)\n\nfunc endpointsHandler(w http.ResponseWriter, r *http.Request) {\n\t// Load the previous usage state\n\tstate := slinga.LoadServiceUsageStat... | go | edit | 15 | 1 | apache-2.0 | f22f47badaffa9d94aa74c82f653562f4565b9a2 | Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi | pkg/slinga/server/server.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage proof\n\nimport (\n\t\"bytes\"\n\t\"ioutil\"\n\t\"testing\"\n)\n\nfunc TestCRC(t *testing.T) {\n\tdata := []byte(\"Hello, World!\")\n\tcases := []struct {\n\t\tcsum uint32\n\t\terr error\n\t}{\n\t\t{0xec4ac3d0, nil},\n\t\t{0xdeadbeef, ... | go | edit | 6 | 3 | bsd-2-clause | 94455aa016c880b914cf6d9a61902014d6c175c6 | arsatiki/proof | reader_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main // import \"eriol.xyz/piken\"\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc download(url, output string) error {\n\n\tr, err := http.Get(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer r.Body.Close()\n\n\tout, er... | go | edit | 0 | 4 | bsd-3-clause | 89b6cc633cfe5c7d05d246e3a298e8b718e8777a | eriol/piken | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ir\n\nimport (\n\t\"testing\"\n\n\t\"github.com/tisp-lang/tisp/src/lib/core\"\n)\n\nfunc TestNewSwitch(t *testing.T) {\n\tNewSwitch(0, []Case{NewCase(core.Nil, 1)})\n}\n\nfunc TestNewSwitchNoPattern(t *testing.T) {\n\tdefer func() {\n\t... | go | edit | 18 | 2 | mit | 8c4d260e7f5ec71bb2ccf787dedc49b30b700261 | raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp | src/lib/ir/switch_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestLogLevelString(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tlvl LogLevel\n\t\texpected string\n\t}{\n\t\t{Debug, \"Debug\"},\n\t\t{Thumb, \"Thumb\"},\n\t\... | go | edit | 36 | 4 | mit | c441b37e8b1f2fbffda6c88f5af3086a7d6b4c26 | Thomasdezeeuw/logger | level_test.go | rejected_lint | Too many lint violations: 36 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage action\n\nimport (\n\t\"flag\"\n)\n\ntype catalogServices struct {\n\t*config\n}\n\nfunc CatalogServicesAction() Action {\n\treturn &catalogServices{\n\t\tconfig: &gConfig,\n\t}\n}\n\nfunc (c *catalogServices) CommandFlags() *flag.FlagS... | go | edit | 30 | 3 | apache-2.0 | 46688a6f88fdf54ed64b0669386cda3024c080c7 | CiscoCloud/consul-cli,mantl/consul-cli,mantl/consul-cli | action/catalog_services.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/hasit/gohr\"\n\nfunc main() {\n\tgohr.DrawHr(\"-0-\")\n\tgohr.DrawHr(\"-\", \"#\")\n\tgohr.DrawHr(\".\", \"\\\\\", \"/\")\n}\n\n```\n\nApply this change: Complete tool to match LuRsT/hr"
},
{
"role": ... | go | edit | 0 | 1 | mit | 7df4b2578b1da6aa0d833a7930211c43ae1c972d | hasit/gohr | cmd/hr/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\nimport \"github.com/tisp-lang/tisp/src/lib/systemt\"\n\ntype functionType struct {\n\tsignature Signature\n\tfunction func(...*Thunk) Value\n}\n\nfunc (f functionType) call(args Arguments) Value {\n\tts, err := f.signature.Bind... | go | edit | 27 | 2 | mit | bb62f72e4363f9a364b0c83488d71bfa2be59b19 | tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp | src/lib/core/function.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage terminal\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"strconv\"\n\n\t\"github.com/mattn/go-runewidth\"\n)\n\ntype Terminal struct {\n\tw io.Writer\n\tbuf *bytes.Buffer\n\tmsg string\n}\n\nfunc New(w io.Writer) *Terminal {\n\treturn &Termin... | go | edit | 6 | 2 | mit | b5067c6d5701fe5081f4c5258cfd3926446e039f | elpinal/coco3 | screen/terminal/terminal.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package launcher configures Lantern to run on system start\npackage launcher\n\nimport (\n\t\"github.com/kardianos/osext\"\n\t\"github.com/luisiturrios/gowin\"\n\n\t\"github.com/getlantern/golog\"\n)\n\nconst (\n\trunDir = `Software\\Microso... | go | edit | 0 | 4 | apache-2.0 | 14496a7fed1e9ef222ec25a39574eb03e05e6c55 | pialin/lantern,dodopeng/lantern,imcoddy/lantern,ykelvis/lantern,nuan-nuan/lantern,MinFu/lantern,Batterfii/lantern,TNTest/lantern,kmingee/lantern,ubuntuvim/lantern,hhua/lantern,nikedog/lantern,abhishekgahlot/lantern,fsxchen/lantern,blindlf/lantern,lfckop/lantern,wangdongming007/lantern,Denniskevin/lantern,ywzw2013/lante... | src/github.com/getlantern/launcher/launcher_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commons\n\nimport (\n\t\"math/rand\"\n\t\"strconv\"\n\t\"time\"\n)\n\nfunc init() {\n\trand.Seed(time.Now().UnixNano())\n}\n\nfunc GetUID() string {\n\ts := 6\n\treturn randomString(s)\n}\n\nfunc randomString(l int) string {\n\tr := str... | go | edit | 0 | 2 | mit | 43717a41825746fcab9e5d6861ee1244b25718b5 | Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL,Zenika/MARCEL | backend/commons/commons.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"github.com/docker/docker/api/types\"\n\t\"github.com/docker/docker/client\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc init() {\n\tRootCmd.AddCommand(searchCommand)\n}\n\nvar searchCommand = ... | go | edit | 3 | 1 | apache-2.0 | 12a3b3fe68cb7ecd7a4ed2d35a25a4ee65f57f1d | 3846masa/whalebrew,3846masa/whalebrew | cmd/search.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"time\"\n)\n\ntype Bus struct {\n\tqueue chan *Message\n}\n\ntype Subscriber interface {\n\tonMessage(message *Message) error\n}\n\nvar MessageBus = &Bus{\n\tqueue: make(chan *Message),\n}\n\nfunc (b Bus) Publish(me... | go | edit | 9 | 2 | mit | 229c2e18633d06d14ad9e9cbb012b75ca69317b2 | ackintosh/takosan,kentaro/takosan,dojineko/takosan | message_bus.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\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n)\n\nfunc sigChld() {\n\tvar sigs = make(chan os.Signal, 1)\n\tsignal.Notify(sigs, syscall.SIGCHLD)\n\n\tfor {\n\t\tselect {\n\t\tcase <-sigs:\n\t\t\tgo reap()\n\t\tdefault:\n\... | go | edit | 3 | 3 | bsd-3-clause | 6a1221968544358a98b106045d83e915abd34575 | miekg/dinit | sigchld.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage user_parser\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\nfunc ParseUsername() ([]string, error) {\n\targs := os.Args\n\n\tif len(args) < 1 {\n\t\tlog.Fatal(\"Please supply at least one GitHub username\")\n\t}\n\n\t// username := args[0]\n\t//... | go | edit | 0 | 2 | mit | 0f81fc87f193ce12bf44bdbef149514ced6ad36e | seanknox/git-pair,seanknox/git-pair | user_parser/user_parser.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 The OpenPitrix Authors. All rights reserved.\n// Use of this source code is governed by a Apache license\n// that can be found in the LICENSE file.\n\npackage manager\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"google.golang.... | go | edit | 0 | 3 | apache-2.0 | 12fb313a21a42b5658b855dcada19f02ba1e5830 | openpitrix/openpitrix,openpitrix/openpitrix,openpitrix/openpitrix | pkg/manager/grpc_client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/marcusolsson/tui-go\"\n)\n\nfunc main() {\n\tvar currentView int\n\n\tviews := []tui.Widget{\n\t\ttui.NewVBox(tui.NewLabel(\"Press right arrow to continue ...\")),\n\t\ttui.NewVBox(tui.NewLabel(\"Almost ... | go | edit | 0 | 3 | mit | 93900216d8e5f73e0ffe16cbbc44ec4e1f3dca3a | marcusolsson/tui-go | example/multiview/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage queue\n\nimport (\n\t\"time\"\n\n\t\"golang.org/x/time/rate\"\n)\n\ntype Storager interface {\n\tExists(key string) bool\n}\n\ntype Limiter interface {\n\tAllowRate(name string, limit rate.Limit) (delay time.Duration, allow bool)\n}\n\n... | go | edit | 9 | 0 | bsd-2-clause | 09a6ffcca93aae97689c401de2fab6289a2c82ba | go-msgqueue/msgqueue | queue.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage worker\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/sqs\"\n)\n\n// NewSQSClient returns a SQS Client and a Queue URL for you you to con... | go | edit | 0 | 3 | mit | 73b613edfc38d760bd8891f6b77dcfe6892d2f8c | h2ik/go-sqs-poller | worker/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage web\n\nimport (\n\t\"github.com/control-center/serviced/dao\"\n\trest \"github.com/zenoss/go-json-rest\"\n)\n\ntype EmergencyShutdownRequest struct {\n\tOperation int // 0 is emergency shutdown, 1 is clear emergency shutdown status\n\tT... | go | edit | 12 | 2 | apache-2.0 | 4e23fb8503bb991abeaae25cf4849f7b08638cab | control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced | web/emergencyshutdown.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 The goyy Authors. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nvar tmplDataUser = `\ninsert into {{case \"SYS_USER (ID, NAME... | go | edit | 3 | 0 | mit | 73eead127a02f4073b35c21c2454caf15ef43824 | goyy/goyy,goyy/goyy,goyy/goyy,goyy/goyy | tool/xtab/tmpl_data_user.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nconst none = 0 // same const identifie... | go | edit | 6 | 0 | bsd-3-clause | ed1eb770f0ec882af805b452c904f29db6050110 | npe9/noahevans-go9,webfd/go-zh,npe9/noahevans-go9,npe9/noahevans-go9,scirelli/scirelli-go,webfd/go-zh,rdp/rogerpack2005-golang,Triskite/willstone-goclone,bryanxu/go-zh,bryanxu/go-zh,d0f/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,webfd/go-zh,d0f/go-zh,scirelli/s... | test/bugs/bug126.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage network\n\nimport (\n\t\"net\"\n\t\"testing\"\n)\n\nfunc TestDeviceCreate(t *testing.T) {\n\tiface := \"tun0\"\n\t_, err := CreateTunInterface(iface)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestCreateDeviceWithIpAddr(t *tes... | go | edit | 6 | 5 | apache-2.0 | 7d83e25ab4ca4428438f39a50a6474bdf81a7901 | meshbird/meshbird | network/interface_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage v1alpha1\n\nimport \"time\"\n\nconst (\n\tRoleMaster = \"master\"\n\tRoleNode = \"node\"\n\tRoleKeyPrefix = \"node-role.kubernetes.io/\"\n\tRoleMasterKey = RoleKeyPrefix + RoleMaster\n\tRoleNodeKey = RoleKeyPrefix + RoleNode\n... | go | edit | 0 | 0 | apache-2.0 | bebebb1e317e272e982e6b9a892e4eafdcfdabed | appscode/pharmer,appscode/pharmer,appscode/pharmer,appscode/pharmer | apis/v1alpha1/constants.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage prgs\n\n// Prg is a Program, with all its data (no behavior)\ntype prg struct {\n\tname string\n}\n\n// Prg defines what kind of service a program has to provide\ntype Prg interface {\n\t// Name is the name of a program to install, acts... | go | edit | 0 | 3 | mit | 71be56d5afecfb3a4d837203a5b429dd5dd18337 | VonC/senvgo,VonC/senvgo | prgs/prgs.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 | a781391752ed7339e8ae7d298aafe1b4ee6be5b9 | hajimehoshi/ebiten,hajimehoshi/ebiten | cursormode.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport \"go.skia.org/infra/go/buildskia\"\n\nconst (\n\t// BUILD_TYPE is the type of build we use throughout fiddle.\n\tBUILD_TYPE = buildskia.RELEASE_BUILD\n)\n\nvar (\n\t// GN_FLAGS are the flags to pass to GN.\n\tGN_FLAGS =... | go | edit | 0 | 0 | bsd-3-clause | 7b1a0575a66f7112cfd67b3df0a0020a5d98573b | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | fiddle/go/config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bot\n\n// Handle SIGINT and SIGTERM with a graceful shutdown\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc init() {\n\tsigs := make(chan os.Signal, 1)\n\n\t// `signal.Notify` registers the given... | go | edit | 21 | 1 | mit | f49c8b100116e7051165cc9e5324a87cb571824d | parsley42/gopherbot,uva-its/gopherbot,uva-its/gopherbot,uva-its/gopherbot,parsley42/gopherbot,uva-its/gopherbot,parsley42/gopherbot,parsley42/gopherbot | bot/waitquit.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage errors_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/vardius/go-api-boilerplate/pkg/errors\"\n)\n\nfunc ExampleNew() {\n\terr := errors.New(\"example\")\n\n\tfmt.Printf(\"%s\\n\", err)\n}\n\nfunc ExampleWrap() {\n\tsubErr := errors.New(... | go | edit | 0 | 1 | mit | e42125b3b8f6b51d24f1a5cacf3f44f76f75ea56 | vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate | pkg/errors/example_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// goslow is a slow HTTP server that responds with errors.\n// Visit https://github.com/alexandershov/goslow for more details.\npackage main\n\nimport (\n\t\"log\"\n\t\"runtime\"\n)\n\n// main starts a slow HTTP server that responds with errors... | go | edit | 6 | 2 | mit | d1d27cccd1df27afc49874cc9408e301dc94f971 | alexandershov/goslow,alexandershov/goslow | goslow.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\"encoding/json\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/go-martini/martini\"\n)\n\n// CreateIssueType ...\ntype CreateIssueType struct {\n\tTitle string `json:\"title\"`\n\tBody string `json:\"bod... | go | edit | 9 | 2 | mit | 3314043096c6a1d72f4484e8a98e6d0f039b3562 | supu-io/api | create_issue.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/* For license and copyright information please see LEGAL file in repository */\n\npackage srpc\n\nimport \"../syllab\"\n\n/*\n\t********************PAY ATTENTION:*******************\n\tWe don't suggest use these 2 func instead use chaparkhane ... | go | edit | 9 | 2 | apache-2.0 | e1703c078b1f27f02645a8dc0282abb6087013b3 | SabzCity/Go-Library | srpc/marshal-unmarshal.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage numbers\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"testing\"\n)\n\n// TestFactorsList unit test FactorsList function.\nfunc TestFactorsList(t *testing.T) {\n\ttestCases := []struct {\n\t\tinput int\n\t\texpected []int\n\t\terr ... | go | edit | 6 | 5 | mit | 4bdbbf96cfc2ebdd95785d714e614af409df6bed | alesr/numbers | numbers_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fbmessenger_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"github.com/onsi/ginkgo/reporters\"\n\t\"testing\"\n\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc TestWebhooks(t *testing.T) {\n\tRegisterFa... | go | edit | 6 | 1 | mit | d76b903aa47b1256f210390b0911a17af06aebb6 | ekyoung/fbmessenger | fbmessenger_suite_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport \"encoding/json\"\n\ntype DesireAppRequestFromCC struct {\n\tAppId string `json:\"app_id\"`\n\tAppVersion string `json:\"app_version\"`\n\tDropletUri string ... | go | edit | 3 | 1 | apache-2.0 | 659b15e37a9111074e9b0ec008b989912ec4dafe | cloudfoundry-incubator/runtime-schema | models/desire_app_messages.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/bmorton/deployster/fleet\"\n)\n\ntype UnitsResource struct {\n\tFleet fleet.Client\n}\n\ntype UnitsResponse struct {\n\tUnits []VersionedUnit `json:\"units\"... | go | edit | 0 | 2 | mit | 5ed6c7d15b285dc3006b9db8bb62fb8fb73ac33c | bmorton/deployster | server/units_resource.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype config struct {\n\tcontrollerKey string\n\tourPort string\n\tlogOut io.Writer\n}\n\nfunc loadConfigFromEnv() (*config, error) {\n\tc := &config{}\n\tc.controllerKey... | go | edit | 0 | 6 | bsd-3-clause | 376e150ab4de7365232b447e3333080047a3d17c | tonicbupt/flynn,flynn/flynn,kgrz/flynn,GrimDerp/flynn,kgrz/flynn,felixrieseberg/flynn,josephglanville/flynn,ozum/flynn,lmars/flynn,jzila/flynn,jzila/flynn,shads196770/flynn,benbjohnson/flynn,josephglanville/flynn,whouses/flynn,ozum/flynn,arekkas/flynn,clifff/flynn,TribeMedia/flynn,TribeMedia/flynn,supermario/flynn,Trib... | controller/examples/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hpack\n\n// TODO: headers of arbitrary length with integer encoding algorithm\n// TODO: hpack test cases https://github.com/http2jp/hpack-test-case\n\nfunc Decode(headers string, table *HeaderTable) ([]HeaderField, int) {\n\tvar decoded... | go | edit | 6 | 1 | mit | 5be1bb8184a70273850a1321e16459da29db69f9 | tildedave/go-hpack-impl,tildedave/go-http2-impl | hpack/header.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2010 AFP Authors\n// This source code is released under the terms of the\n// MIT license. Please see the file LICENSE for license details.\n\n//This is not a legal Go program, rather it provides a skeletal\n//filter to serve as... | go | edit | null | null | mit | 1de96bcca4b036775e0bad3f71a79379bd0b2751 | jesusaurus/afp,jesusaurus/afp,jesusaurus/afp,jesusaurus/afp | filters/FilterSkeleton.go | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Marcel Gotsch. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage goserv\n\nimport (\n\t\"net/http\"\n)\n\ntype TLS struct {\n\tCertFile, K... | go | edit | 12 | 2 | bsd-3-clause | 4c03fe8513893c27815430a9ff4ef1c3abad8236 | gotschmarcel/goserv | server.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n \"regexp\"\n \"strings\"\n \"unicode\"\n \"unicode/utf8\"\n)\n\nconst (\n RE_NOT_SEPARATORS = `[^[\\s\\.,:\\*\\+;\\?\\\\\\-\\(\\)\\[\\]{}<>'\"#«»№\\/!]+`\n)\n\nvar (\n re = regexp.MustCompile(RE_NOT... | go | edit | 0 | 2 | apache-2.0 | 8368e64133213c5406b4d3a82a16f777096b6723 | alxeg/flibooks | utils/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage orm\n\nimport (\n\t\"github.com/go-pg/pg/v10/types\"\n)\n\ntype mapModel struct {\n\thookStubs\n\tptr *map[string]interface{}\n\tm map[string]interface{}\n}\n\nvar _ Model = (*mapModel)(nil)\n\nfunc newMapModel(ptr *map[string]interfa... | go | edit | 12 | 3 | bsd-2-clause | e289089052968b838b895e0d9f1df984772970b5 | go-pg/pg,vmihailenco/pg,go-pg/pg | orm/model_map.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/jason0x43/go-plist\"\n)\n\nfunc main() {\n\tif len(os.Args) != 2 {\n\t\tprintln(\"usage:\", os.Args[0], \"PLIST\")\n\t\tos.Exit(1)\n\t}\n\n\tpl, err := plist.UnmarshalFile(os.Args[1])\n\tif e... | go | edit | 3 | 5 | mit | 40b452e637b863e5b056d405407bd4e429ff9ad8 | jason0x43/go-plist | plist/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage run\n\nimport (\n\t\"gopkg.in/workanator/go-floc.v2\"\n)\n\nconst locRepeat = \"Repeat\"\n\n/*\nRepeat repeats running jobs for N times. Jobs start sequentially.\n\nSummary:\n\t- Run jobs in goroutines : NO\n\t- Wait all jobs finish :... | go | edit | 0 | 4 | mit | e0f69f17369f6abf54fca972da3271eb6dcf687e | workanator/go-floc | run/repeat.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"os\"\n \"fmt\"\n)\n\nfunc main() {\n oauth_key := os.Getenv(\"BITBUCKET_ENFORCER_KEY\")\n oauth_pass := os.Getenv(\"BITBUCKET_ENFORCER_PASS\")\n\n fmt.Println(\"key:\", oauth_key)\n fmt.Println(\"pass:\", oaut... | go | edit | 3 | 3 | mit | 51870c87146b68ef2184494b0617118468871481 | jumoel/bitbucket-enforcer | enforcer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/polds/logrus/hooks/papertrail\"\n)\n\nvar __l *logrus.Logger\n\n// Logger returns an instance of\n// a logger or creates a new one.\nfunc Lo... | go | edit | 3 | 2 | mit | fe1acb3930164d1002bfd84cfe4682d6b24a38f6 | kyani-inc/logger | logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The Kubernetes 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.... | go | edit | 0 | 0 | apache-2.0 | d6c661c61f14aef2bd6a39ed5eb7bd81ee3c59c4 | mmerrill3/autoscaler,kgrygiel/autoscaler,kubernetes/autoscaler,bskiba/autoscaler,bskiba/autoscaler,aleksandra-malinowska/autoscaler,kubernetes/autoscaler,KarolKraskiewicz/autoscaler,mmerrill3/autoscaler,KarolKraskiewicz/autoscaler,kubernetes/autoscaler,kgrygiel/autoscaler,KarolKraskiewicz/autoscaler,kgrygiel/autoscaler... | cluster-autoscaler/version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNormalizeName(t *testing.T) {\n\tpackages := map[string]string{\n\t\t\"github.com/Masterminds/cookoo/web/io/foo\": \"github.com/Masterminds/cookoo\",\n\t\t`github.com\\Masterminds\\cookoo\\... | go | edit | 3 | 4 | mit | 9334c8db212d2f96fe2783d870b9bc8929cac575 | avvmoto/glide,franciscocpg/glide,cmars/tools,cmars/tools,franciscocpg/glide,avvmoto/glide,cmars/tools,cmars/tools | util/normalizename_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Cockroach 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... | go | edit | 0 | 2 | apache-2.0 | 01f5f2a41fb22de3b0c4329754682af46d303ffc | bdarnell/cockroach-prod | drivers/amazon/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n\njwthelper is a Golang package that provides JWT(JSON Web Token) functions based on jwt-go.\n\n*/\npackage jwthelper\n\n```\n\nApply this change: Insert 'Package' before package description to remove golint warnings."
},
{
"role": ... | go | edit | 0 | 0 | mit | e68fc68fc4427e636879e569dc8946675982f04a | northbright/jwthelper | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Println(\"Ding!\")\n}\n\n```\n\nApply this change: Use os/exec and paplay to play sound"
},
{
"role": "assistant",
"content": "package main\n\nimport \"fmt\"\nimport \"os/exec... | go | edit | 3 | 1 | mit | 452d9957ab4f61b1387a9a28b91e87acaab8bb5d | Cosiek/ding | src/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tccli \"github.com/codegangsta/cli\"\n\t\"github.com/myodc/go-micro/cmd\"\n\t\"github.com/myodc/micro/api\"\n\t\"github.com/myodc/micro/car\"\n\t\"github.com/myodc/micro/cli\"\n)\n\nfunc main() {\n\tapp := ccli.NewApp... | go | edit | 0 | 1 | apache-2.0 | 268c74b4327c9ca77c73ce60f2bbec01a0bef5ef | micro/micro,myodc/micro,micro/micro,jmptrader/micro,micro/micro | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/alex1sz/shotcharter-go/db\"\n\t_ \"github.com/lib/pq\"\n)\n\nfunc main() {\n\t// fmt.Printf(\"Hello, world.\\n\")\n\tdb.Init()\n}\n\n```\n\nApply this change: Move lib/pq into db package"
},
{
"r... | go | edit | 0 | 1 | mit | e5e8c1000c19345975a5c2b896e9fd44d6b03b0f | Alex1sz/shotcharter-go-api | main.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\n\t\"github.com/open-falcon/falcon-plus/cmd\"\n\t\"github.com/spf13/cobra\"\n\tflag \"github.com/spf13/pflag\"\n)\n\nvar versionFlag bool\n\nvar RootCmd = &cobra.Command{\n\tUse: \"open-falcon\",\... | go | edit | 3 | 2 | apache-2.0 | 3a4500fa63451b8c7d647d2de6ebeb77b63eda00 | jojohappy/falcon-plus,taomaree/falcon-plus,open-falcon/falcon-plus,jojohappy/falcon-plus,open-falcon/falcon-plus,open-falcon/falcon-plus,jojohappy/falcon-plus,open-falcon/falcon-plus,taomaree/falcon-plus,jojohappy/falcon-plus,jojohappy/falcon-plus,taomaree/falcon-plus,taomaree/falcon-plus,open-falcon/falcon-plus,jojoha... | main.go | rejected_duplicate | Near-duplicate of sample 117116 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clair\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc IsHealthy() bool {\n\tConfig()\n\thealthUri := strings.Replace(uri, \"6060\", strconv.Itoa(healthPort), 1)\n\tresponse, err := http.Get(heal... | go | edit | 6 | 3 | mit | 42271b7c7bb2d83627f0e09990f670ac32b8d311 | murat1985/hyperclair,wemanity-belgium/hyperclair,wemanity-belgium/hyperclair,murat1985/hyperclair | clair/health.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dbio\n\nimport (\n\t\"fmt\"\n)\n\ntype DataBlock struct {\n\tID uint16\n\tData []byte\n}\n\nfunc (db *DataBlock) ReadUint16(startingAt int) uint16 {\n\treturn DatablockByteOrder.Uint16(db.Data[startingAt : startingAt+2])\n}\n\nfunc (d... | go | edit | 9 | 6 | mit | a550ddca9302f2009037648cfaec5e04be2b55c4 | fgrehm/pucrs-metadata-db,fgrehm/pucrs-simple-json-db | src/simplejsondb/dbio/data_block.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nword-server creates an HTTP server which exports endpoints for querying a word2vec model.\n*/\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/sajari/word2vec\"\n)\n\nvar listen, modelP... | go | edit | 0 | 4 | mit | 356ee8aa443df281beb8889eb7b97f05c87ebc8b | sajari/word2vec | cmd/word-server/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage grid\n\ntype Square bool\n\ntype Clue []int\n\nconst (\n\tWhite Square = iota\n\tBlack\n)\n\ntype Grid struct {\n\trowClues, columnClues []Clue\n\tsquares []Square\n}\n\n```\n\nApply this change: Change Squares from ints t... | go | edit | 0 | 0 | mit | 5209babfa1cec876c5798c6a4d6b396d7a4c4615 | ccouzens/gridsolver | grid.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage memalpha\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestHandleServerError(t *testing.T) {\n\terrorMessage := \"test fake\"\n\tresponse := bytes.NewReader([]byte(\"SERVER_ERROR \" + errorMessage))\n\tr... | go | edit | 12 | 3 | mit | 4912d9036a1b970b5bc6ceb0298e4b7307004b27 | ttakezawa/memalpha,ttakezawa/memalpha | mem_textproto_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage selector\n\nimport (\n\t\"math/rand\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/micro/go-micro/registry\"\n)\n\nfunc init() {\n\trand.Seed(time.Now().UnixNano())\n}\n\n// Random is a random strategy algorithm for node selection\nfunc Ra... | go | edit | 12 | 2 | apache-2.0 | b3cdbaae1a084863577c839dc9fc862cbe445d07 | Taik/go-micro,divisionone/go-micro,myodc/go-micro,uffy/go-micro,micro/go-micro | selector/strategy.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add copyright notice to see if renders on GoDoc.org"
},
{
"role": "assistant",
"content": "// Copyright 2015 Ben Tranter. All rights reserved.\n// Use of this source code is governed by the Apache 2.0\n// license that can be found in... | go | new_file | 0 | 0 | apache-2.0 | f7482ff73bee2fa60920b56db88e1aa086087964 | bentranter/id | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage projects\n\nimport (\n\t\"github.com/DVI-GI-2017/Jira__backend/models\"\n\t\"gopkg.in/mgo.v2\"\n\t\"gopkg.in/mgo.v2/bson\"\n)\n\nconst collection = \"labels\"\n\nfunc CheckExistence(mongo *mgo.Database, label *models.Label) (bool, error... | go | edit | 9 | 1 | mit | 017f7bd8562b3019304a0980cc947a3788b5859f | DVI-GI-2017/Jira__backend | services/labels/service.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\"os\"\n\n\t\"github.com/urfave/cli\"\n)\n\nfunc runApp() {\n\tapp := cli.NewApp()\n\n\tapp.Name = \"alpinepass\"\n\tapp.Version = \"0.0.0\"\n\tapp.Author = \"appPlant GmbH\"\n\tapp.Usage = \"Manage system environmen... | go | edit | 0 | 2 | apache-2.0 | 0568253b9a0df9dd3075c2c8ad826ddfebc1bfe6 | appPlant/alpinepass,appPlant/alpinepass | application.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 | 3 | mit | a7c971795e8c7c45015c436381a6c67ee53e9f78 | andrewstuart/limio | basic_limiter.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"flag\"\n\n\t\"github.com/vharitonsky/iniflags\"\n)\n\nvar (\n\tName = flag.String(\"name\", \"tad\", \"Nick to use in IRC\")\n\tServer = flag.String(\"server\", \"127.0.0.1:6668\", \"Host:Port to connect to... | go | edit | 0 | 1 | unlicense | d0046e18c7a22762460465eeb57f163dfc1d6297 | smotti/cfengine-tad | config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport \"io\"\n\n// A BlackHole is an io.ReadWriter that accepts an infinite\n// amount of input and produces no output.\ntype BlackHole struct{}\n\nfunc (BlackHole) Read(p []byte) (int, error) { return 0, io.EOF }\nfunc (Black... | go | edit | 0 | 1 | mit | 80d7192bb18c64645925b8844738a041051ba5c6 | droyo/styx | internal/util/blackhole.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"gopkg.in/urfave/cli.v1\"\n\t\"os\"\n)\n\nconst version = \"0.2.0\"\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"ustat\"\n\tapp.Version = version\n\tapp.Usage = \"Unified system statistics collector\"\n\t... | go | edit | 15 | 2 | mit | 22c48f61fb3b859f51afb0351094ea8537f186f9 | penberg/ustat | cmd/ustat/main.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage storage\n\nimport (\n\t\"time\"\n\n\t\"github.com/docker/distribution\"\n\t\"github.com/docker/distribution/digest\"\n)\n\n// layerReadSeeker implements Layer and provides facilities for reading and\n// seeking.\ntype layerReader struct... | go | edit | 12 | 1 | apache-2.0 | 4e3bf4bad4df87f447678dd675b5f44de0ff8c58 | thaJeztah/distribution,thaJeztah/distribution | docs/storage/layerreader.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clusterupstreamrefresher\n\nimport (\n\t\"context\"\n\n\tgkecontroller \"github.com/rancher/gke-operator/controller\"\n\tgkev1 \"github.com/rancher/gke-operator/pkg/apis/gke.cattle.io/v1\"\n\tmgmtv3 \"github.com/rancher/rancher/pkg/gene... | go | edit | 0 | 3 | apache-2.0 | c25a755feab0436630bdff3d7877d03e2a489b3d | rancherio/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancher/rancher,rancher/rancher | pkg/controllers/management/clusterupstreamrefresher/gke_upstream_spec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage io_test\n\nimport (\n\t\"os\"\n\t\"strings\"\n\n\t. \"github.com/cloudfoundry/cli/testhelpers/io\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"io helpers\", func() {\n\tIt(\"will never overfl... | go | edit | 0 | 1 | apache-2.0 | ab410f4943fca756da19a3eb86ad94d999ae2167 | diatmpravin/cli,ReachingOut/cli,HuaweiTech/cli,ReachingOut/cli,cgvarela/cli,18F/cli,xingzhou/cli,saravana76/cli,simonleung8/cli,AmitRoushan/cli,hyenaspots/cli,hyenaspots/cli,EngineerBetter/cli,evanfarrar/cli,SrinivasChilveri/cli,diatmpravin/cli,diatmpravin/cli,TomG713/cli,HuaweiTech/cli,cgvarela/cli,pishro-cc/cli,Engin... | testhelpers/io/io_test.go | accepted | null | 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 | bac060e3e6365d60edf1939cb913bedbd14d4df0 | mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper,mailslurper/mailslurper | global/Global.go | rejected_duplicate | Near-duplicate of sample 117453 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"github.com/bmizerany/assert\"\n\t\"testing\"\n)\n\nfunc TestHtpasswd(t *testing.T) {\n\tfile := bytes.NewBuffer([]byte(\"testuser:{SHA}PaVBVZkYqAjCQCu6UBL2xgsnZhw=\\n\"))\n\th, err := NewHtpasswd(file)... | go | edit | 3 | 1 | mit | 52188a1213c3ed67e0700fedd3c6630e5dc09902 | tappleby/slack_auth_proxy,tappleby/slack_auth_proxy | htpasswd_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helper\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc WithDummyCredentials(fn func(dir string)) {\n\tif _, err := ioutil.ReadDir(\"temp\"); err != nil {\n\t\tif err := os.Mkdir(\"temp\", 0755); err != nil {\n\t\t\tpanic(er... | go | edit | 0 | 5 | apache-2.0 | 1e5d8c8871e28166eb7b51fc38bcce6cda47978d | everpeace/kube-aws,camilb/kube-aws,c-knowles/kube-aws,iflix-letsplay/kube-aws,HotelsDotCom/kube-aws,AlmogBaku/kube-aws,AlmogBaku/kube-aws,danielfm/kube-aws,kubernetes-incubator/kube-aws,mumoshu/kube-aws,camilb/kube-aws,mumoshu/kube-aws,iflix-letsplay/kube-aws,HotelsDotCom/kube-aws,everpeace/kube-aws,danielfm/kube-aws,c... | test/helper/helper.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage machineid\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha256\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n)\n\n// run wraps `exec.Command` with easy access to stdout and stderr.\nfunc run(stdout, stderr io.Writer, cmd string, args ..... | go | edit | 0 | 1 | mit | b680299ebed34d40f038ff46dc5da650cb8594b3 | denisbrodbeck/machineid | helper.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/remind101/empire/pkg/heroku\"\n)\n\nvar cmdCertAttach = &Command{\n\tRun: runCertAttach,\n\tUsage: \"cert-attach <aws_cert_name>\",\n\tNeedsApp: true,\n\tCategory: \"certs\",\n\tShort... | go | edit | 12 | 2 | bsd-2-clause | 8c72fca2c9450ef242b81b118d68d6ebb9a62aec | mhahn/empire,remind101/empire,remind101/empire,mhahn/empire,remind101/empire,mhahn/empire,iserko/empire,iserko/empire,iserko/empire | cmd/emp/certs.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage flow\n\n// Group represents a specified collection of users.\n//\n// A user belongs to zero or more groups. Groups can have associated\n// privileges, too.\ntype Group struct {\n\tid uint16\n\tname string\n\tprivs []*Privilege\n}\n... | go | edit | 12 | 4 | apache-2.0 | ec42fc2fa7ad740f6c4e4ec95230e1ddfd5934ca | js-ojus/flow,js-ojus/flow | group.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Simple use of the tuntap package that prints packets received by the interface.\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"code.google.com/p/tuntap\"\n)\n\nfunc main() {\n\tif len(os.Args) != 3 {\n\t\tfmt.Println(\"syntax:\", os.A... | go | edit | 0 | 8 | apache-2.0 | 6bd2e6e26070cce908540b87951a85f22a275141 | mistsys/tuntap,mistsys/tuntap | print_tuntap/print_tuntap.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage proxy\n\nimport (\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc TestEmptyBlacklist(t *testing.T) {\n\tbl := NewEmptyBlacklist()\n\n\thostnames := []string{\"http://localhost\", \"http://google.com\"}\n\n\tfor i := range hostnames {\n\t\turl,... | go | edit | 9 | 4 | apache-2.0 | 56388aa39ed3ddbe3df702a709d38a1ad7eaa2a0 | adamdecaf/go-proxy,adamdecaf/go-proxy,adamdecaf/go-proxy | proxy/empty_blacklist_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage eventsource\n\nimport (\n \"fmt\"\n \"net/http\"\n)\n\nvar header string = `HTTP/1.1 200 OK\nContent-Type: text/event-stream\nCache-Control: no-cache\nConnection: keep-alive\nAccess-Control-Allow-Origin: %s\nAccess-Control-Allow-Crede... | go | edit | 0 | 4 | mit | 9e6a862b9af55bceb71ea9cfd260b9a71943e5cf | luizbranco/eventsource | eventsource.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/dimfeld/glog\"\n\t\"net\"\n)\n\nconst (\n\tWhiteList = iota\n\tBlackList\n)\n\ntype ListenFilter struct {\n\tnet.Listener\n\t// BlackList or WhiteList.\n\tBehavior int\n\tFilterAddr map[string]bool\n}\... | go | edit | 0 | 7 | mit | be4b84d151c1e625baf53b3b01976a730726ae30 | dimfeld/unwebhook,poikilotherm/unwebhook | listenfilter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage musicbrainz\n\nimport (\n\t\"encoding/xml\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nfunc MakeQuery(url string) []byte {\n\tres, err := http.Get(url)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbytes, err := i... | go | edit | 12 | 3 | apache-2.0 | 885b633d61c859138a206a4134d148d5ee70c836 | colinramsay/go-musicbrainz | musicbrainz.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage spider\n\nimport \"io\"\n\ntype spinFunc func(*Context) error\n\ntype spiderFunc struct {\n\tmethod string\n\turl string\n\tbody io.Reader\n\tfn spinFunc\n}\n\nfunc (s *spiderFunc) Setup(parent *Context) (*Context, error) {\n\t... | go | edit | 12 | 1 | mit | 186537d59c5311864644647ea00c4809a959a347 | celrenheit/spider | http_spiders.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/gin-gonic/gin\"\n\nfunc main() {\n\tr := gin.Default()\n\tr.GET(\"/ping\", func(c *gin.Context) {\n\t\tc.JSON(200, gin.H{\n\t\t\t\"message\": \"pong\",\n\t\t})\n\t})\n\tr.Run() // listen and server on 0.0.0.0... | go | edit | 0 | 2 | mit | 4fc00b203ca16aeed2221d9f5f0f5dea741db840 | melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services | golang/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage autocmd\n\nimport (\n\t\"nvim-go/commands\"\n\t\"nvim-go/config\"\n\n\t\"github.com/garyburd/neovim-go/vim\"\n\t\"github.com/garyburd/neovim-go/vim/plugin\"\n)\n\nfunc init() {\n\tplugin.HandleAutocmd(\"BufWritePre\",\n\t\t&plugin.Autoc... | go | edit | 0 | 4 | bsd-3-clause | 77fec7d1e674771f2ce4a7a60510c0c5a36222ea | zchee/nvim-go,zchee/nvim-go | src/nvim-go/autocmd/bufwritepre.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage foo\n\nimport (\n\t\"io\"\n)\n\nfunc Foo(c io.Closer) {\n\tc.Close()\n}\n\nfunc FooArgs(rc io.ReadCloser) {\n\tvar b []byte\n\trc.Read(b)\n\trc.Close()\n}\n\n```\n\nApply this change: Make sure that we also work with make"
},
{
... | go | edit | 6 | 1 | bsd-3-clause | 95b9d73a9c4920e40bd13218a614bbb5cb6bb1ba | mvdan/interfacer | testdata/none.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jwt\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestVerifyExp(t *testing.T) {\n\tassert := assert.New(t)\n\tnow := time.Now()\n\n\t{\n\t\texp := now.Unix()\n\t\tassert.False(VerifyExp(0,... | go | edit | 0 | 1 | bsd-3-clause | 9c0f4c53b87110abff873992ca79ad6b722ebb52 | nabeken/jwt.go | jwt_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage base\n\nimport \"fmt\"\n\n// EvaluatedCandidate is an immutable wrapper for associating a candidate\n// solution with its fitness score.\ntype EvaluatedCandidate struct {\n\tcandidate Candidate\n\tfitness float64\n}\n\n// NewEvaluated... | go | edit | 0 | 3 | mit | 9c71e06535ecb979a539091be77f6758ac291996 | aurelien-rainone/evolve,aurelien-rainone/evolve | base/evaluated_candidate.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//\n// Copyright (c) 2017 Cavium\n//\n// SPDX-License-Identifier: Apache-2.0\n//\n\npackage distro\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/go-zoo/bone\"\n)\n\nfunc replyPing(w http.ResponseWriter, r *http.Request) {\n\tw.Header(... | go | edit | 3 | 1 | apache-2.0 | 57a2a5add1462a4998ec57e22c21acb199e0bcb0 | feclare/edgex-export | distro/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2009 The go9p 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\t\"flag\"\n\t\"log\"\n\n\t\"github.com/lionkov/go9... | go | edit | 0 | 2 | bsd-3-clause | 740a3152c643c91c371a12d81b3c21e937d694ba | edahlgren/go9p,lionkov/ninep | p/srv/examples/ufs/ufs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\n\t\"github.com/localhots/satan\"\n\t\"github.com/localhots/satan/example/daemons\"\n\t\"github.com/localhots/satan/example/kafka\"\n)\... | go | edit | 0 | 2 | mit | 78cfb92db3eb1459216b243e749d05b646332a65 | localhots/satan,localhots/satan,localhots/satan,localhots/satan | example/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage limio\n\nimport (\n\t\"io\"\n\t\"time\"\n)\n\ntype LimitManager struct {\n\trmap map[Limiter]<-chan uint64\n}\n\nfunc (rm *LimitManager) run() {\n}\n\nfunc NewReadManager() *LimitManager {\n\trm := LimitManager{\n\t\trmap: make(map[Limi... | go | edit | 15 | 3 | mit | a0819f4e6ae10065dc4ac619622ee0d2f541b7cb | andrewstuart/limio | limit_manager.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage srtp\n\nimport \"github.com/pion/rtp\"\n\n// cipher represents a implementation of one\n// of the SRTP Specific ciphers\ntype srtpCipher interface {\n\tauthTagLen() int\n\taeadAuthTagLen() int\n\tgetRTCPIndex([]byte) uint32\n\n\tencrypt... | go | edit | 0 | 0 | mit | 1062545f53dfcc78692e9b127bdcecb0ae07c488 | pion/srtp | srtp_cipher.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage taptun\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype ifreq struct {\n\tname [syscall.IFNAMSIZ]byte // c string\n\tflags uint16 // c short\n\t_pad [24 - unsafe.Sizeof(uint16(0))]byte\n}\n\nf... | go | edit | 6 | 3 | mit | 20a08032808eebab9a968fe127361179e82651cd | pkg/taptun | taptun_linux.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sprockets\n\nimport (\n\t\"html/template\"\n)\n\nfunc NullSprockets() ViewHelper {\n\treturn ViewHelper{nullSprockets{}}\n}\n\ntype nullSprockets struct{}\n\nfunc (s nullSprockets) GetAssetUrl(name string) (template.HTMLAttr, error) {\n... | go | edit | 0 | 1 | mit | f89d9d946c0a8ff028c617d843dac153b405f0fa | 99designs/goodies | sprockets/null_sprockets.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helper\n\nvar guessExecutableName = \"openvpn\"\nvar guessExecutablePaths = []string{\n\t\"/Applications/Tunnelblick.app/Contents/Resources/openvpn/default\",\n}\nvar guessExecutableSuggestions = `\nIf you use Homebrew, you can install ... | go | edit | 0 | 0 | mit | cf958f83f31387251fda6aedcc24506bf4c83c2b | dpb587/ssoca,dpb587/ssoca,dpb587/ssoca | service/openvpn/client/helper/executable_finder_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schema\n\nimport \"errors\"\n\n// AnyOf validates if any of the sub field validators validates.\ntype AnyOf []FieldValidator\n\n// Compile implements Compiler interface.\nfunc (v *AnyOf) Compile() (err error) {\n\tfor _, sv := range *v ... | go | edit | 3 | 4 | mit | 1e0b0e6dbfa427afa1772b724f4418dd76313ac1 | rs/rest-layer | schema/anyof.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sss\n\nimport (\n\t\"testing\"\n)\n\nfunc TestRoundtrip(t *testing.T) {\n\tn := 30\n\tk := 2\n\n\texpected := \"well hello there!\"\n\tshares, err := Split(n, k, []byte(expected))\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tsubset :=... | go | edit | 6 | 4 | mit | 919e17af9fabd8520e38922fadc9484e6a1234a5 | codahale/sss | sss_test.go | rejected_lint | Too many lint violations: 6 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.