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 window\n\n/*\n#include <SDL2/SDL.h>\n\nint getEventType(SDL_Event e) {\n return e.type;\n}\nint getEventKey(SDL_Event e) {\n return e.key.keysym.scancode;\n}\nint getEventKeyState(SDL_Event e) {\n return e.key.state;\n}\n*/\nim... | go | edit | 9 | 6 | mit | a0aad9fd1cb9114c8e4e974c9ac4bdc6ea1926f3 | anthonyrego/gosmf,anthonyrego/dodge | window/events.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 Michael Yang. 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.\npackage v2\n\nfunc isBitSet(flag, index byte) bool {\n\treturn flag&(1<<index) == 1\... | go | edit | 0 | 1 | mit | 03517118034de160a85b2b693c23089c491d8a3e | mikkyang/id3-go | v2/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc BenchmarkDivisionMod(b *testing.B) {\n\td := NewDivisionMod(1000)\n\t// run the dividable check function b.N times\n\tfor n := 0; n < b.N; n++ {\n\t\td.IsRestlessDividable(uint64(n))\n\t}\n}\n\... | go | edit | 12 | 2 | mit | 4032210a0d0482d6b473fa92bc6fa39346683155 | breml/zeroremainder,breml/zeroremainder | division_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goat\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n)\n\n// GetFilesJSON returns a JSON representation of one or more FileRecords\nfunc GetFilesJSON(ID int, resChan chan []byte) {\n\t// Check for a valid integer ID\n\tif ID > 0 {\n\t\t// ... | go | edit | 3 | 3 | mit | f73a37c7aa78775701db4302185bd128dff3dbfe | mdlayher/goat | goat/apiFiles.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"../../../drawer\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"image/png\"\n\t\"os\"\n)\n\nfunc main() {\n\tsrc := image.NewRGBA(image.Rect(0, 0, 100, 100))\n\tdrawer.Fill(src, color.RGBA{0, 255, 255, 255})\n\n\... | go | edit | 0 | 3 | bsd-3-clause | fd03996764fd8e51e4954110c023ae95bf7c3b4a | ricochet2200/drawer | examples/line/line-main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc getUsername(configuration *Configuration) {\n\tfor {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tfmt.Print(\"Spotify Username: \")\n\t\tusername... | go | edit | 9 | 4 | mit | 1d5872ab710a532675e33e46fe97a18ac61f5ccf | adrien-f/gotify | config/wizard.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\"net\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar (\n\thost string // The host address to scan\n)\n\nfunc init() {\n\tif len(os.Args) != 2 {\n\t\tfmt.Fprintf(os.Stderr, \"Usage: %s host\\n\", os.Args[0])... | go | edit | 0 | 2 | mit | 605ca2cc43ff3ac0971da11ca974738000896fd1 | redforks/portscan | app.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/teddywing/git-checkout-history/utils\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc main() {\n\targs := os.Args[1:]\n\t\n\tif len(args) > 0 {\n\t\tutils.Store(args[0])\n\t\t\n\t\tcmd := ex... | go | edit | 0 | 3 | mit | d77af4ce1538f9da5e51e3ecb15a24bbe90358e5 | teddywing/git-checkout-history | git-checkout-store/main.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\"net/http\"\n)\n\ntype agent struct {\n\tname string\n\tvalue int\n}\n\nvar agents []*agent\nvar broadcastGroup []chan bool\n\nfunc broadcastTick(cs []chan bool) {\n\tfor _, c := range cs {\n\t... | go | edit | 12 | 2 | apache-2.0 | 87ae2b2f43752068e9d644f2dbac5b32af1d7060 | sillsm/econix-proto,sillsm/econix-proto | devserver/server.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rerun\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n)\n\ntype Cmd struct {\n\tcmd *exec.Cmd\n\targs []string\n}\n\nfunc Run(args ...string) (*Cmd, error) {\n\tcmd := &Cmd{\n\t\targs: args,\n\t}\n\tif err := cmd.run(); err != nil {\n\t\treturn ... | go | edit | 3 | 4 | mit | c9af83722b7c0de1aa0dbb5d9f62afa1f17a513b | VojtechVitek/rerun | cmd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build norwfs\n\npackage dotgit\n\nimport \"gopkg.in/src-d/go-git.v4/plumbing\"\n\n// There are some filesystems tha don't support opening files in RDWD mode.\n// In these filesystems the standard SetRef function can not be used as i\n// rea... | go | edit | 3 | 7 | apache-2.0 | d3e7c9060a14ac579f899fd01c936319132cbc97 | go-git/go-git,src-d/go-git,src-d/go-git,mcuadros/go-git,mcuadros/go-git,go-git/go-git | storage/filesystem/internal/dotgit/dotgit_setref_norwfs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/xiaonanln/goworld\"\n\t\"github.com/xiaonanln/goworld/components/game\"\n)\n\n// serverDelegate 定义一些游戏服务器的回调函数\ntype serverDelegate struct {\n\tgame.GameDelegate\n}\n\nfunc main() {\n\tgoworld.RegisterSp... | go | edit | 0 | 1 | apache-2.0 | 5609ecab4d34441d24d6a668dc78b2a97b94130f | xiaonanln/goworld,xiaonanln/goworld | examples/chatroom_demo/chatroom_demo.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Add tests for service names"
},
{
"role": "assistant",
"content": "package service\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestServiceNameShouldDropPackage(t *testing.T) {\n\tn... | go | new_file | 12 | 1 | mit | 75db787c87b48022251fc4de4f56cf1c11a9efeb | hoop33/limo | service/service_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"math/big\"\n\t\"math/rand\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/ethereum/go-ethereum/common\"\n)\n\nvar pow256 = common.BigPow(2, 256)\n\nfunc Random() string {\n\tmin := int64(100000000000000)\n\tmax := i... | go | edit | 0 | 1 | mit | 50f3f315518d56a8eea76c3d120cd275c6b6d41c | sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy | util/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/hybridgroup/gobot\"\n\t\"github.com/hybridgroup/gobot/api\"\n\t\"github.com/hybridgroup/gobot/platforms/pebble\"\n)\n\nfunc main() {\n\tgbot := gobot.NewGobot()\n\tapi.NewAPI(gbot).Start()\n... | go | edit | 0 | 1 | apache-2.0 | a155efab14cbe6b7f376668c905dd185e36a0437 | nzmichaelh/gobot,nzmichaelh/gobot | examples/pebble_accelerometer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scoring\n\n// An entry represents a path and a score.\ntype Entry struct {\n\tPath string\n\tScore *Score\n}\n\n// Update the score for an entry.\nfunc (e *Entry) UpdateScore() {\n\te.Score.Update()\n}\n\n// Calculates the score for an... | go | edit | 6 | 1 | mit | 7d555b034c53c439c63b358e30188b9afa4102af | gsamokovarov/jump | scoring/entry.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\"os\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/tsukaeru/pacicli/command\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"pacicli\"\n\tapp.Version = Version\n\tapp.Usage = \"Command line interf... | go | edit | 3 | 3 | mit | 49ceda1c9bfbb55a46ab1570d749622e1af09cc8 | tsukaeru/pacicli,tsukaeru/pacicli | pacicli.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/sylphon/build-runner\"\n\t\"github.com/sylphon/build-runner/builderfile\"\n)\n\nvar example = &builderfile.UnitConfig{\n\tVersion: 1,\n\tContainerArr: []*builderfile.ContainerSecti... | go | edit | 0 | 2 | mit | 3650d79be34b44621a0948e662a010a4d0d7c0d8 | winchman/builder-core | _example/run_build.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n)\n\ntype nopCloser struct {\n\tio.Reader\n}\n\nfunc (nopCloser) Close() error { return nil }\n\nfunc TestParseAlivePost(t *testing.T) {\n\tvar body io.ReadCloser = nopCloser{bytes... | go | edit | 3 | 3 | mit | 5f7e1109e86393fb2ac702d0736c0f53d6e81428 | aliveim/aliveim-service | aliveim_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage main\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n)\n\nfunc (c *fileCmd) getOwner(f *os.File) (os.FileMode, int, int, error) {\n\tfInfo, err := f.Stat()\n\tif err != nil {\n\t\treturn os.FileMode(0), ... | go | edit | 3 | 2 | apache-2.0 | af252ecb763388dc9ca4f45c8572cafe17fda9f1 | atxwebs/lxd,atxwebs/lxd,chrisglass/lxd,erikmack/lxd,lxc/lxd,stgraber/lxd,georghopp/lxd,jsavikko/lxd,hallyn/lxd,chrisglass/lxd,techtonik/lxd,hallyn/lxd,lxc/lxd,pcdummy/lxd,georghopp/lxd,stgraber/lxd,lxc/lxd,jsavikko/lxd,Skarlso/lxd,akshaykarle/lxd,mjeanson/lxd,lxc/lxd,Skarlso/lxd,hallyn/lxd,akshaykarle/lxd,lxc/lxd,techt... | lxc/file_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gogist\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/gorilla/mux\"\n)\n\nconst t = `\n<html>\n <head>\n <meta name=\"go-import\" content=\"%s git https://gist.github.com/%s.git\" />\n <script>window.location='https://g... | go | edit | 0 | 1 | apache-2.0 | 6776724d9cb31b9ff6ad959d3167159ec5abebed | ImJasonH/go-gist | app.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/getlantern/osversion\"\n\n\t\"golang.org/x/mobile/app\"\n)\n\nfunc main() {\n\t// checkNetwork runs only once when the app first loads.\n\tapp.Main(func(a app.App) {\n\t\tstr, err := osversi... | go | edit | 0 | 4 | apache-2.0 | 19bb14f1a04668c77bfdb55a8ea064264d11b3f0 | onlynight/lantern,lioonline/lantern,lfckop/lantern,CJstar/lantern,kmingee/lantern,lozybean/lantern,roceys/lantern,Minghi/lantern,jp1017/lantern,ChenZeXian/lantern,zhengnanlee/lantern,dangwy/lantern,todaylover/lantern,wangdongming007/lantern,hhua/lantern,lozybean/lantern,ykelvis/lantern,zmcadam/lantern,webwlsong/lantern... | src/github.com/getlantern/osversion/cmd/main_android.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 The casbin Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License a... | go | edit | 0 | 2 | apache-2.0 | 556cdaabd00d090e47ea3092b46fb8d41ef65478 | faceless-saint/casbin,casbin/casbin,hsluoyz/casbin | util/log_util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage knc\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n)\n\nfunc Request(host string, data []byte) ([]byte, error) {\n\tcmd := exec.Command(\"/usr/bin/knc\", fmt.Sprintf(\"host@%s\", host), \"20575\")\n\n\tstdin, err := cmd.StdinPipe()\n\tif err !=... | go | edit | 0 | 4 | mit | 9cff936277f5779ac06c29ac67ebfb400c0bf100 | sipb/homeworld,sipb/homeworld,sipb/homeworld,sipb/homeworld | building/build-debs/homeworld-keyserver/src/keycommon/knc/knc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage detector\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"gopkg.in/mgo.v2/bson\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestTask(t *testing.T) {\n\tassert := assert.New(t)\n\n\tStopCronNow()\n\tStartCron()\n\n\terr := TaskM... | go | edit | 18 | 1 | mit | c51725b04603d8fbfa6e3a702fbd526812b81b79 | miclle/observer,miclle/observer,miclle/observer | detector/task_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gop\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/segmentio/go-loggly\"\n)\n\n// A timber.LogWriter for the loggly service.\n\n// LogglyWriter is a Timber writer to send logging to the loggly\n// service. See: https://loggly.com.\n... | go | edit | 6 | 2 | bsd-3-clause | 646b91a408e95c73466ea946aed893987542b30e | cocoonlife/gop | timber_loggly_writer.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gomol\n\nimport (\n\t\"time\"\n\n\t. \"gopkg.in/check.v1\"\n)\n\ntype testClock struct {\n\tcurTime time.Time\n}\n\nfunc newTestClock(curTime time.Time) *testClock {\n\treturn &testClock{curTime: curTime}\n}\n\nfunc (c *testClock) Now()... | go | edit | 21 | 1 | mit | 56bfaeda70752ff87e8fac957b4c4bad59c4ef17 | aphistic/gomol | timing_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage systime\n\nimport (\n\t\"github.com/Symantec/tricorder/go/tricorder\"\n\t\"github.com/Symantec/tricorder/go/tricorder/units\"\n)\n\nfunc register(dir *tricorder.DirectorySpec) *prober {\n\tp := new(prober)\n\tp.dir = dir\n\t// TODO(rgoo... | go | edit | 6 | 3 | apache-2.0 | 6149daf3f4d11335bd9aed9c7d9afd39765a0f51 | rgooch/health-agent,Symantec/health-agent,rgooch/health-agent,Symantec/health-agent | probers/systime/register.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\"archive/zip\"\n\t\"bytes\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/service/lambda\"\n)\n\nvar runtimeFunction = `\nexports.handler = function(event, context) {\n\teval(event.source);\n... | go | edit | 6 | 2 | mit | df2e9c9b3cb816a0166e8d1c85271e3f6d40a291 | mthenw/weblambda | install.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2015, Peter Mrekaj. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE.txt file.\n\npackage ptypes\n\nimport \"math\"\n\n// parityTable is a parity cache for... | go | edit | 0 | 2 | mit | c8ac58d9c63790c18ed4eae1a12c3982d006024c | mrekucci/epi,mrekucci/epi | ptypes/parity.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !appengine\n\npackage main\n\nimport (\n\t\"github.com/raphael/goa\"\n\t\"github.com/raphael/goa-cellar/app\"\n\t\"github.com/raphael/goa-cellar/controllers\"\n\t\"github.com/raphael/goa-cellar/js\"\n\t\"github.com/raphael/goa-cellar/... | go | edit | 0 | 1 | mit | a8a7b56e02a611ebfef846f2b3002c8ffb34397f | raphael/goa-cellar,lxgxiong/goa-cellar,goadesign/goa-cellar,goadesign/goa-cellar,raphael/goa-cellar,lxgxiong/goa-cellar,lxgxiong/goa-cellar,goadesign/goa-cellar,raphael/goa-cellar | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage asset\n\n// DefaultImages are the defualt images bootkube components use.\nvar DefaultImages = ImageVersions{\n\tEtcd: \"quay.io/coreos/etcd:v3.1.8\",\n\tFlannel: \"quay.io/coreos/flannel:v0.10.0-amd64\",\n\tFlannelCN... | go | edit | 3 | 0 | apache-2.0 | 9b75d611517bbfc21c47428bb032ee9b4ff5b098 | kubernetes-incubator/bootkube,kubernetes-incubator/bootkube,kubernetes-incubator/bootkube | pkg/asset/images.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/vulcand/oxy/forward\"\n\t\"github.com/vulcand/oxy/roundrobin\"\n\t\"github.com/vulcand/oxy/stream\"\n\t\"github.com/vulcand/oxy/cbreaker\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\ntype ReverseProxy struct ... | go | edit | 0 | 2 | mit | 6de1e967d90ef22c6224e7d47ac6f437f0c18924 | xaviergodart/gydro | server/reverse_proxy.go | accepted | null | 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\"os\"\n)\n\nconst (\n\tversion = \"0.6.0\"\n)\n\ntype App struct {\n\tNotification\n\tDomain string\n\tPath string\n\tPort string\n}\n\nfunc main() {\n\tapp := new... | go | edit | 0 | 2 | mit | fc9c00598b60c6d17d4d16788cda65e062e0b58b | sdaros/rem,sdaros/rem | rem.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage phonenumber\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc Number(phoneNumber string) (number string, e error) {\n\tfor _, character := range phoneNumber {\n\t\tif unicode.IsDigit(character) {\n\t\t\tnumber += string(ch... | go | edit | 0 | 8 | mit | 69269e6470f0bf9bcd78770fea6b6c99945fd32f | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/phone-number/phone_number.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage arrays\n\n// Strings allows us to limit our filter to just arrays of strings\ntype Strings struct{}\n\n// Filter filters an array of strings.\nfunc (s Strings) Filter(in []string, keep func(item string) bool) []string {\n\tvar out []str... | go | edit | 0 | 3 | mit | 2d5303d4031281c215b115d7609fa087912833a8 | materials-commons/gohandy,materials-commons/gohandy | arrays/strings.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/kataras/go-template/html\"\n\t\"gopkg.in/kataras/iris.v6\"\n)\n\ntype page struct {\n\tTitle string\n}\n\nfunc main() {\n\tiris.UseTemplate(html.New()).Directory(\"./templates/web/default\", \".html\")\n... | go | edit | 9 | 1 | mit | c7a893b976b4b8a17f378bccff03473a31f79b33 | iris-contrib/examples,iris-contrib/examples,iris-contrib/examples,iris-contrib/examples | static_files/main.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\"time\"\n)\n\nfunc worker(id int, jobQueue <-chan int, done <-chan struct{}) {\n\tfor {\n\t\tselect {\n\t\tcase jobID := <-jobQueue:\n\t\t\tfmt.Println(id, \"Executing job\", jobID)\n\t\tcase <-done:\n\t\... | go | edit | 0 | 4 | apache-2.0 | 38e08c9a6016d98926ce49a8850d75ddf6663e19 | nickng/dingo-hunter,nickng/dingo-hunter,nickng/dingo-hunter | examples/popl17/jobsched/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage unit\n\ntype Subject struct {\n\tassert *Assertion\n\tname string\n}\n\nfunc NewSubject(assert *Assertion) *Subject {\n\treturn &Subject{\n\t\tassert: assert,\n\t\tname: \"\",\n\t}\n}\n\nfunc (subject *Subject) FailWithMessage(messa... | go | edit | 6 | 8 | mit | e83eec9479533c5d32f6717f5e2074d5c5933323 | evolsnow/v2ray-core,simpleman1984/v2ray-core,LiuWenJu/v2ray-core,evolsnow/v2ray-core,takeshineshiro/v2ray-core,faint32/v2ray-core,chuangWu/v2ray-core,ghmajx/v2ray-core,Amonhuz/v2ray-core,panzer13/v2ray-core,simpleman1984/v2ray-core,takeshineshiro/v2ray-core,Amonhuz/v2ray-core,jessxuan/v2ray-core,simpleman1984/v2ray-cor... | testing/unit/subject.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/99designs/aws-vault/v6/server\"\n\t\"github.com/alecthomas/kingpin\"\n)\n\nfunc ConfigureProxyCommand(app *kingpin.Application, a *AwsVault) {\n\tstop := false\... | go | edit | 3 | 2 | mit | a6ac84b7c8d5c2de2d5f2dc735503f07325ce9c1 | 99designs/aws-vault,99designs/aws-vault | cli/proxy.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage services\n\nimport (\n\t\"database/sql\"\n\t\"encoding/json\"\n\t\"log\"\n\n\t\"cjdavis.me/elysium/db\"\n\t\"cjdavis.me/elysium/models\"\n)\n\ntype IProfileService interface {\n\tGetProfile() *models.Profile\n}\n\ntype ProfileService st... | go | edit | 0 | 2 | mit | b021354d91e896398c119da671be12f5720338a1 | Crevax/Elysium | services/profile_service.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !pango_1_10,!pango_1_12,!pango_1_14\n\npackage cairo\n\n// #include <stdlib.h>\n// #include <cairo.h>\n// #include <cairo-gobject.h>\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// GetVariations is a wrapper around cairo_font_options_g... | go | edit | 9 | 2 | isc | ad2cb5bec94bb544332d9c4feae4a90749a31404 | gotk3/gotk3,gotk3/gotk3 | cairo/fontoptions_since_1_16.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage docker\n\nimport (\n\t\"time\"\n\n\tdockerClient \"github.com/fsouza/go-dockerclient\"\n\t\"github.com/rancherio/os/config\"\n)\n\nconst (\n\tMAX_WAIT = 30000\n\tINTERVAL = 100\n)\n\nfunc NewClient(cfg *config.Config) (*dockerClient.Cli... | go | edit | 0 | 6 | apache-2.0 | dd8265b042b9a9194eb792bdb1611f0096c05b62 | juliengk/os,datawolf/os,OnePaaS/os,datawolf/os,rancherio/os,hairyhenderson/rancheros,OnePaaS/os,gizmotronic/os,SvenDowideit/os,cloudnautique/os,cloudnautique/os,hairyhenderson/rancheros,SvenDowideit/os,gizmotronic/os,arnononline/os,hairyhenderson/rancheros,arnononline/os,duguhaotian/os,rancherio/os,luxas/os,duguhaotian... | docker/client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tlog \"github.com/sirupsen/logrus\"\n\t\"github.com/urfave/cli\"\n\t\"time\"\n)\n\nfunc RunPeriodically(c *cli.Context) error {\n\n\tlog.SetFormatter(_makeFormatter(c.String(\"format\")))\n\n\tlog.WithFields(log.Field... | go | edit | 0 | 3 | apache-2.0 | e0b2031760b8420e0b9b912870891981fa3e31a0 | qualimente/heartbeat | heartbeat.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage run_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/influxdata/influxdb/cmd/influxd/run\"\n)\n\nfunc TestCommand_PIDFile(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(os.T... | go | edit | 0 | 7 | mit | 3e0bf925f86b00256549597a85216ff6c9faba18 | vladlopes/influxdb,li-ang/influxdb,benbjohnson/influxdb,influxdb/influxdb,linearb/influxdb,influxdb/influxdb,influxdata/influxdb,influxdata/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,benbjohnson/influxdb,benbjohnson/influxdb,mark-rushakoff/influxdb... | cmd/influxd/run/command_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"os/exec\"\n\t\"sort\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc ls(dir string) []string {\n\tcmd := exec.Command(\"cmd\")\n\tcmd.SysProcAttr = &syscall.SysProcAttr{\n\t\tCmdLine: \"cmd /C dir /A /B \" + dir,\n\t}\n\... | go | edit | 6 | 4 | bsd-2-clause | 457e2e76263206369c7c60dbcf3461e70b253f92 | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | util/fullnames_windows_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"sort\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/prometheus/alertmanager/types\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestByStatus(t *testing.T) {\n\ts1 := types.Silence{EndsAt: time.Now().Add(-2... | go | edit | 0 | 1 | mit | 2bc6be281a56e846895c02ae8921aabf1797199d | metalmatze/alertmanager-bot,metalmatze/alertmanager-bot | silences_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Keybase, Inc. All rights reserved. Use of\n// this source code is governed by the included BSD license.\n\n// +build !darwin,!android\n\npackage libkb\n\nfunc NewSecretStoreAll(g *GlobalContext) SecretStoreAll {\n\treturn NewS... | go | edit | 6 | 2 | bsd-3-clause | 18fae267b278520a502e1abcf8c6607ddb5a7f88 | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client | go/libkb/secret_store_win_linux.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage checkers\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Point struct {\n\tX, Y int\n}\n\nfunc (p Point) Add(q Point) Point {\n\treturn Point{p.X + q.X, p.Y + q.Y}\n}\n\nfunc (p Point) Sub(q Point) Point {\n\treturn Point{p.X - q.X, p.Y -... | go | edit | 0 | 3 | apache-2.0 | c71c0e10844ee5ea90099ff70c3fea88b3f3e56b | cl0ne/go-checkers | checkers/point.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage apparmor_test\n\nimport (\n\t\"github.com/cri-o/cri-o/internal/config/apparmor\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\n// The actual test suite\nvar _ = t.Describe(\"Config\", func() {\n\tvar sut *apparmo... | go | edit | 30 | 2 | apache-2.0 | 1dcf7b931c04a4eb0eb885abb4972d37769b1cef | kubernetes-incubator/cri-o,mikebrow/cri-o,kubernetes-incubator/cri-o,kubernetes-incubator/ocid,mikebrow/cri-o,kubernetes-incubator/cri-o,mikebrow/cri-o,nalind/cri-o,kubernetes-incubator/ocid,kubernetes-incubator/cri-o,mikebrow/cri-o,nalind/cri-o,kubernetes-incubator/ocid,nalind/cri-o | internal/config/apparmor/apparmor_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stripe\n\nimport \"encoding/json\"\n\n// LoginLinkParams is the set of parameters that can be used when creating a login_link.\n// For more details see https://stripe.com/docs/api#create_login_link.\ntype LoginLinkParams struct {\n\tPar... | go | edit | 6 | 0 | mit | aa1a35bbb0473dd3c966773485b7e744434d7d16 | ChannelMeter/stripe-go,froatsnook/stripe-go,stripe/stripe-go,ChannelMeter/stripe-go,froatsnook/stripe-go,stripe/stripe-go | loginlink.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sign\n\nimport (\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"fmt\"\n)\n\nfunc parsePrivateKey(data []byte) (*rsa.PrivateKey, error) {\n\tpemData, err := pemParse(data, \"PRIVATE KEY\")\n\tif err != nil {\n\t\treturn ni... | go | edit | 0 | 4 | apache-2.0 | ffa15356101da9e453bd5bbe85421684648841a2 | AaronO/go-rsa-sign | parse.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slacker\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"net/http\"\n)\n\ntype Slacker struct {\n\tURL string\n\tIcon string\n\tUsername string\n}\n\ntype payload struct {\n\ttext string `json:\"text\"`\n\ticon string... | go | edit | 0 | 3 | mit | c84011efd6380a48d0b70dd5caa3db2632d69561 | stayradiated/slacker | slacker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nodes\n\n// NewHeaderNode creates a new HeaderNode with optional content nodes n.\nfunc NewHeaderNode(level int, n ...Node) *HeaderNode {\n\treturn &HeaderNode{\n\t\tnode: node{typ: NodeHeader},\n\t\tLevel: level,\n\t\tContent: New... | go | edit | 27 | 2 | apache-2.0 | eec2501b4cbe725c9088df5a5304e6e0806c7f3b | googlecodelabs/tools,googlecodelabs/tools,googlecodelabs/tools,googlecodelabs/tools | claat/nodes/header.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/ant0ine/go-json-rest/rest\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\n\trouter, err := rest.MakeRouter(\n\t\t&rest.Route{\"GET\", \"/stream\", StreamThings},\n\t)\n\tif err... | go | edit | 0 | 2 | mit | 4a9e5b8400456fdb397ec1e737c47ca3d861d804 | jacobxk/go-json-rest-examples,ant0ine/go-json-rest-examples,snowsnail/go-json-rest-examples | streaming/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage types\n\n// ContainerCreateResponse contains the information returned to a client on the\n// creation of a new container.\ntype ContainerCreateResponse struct {\n\t// ID is the ID of the created container.\n\tID string `json:\"Id\"`\n\n... | go | edit | 0 | 0 | apache-2.0 | cae5a121a9f49ecda04fea1797a48a5774380e5e | jwhonce/engine-api,mikedougherty/engine-api,msabansal/engine-api,rhatdan/engine-api,vdemeester/engine-api,thaJeztah/engine-api,docker/engine-api | types/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc setupTls() {\n\tif *caFile == \"\" || *certFile == \"\" || *keyFile == \"\" {\n\t\tretu... | go | edit | 9 | 7 | apache-2.0 | 47fcc9b235c7205b30f163f295e682e91093fcb0 | rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator | cmd/subd/tls.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sigctx\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"os/signal\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/SentimensRG/ctx\"\n)\n\nvar (\n\tc ctx.C\n\tonce sync.Once\n)\n\n// New signal-bound ctx.C that terminates when either SIGINT o... | go | edit | 0 | 3 | mit | da55c7425a73afbf60bb5d6bb7592d7f14a35332 | SentimensRG/ctx | sigctx/sigctx.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sdegutis/go.fsevents\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Fprintln(os.Stderr, \"Usage: aroc DIRECTORY|FILE COMMAND [ARGS…]\")\n\t\tos.Exi... | go | edit | 3 | 5 | mit | 467a19e7e27ed9db000660f38a66c8719a2e06e5 | mxey/aroc | aroc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestFindOrCreateTagByNameShouldCreateTag(t *testing.T) {\n\ttag, _, err := FindOrCreateTagByName(db, \"my-tag\")\n\tassert.Nil(t, err)\n\tassert.Not... | go | edit | 21 | 1 | mit | 42d12c834deedf68eb52614eec751311376279e2 | hoop33/limo | model/tag_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage execext\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/mvdan/sh/interp\"\n\t\"github.com/mvdan/sh/syntax\"\n)\n\n// RunCommandOptions is the options for the RunCommand func\ntype RunCommandOptions st... | go | edit | 0 | 4 | mit | c9a64fedd7c65111b1438e762c98304b746d1033 | go-task/task,go-task/task | execext/exec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage matchers\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\ntype AssignableToMatcher struct {\n\tExpected interface{}\n}\n\nfunc (matcher *AssignableToMatcher) Match(actual interface{}) (success bool, message string, err error) {\n\tif actual ... | go | edit | 6 | 4 | mit | 5eef64a47062d4fc0cd8fa913984278a5ebb6900 | jim-slattery-rs/gomega,james-lawrence/gomega,pivotal-cf-experimental/gomega,raphael/gomega,onsi/gomega,cf-guardian/gomega,ebabani/gomega | matchers/assignable_to_matcher.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage reporters\n\nimport (\n\t\"os/exec\"\n\n\t\"github.com/approvals/go-approval-tests/utils\"\n)\n\n// NewFrontLoadedReporter creates the default front loaded reporter.\nfunc NewFrontLoadedReporter() *Reporter {\n\ttmp := NewFirstWorkingRe... | go | edit | 30 | 2 | apache-2.0 | 12e97361f951973205e3df80d4c7cb3b870d6df2 | approvals/go-approval-tests | reporters/diff_reporter.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage resources\n\nimport \"github.com/cloudfoundry/cli/cf/models\"\n\ntype PaginatedSpaceQuotaResources struct {\n\tResources []SpaceQuotaResource\n}\n\ntype SpaceQuotaResource struct {\n\tResource\n\tEntity models.SpaceQuota\n}\n\nfunc (res... | go | edit | 6 | 1 | apache-2.0 | 83256ccf0f5776e48499a2d4587dba8fff1c6ba0 | TomG713/cli,SrinivasChilveri/cli,SrinivasChilveri/cli,carnell69/cli,saurabhguptasg/cli,TomG713/cli,simonleung8/cli,zhang-hua/cli,srikanth88infy/cli,kavoj/cli,cgvarela/cli,zhang-hua/cli,ReachingOut/cli,carnell69/cli,saravana76/cli,rastasheep/trash-can,SrinivasChilveri/cli,Zouuup/cli,fujitsu-cf/cli,mcowger/cli,Zouuup/cli... | cf/api/resources/space_quotas.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux,cgo\n\npackage term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// #include <termios.h>\nimport \"C\"\n\ntype Termios syscall.Termios\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and... | go | edit | 6 | 3 | apache-2.0 | 05a8de46853f8b3534ca6d0cb03121ae214e8a34 | keerthanabs1/docker,lixiaobing10051267/docker,manchoz/docker,mpatlasov/docker,jagdeesh109/docker,yp-engineering/docker,mixja/docker,wzzrd/docker,dccurtis/docker,kirankbs/docker,jc-m/docker,kdomanski/docker,wulonghui/docker,ankushagarwal/docker,zoomis/docker,bonczj/moby-json-file-logger,pecameron/docker,SFDMumbaiDockerH... | pkg/term/tc_linux_cgo.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\"net/http\"\n\t\"regexp\"\n\t\"strings\"\n)\n\ntype Request struct {\n\tFilename string\n\tContent string\n\tCommand string\n\tImage string\n\tFormat string\n}\n\nvar FilenameRegexp = regexp.MustCo... | go | edit | 0 | 7 | mit | 832ab4bf90134d6cdbba149055ad7441355f1c85 | bitrun/api,sosedoff/bitrun-api | request.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// Copyright (c) 2016, crasm <<EMAIL>>\n// This code is open source under the ISC license. See LICENSE for details.\n\nimport \"os\"\n\nconst DefaultPerm = 0644\n\n// True if at most one is true. All can be false.\nfunc isMutual... | go | edit | 0 | 3 | isc | 1934353e8b5b987ef23c9de2c918d88da8fbe9cc | crasm/shield | util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ginkgomon\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/tedsuo/ifrit\"\n)\n\nfunc Invoke(runner ifrit.Runner) ifrit.Process {\n\tprocess := ifrit.Background(runner)\n\n\... | go | edit | 6 | 3 | mit | 65ca48cd8a947d0e80efa4bda726f0363352e5f9 | jfmyers9/ifrit,jenspinney/ifrit,lwoydziak/ifrit,tedsuo/ifrit | ginkgomon/helpers.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\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc init() {\n\tlog.SetOutput(os.Stdout)\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Got\", r.Method,... | go | edit | 3 | 4 | mit | 73665c55265666ab4c6a0483697663b002df0ac4 | chris/http_request_logger | http_request_logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/grsakea/kappastat/backend\"\n)\n\nfunc main() {\n\tlaunchBackend()\n\tlaunchFrontend()\n}\n\nfunc launchBackend() *backend.Controller {\n\tc := backend.SetupController(\"twitch\")\n\tgo c.Loop()\n\tretur... | go | edit | 0 | 1 | mit | 6938b44bb96b0f0c057aafb1cc81c159fc8def48 | grsakea/kappastat,grsakea/kappastat,grsakea/kappastat | frontend/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage auth\n\nimport (\n\t\"testing\"\n)\n\nfunc TestHeaderParsing(t *testing.T) {\n\t// Basic admin:password\n\tauthorization := \"Basic YWRtaW46cGFzc3dvcmQ=\"\n\n\tauth, err := parseAuthHeader(authorization)\n\tif err != nil {\n\t\tt.Error(... | go | edit | 6 | 4 | apache-2.0 | fb338508543ef3ccda74cd20e7ca4c39e1b64de2 | AaronO/go-git-http | auth/basicauth_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n)\n\ntype UserID struct {\n\tUserID string\n\tTeamID string\n}\n\ntype SecureID struct {\n\tHashSum string\n}\n\n/*\nNotice that user IDs are not guaranteed to be globally uniq... | go | edit | 0 | 2 | mit | 27892f4de804fb5a49c08e20ebff8074d1b56281 | kayex/sirius | slack/id.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage transcode\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\t// ErrInvalidCodec is returned when an invalid transcoder codec is selected\n\tErrInvalidCodec = errors.New(\"transcode: no such transcoder codec\")\n\t// ErrInvalidQuality is returned ... | go | edit | 6 | 2 | mit | 2129e4d7cbd99ad640258ac1809f9dc6ea7adf40 | mdlayher/wavepipe,mdlayher/wavepipe | transcode/transcode.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Challenge 31 - Implement and break HMAC-SHA1 with an artificial timing leak\n// http://cryptopals.com/sets/4/challenges/31\n\npackage cryptopals\n\nimport (\n\t\"crypto/sha1\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype challenge32 struct {\n}\n\... | go | edit | 0 | 5 | mit | f27a30eaf599d08d681ddccab89e88ec8ad97a9d | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge32.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n\tList of all task types.\n*/\n\npackage task_types\n\nimport (\n\t\"go.skia.org/infra/ct/go/ctfe/admin_tasks\"\n\t\"go.skia.org/infra/ct/go/ctfe/capture_skps\"\n\t\"go.skia.org/infra/ct/go/ctfe/chromium_analysis\"\n\t\"go.skia.org/infra/ct... | go | edit | 0 | 1 | bsd-3-clause | 8bce574cbba60f3412fc4f4a86d768bac077ac69 | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | ct/go/ctfe/task_types/task_types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"os\"\n \"io/ioutil\"\n \"github.com/hashicorp/hcl/json/parser\"\n \"github.com/hashicorp/hcl/hcl/printer\"\n)\n\nfunc main() {\n input, _ := ioutil.ReadAll(os.Stdin)\n\n ast, err := parser.Parse([]byte(input))... | go | edit | 0 | 4 | mit | 026d0d2b73b4fde694c4e4430c70dc905078b921 | kvz/json2hcl | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\nfunc TestDB() *gorm.DB {\n\tdbuser, dbpwd, dbname := \"qor\", \"qor\", \"qor_test\"\n\n\tif ... | go | edit | 0 | 4 | mit | 6c94975cd3f560e1a2dbd8ee1d0b4180964852f9 | qor/qor,qor/qor,qor/qor | test/utils/test_db.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage request\n\nimport (\n\t\"github.com/franela/goblin\"\n\t\"testing\"\n)\n\nfunc Test(t *testing.T) {\n\tg := goblin.Goblin(t)\n\n\tg.Describe(\"Get\", func() {\n\t\tg.It(\"Errors when connection refused\", func() {\n\t\t\t_, err := Get(\... | go | edit | 3 | 1 | mit | ea12a4c8c3d5fb880ab81c6cd169aba63732b536 | BrettBukowski/how | src/how/request/request_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 the u-root 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 sh\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc RunOrDi... | go | edit | 0 | 2 | bsd-3-clause | 7a6716f4ed3bb908d58443e7d9c5b24c648a5ab4 | GanShun/u-root,hugelgupf/u-root,GanShun/u-root,hugelgupf/u-root,u-root/u-root,u-root/u-root,hugelgupf/u-root,GanShun/u-root,hugelgupf/u-root,u-root/u-root | pkg/sh/run.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\trouter := NewRouter()\n\n\tlog.Fatal(http.ListenAndServe(\":80\", router))\n}\n\n```\n\nApply this change: Support specifying port as command-line flag on startup"
},
... | go | edit | 3 | 3 | mit | 00297b35c0c433e7caf3502c5402343e2812482b | bjschafer/easy-notifier | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright 2016 Frank Wessels <<EMAIL>>\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 | 3 | 3 | apache-2.0 | c18a27791884dbf069c1c6430562eec8fda4b345 | s3git/s3git-go | util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016-2021 terraform-provider-sakuracloud 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 Licens... | go | edit | 0 | 3 | apache-2.0 | 16be18d7f439e5fd87e121fa370a36eb4e229f1e | sacloud/terraform-provider-sakuracloud,sacloud/terraform-provider-sakuracloud | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 the <project> 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 \"fmt\"\n\nfunc main() {\n\tsum := 0\n\tfor i := 1;... | go | edit | 0 | 4 | mit | eb319d5b5bfc48cb685fafe5bd060d4ef3d90bbf | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | Problem001/Go/solution_1.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc handleMessages(in <-chan Message) {\n\tfor {\n\t\tmsg := <-in\n\t\tfmt.Println(\"Got message\\n\", msg, \"\\n\")\n\t}\n}\n\nfunc main() {\n\tmessages := make(chan Message)\n\tserver := NewServer(me... | go | edit | 9 | 2 | mit | bf8a83a8dfa78e23c84ed1af8c3171aa31a05d42 | StratumSecurity/gosmtpd | main.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\"io/ioutil\"\n\n\t\"github.com/cloudfoundry-incubator/candiedyaml\"\n)\n\ntype RoutingAPIConfig struct {\n\tURI string `yaml:\"uri\"`\n\tPort int `yaml:\"port\"`\n\tAuthDisabled bool `yaml:\"... | go | edit | 3 | 2 | apache-2.0 | 52b06cdbe50bde89870b3a4419798449f04dea0c | cloudfoundry-incubator/cf-tcp-router,cloudfoundry-incubator/cf-tcp-router | config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage search\n\nimport \"testing\"\n\nfunc TestSubset(t *testing.T) {\n\tvar (\n\t\ta = &Asset{\n\t\t\tVideoID: \"video-id-123\",\n\t\t\tType: \"movie\",\n\t\t}\n\n\t\ts = &Series{\n\t\t\tBrandID: \"brand-id-345\",\n\t\t\tType: \"series... | go | edit | 0 | 3 | mit | ce830bb82e53fac191204c9027159a8179cea253 | TV4/search-go | response_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metastore\n\nimport \"github.com/deejross/dep-registry/models\"\n\n// MetaStore represents a metadata store.\ntype MetaStore interface {\n\t// AddUpdateImport adds or updates an Import.\n\tAddUpdateImport(m *models.Import) error\n\n\t//... | go | edit | 0 | 0 | apache-2.0 | 7bc14ca50665ba407c83c9ee7552ce58efc5b411 | deejross/dep-registry | metastore/metastore.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gopass\n\nimport (\n\t\"os\"\n)\n\n// getPasswd returns the input read from terminal.\n// If masked is true, typing will be matched by asterisks on the screen.\n// Otherwise, typing will echo nothing.\nfunc getPasswd(masked bool) []byte... | go | edit | 3 | 9 | isc | 2c70fa70727c953c51695f800f25d6b44abb368e | keybase/gopass,howeyc/gopass,yp-engineering/gopass | pass.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016-2019 The Libsacloud 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// ... | go | edit | 9 | 0 | apache-2.0 | 65107264ff7d46eabb8cc34eb4a763a7b4f74b19 | sacloud/libsacloud | sacloud/types/vpc_router_plan.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"github.com/materials-commons/mcstore/pkg/db/schema\"\n)\n\n// Groups is a default model for the usergroups table.\nvar Groups = &rModel{\n\tschema: schema.Group{},\n\ttable: \"usergroups\",\n}\n\n// Users is a de... | go | edit | 9 | 0 | mit | d12f0ece30d18923c7a4ed858036e003de27cb3c | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | pkg/db/model/models.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\"os\"\n\n\t\"github.com/Cepave/open-falcon-backend/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 | 2c0a355ba4328baae3e266d06f2b29c9efff996e | Cepave/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,masato25/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,masato25/open-falcon-backend,masato25/open... | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/couchbaselabs/sgload/cmd\"\n\nfunc main() {\n\tcmd.Execute()\n}\n\n```\n\nApply this change: Add expvar endpoint to all sgload commands"
},
{
"role": "assistant",
"content": "package main\n\nimpor... | go | edit | 0 | 1 | apache-2.0 | 286e0c5e776e9eaaa294b07ffeae832a2117195e | couchbaselabs/sgload | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage compiler\n\ntype Expression struct {\n\tName Translatable\n\tOnScan func(*Compiler) Type\n\t\n\tDetect func(*Compiler) *Type\n}\n\nfunc (c *Compiler) scanExpression() Type {\n\tvar token = c.Scan()\n\t\n\tfor _, expression := range c.Ex... | go | edit | 18 | 6 | bsd-3-clause | e90afb69db7362966deb69251c240bc33609f97b | Qlova/uct | compiler/expression.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\"github.com/solidfire/solidfire-docker-driver/sfapi\"\n\t\"github.com/solidfire/solidfire-docker-driver/sfcli\"\n\t\"os\"\n)\n\nconst (\n\tVERSION = \"1.0.0\"\n)\n\nvar (\n\tclient *sfapi.Client\n)\n\nfunc main() {\... | go | edit | 0 | 1 | apache-2.0 | 2b740d65f865a64a0dc206fec4d7dd83c46b2c43 | ebalduf/solidfire-docker-driver,solidfire/solidfire-docker-driver,ebalduf/solidfire-docker-driver,solidfire/solidfire-docker-driver | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright (c) 2014 PolyFloyd\n */\n\npackage main\n\nimport \"flag\"\n\nconst (\n\tINFO = \"PolyFloyd's LEDCube Simulator v0.1\"\n\tUI_DETAIL int = 2\n\tUI_DRAGDIV float32 = 240.0\n\tUI_FOVY float32 = 45.0\n\tUI_SPACING ... | go | edit | 9 | 1 | mit | f1d57e261b00512dde2c576087ed56b9e621342a | PolyFloyd/ledcubesim,PolyFloyd/ledcubesim,PolyFloyd/ledcubesim | main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package throttled implements various helpers to manage the lifecycle of goroutines.\npackage throttled\n\n// WaitGroup limits the number of concurrent goroutines.\ntype WaitGroup struct {\n\tthrottle int\n\tcompleted chan bool\n\toutsta... | go | edit | 0 | 4 | mit | 2f13ce1b0cd23ff8c58de126e3df4c79521bbfa4 | suicidejack/throttled | wait_group.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage editor\n\nimport (\n\t\"context\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc BenchmarkNormal(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tcommand := \"hjkl\"\n\t\ted := normal{\n\t\t\tstreamSet: streamSet{in: NewReaderContext(contex... | go | edit | 0 | 4 | mit | 1bc31ba8bdc52281d7945a34f579ec7fd53640f5 | elpinal/coco3 | editor/normal_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mint\n\nimport (\n\t\"os\"\n\n\t\"github.com/bouk/monkey\"\n)\n\n// Exit ...\nfunc (testee *Testee) Exit(expectedCode int) Result {\n\n\tfun, ok := testee.actual.(func())\n\tif !ok {\n\t\tpanic(\"mint error: Exit only can be called for ... | go | edit | 9 | 2 | mit | 8151274669299c20b45d5199f7fde456181b711e | otiai10/mint | exit.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this... | go | edit | 12 | 2 | apache-2.0 | c4407ea562bc6f470826988cc30b76c315b07a90 | upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift | lib/go/thrift/binary_protocol_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/prometheus/client_golang/prometheus\"\n\t\"github.com/siebenmann/go-kstat\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc collectARCstats() {\n\tlog.Debugf(\"Start collecti... | go | edit | 3 | 6 | apache-2.0 | 38d98b5520be54d8af491557271c460cc22553c2 | ingrians/smartos_exporter,ingrians/smartos_exporter | main.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.