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": "Write go code for the following: Add test imports in non-test code so that `go get` picks them up"
},
{
"role": "assistant",
"content": "// Package src scans directory trees for source code packages.\npackage srcscan\n\n// test imports\nimport _ \"github.com/kr/pret... | go | new_file | 0 | 0 | apache-2.0 | 4e43283f7bfeb7ef72a8f8b90f783e7a9c1f837a | sourcegraph/srcscan,sourcegraph/srcscan,sourcegraph/srcscan,sourcegraph/srcscan,sourcegraph/srcscan | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\t. \"github.com/onsi/gomega\"\n)\n\nfunc TestNewURL(t *testing.T) {\n\thttpsUrl, err := NewURL(\"https://github.com/motemen/pusheen-explorer\")\n\tExpect(httpsUrl.String()).To(Equal(\"https://github.com... | go | edit | 18 | 1 | mit | 4956392c4712001e408e5c7136935928d271ebd5 | motemen/ghq,jmatsu/ghq_ss,ngtk/ghq,maoe/ghq,motemen/ghq,skatsuta/ghq,uetchy/ghq,motemen/ghq | url_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\nfunc TestFlagC(t *testing.T) {\n\tvar in, out, err bytes.Buffer\n\tc := CLI{\n\t\tIn: &in,\n\t\tOut: &out,\n\t\tErr: &err,\n\t}\n\targs := []string{\"-c\", \"echo aaa\"}\n\tcode := c.Ru... | go | edit | 6 | 4 | mit | 0a555a58599f797896fc056c3594b8491430d082 | elpinal/coco3 | cli/cli_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build darwin freebsd linux netbsd openbsd\n\npackage flags\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\ntype winsize struct {\n\tws_row, ws_col uint16\n\tws_xpixel, ws_ypixel uint16\n}\n\nfunc getTerminalColumns() int {\n\tws := win... | go | edit | 3 | 1 | bsd-3-clause | 412dcc0e30ce3e137a67f445a9095ecd4bf1c190 | jessevdk/go-flags,cmars/tools,svent/go-flags,FactomProject/go-flags,cmars/tools,sourcegraph/go-flags,FactomProject/go-flags,fuchsia-mirror/third_party-github.com-jessevdk-go-flags,svent/go-flags,fuchsia-mirror/third_party-github.com-jessevdk-go-flags,sysbot/go-flags,zenoss/go-flags,abates/go-flags,abates/go-flags,sourc... | convert_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 CodeIgnition. All rights reserved.\n// Use of this source code is governed by a BSD\n// license that can be found in the LICENSE file.\n\npackage policy\n\nimport \"time\"\n\n// Event data that will be sent by policy handlers\... | go | edit | 0 | 0 | bsd-3-clause | cb3c4850ebe99eee538102eb2c4be7176a757811 | codeignition/recon | policy/event.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage types\n\nconst (\n\tZigbeeCertificationType string = \"zigbee\"\n\tMatterCertificationType string = \"matter\"\n)\n\n//\tList of Certification Types\ntype CertificationTypes []string\n\nvar CertificationTypesList = CertificationTypes{Zi... | go | edit | 0 | 3 | apache-2.0 | e7202dfdf5a641950ee33bce0c74d07614d7b78e | zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger | x/compliance/types/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jobs\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/Yu-taro/taue/taue/models\"\n)\n\nfunc postSlack(users []models.User) {\n\twebHookURL := \"https:... | go | edit | 0 | 3 | apache-2.0 | 497a75db113b61645385c0bcaeab3d096696b313 | Yu-taro/taue | taue/jobs/slack_reporter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"crypto\"\nimport \"strings\"\n\n// Checksum algos\nimport (\n _ \"crypto/md5\"\n _ \"crypto/sha1\"\n _ \"crypto/sha256\"\n _ \"crypto/sha512\"\n)\n\n// Man, why don't people allow their table to be exported.... | go | edit | 6 | 3 | mit | 00b0502150bcbf6b50a6fd0695f0f8df03ebd790 | kormoc/bitrot-scanner | filterChecksumAlgos.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"encoding/json\"\n \"fmt\"\n \"os\"\n)\n\nfunc parseObj(in interface{}, out map[string]interface{}, prefix string) {\n switch vv := in.(type) {\n case map[string]interface{}:\n for key, value :=... | go | edit | 0 | 8 | mit | 1d12f0c27539db3aebfff890e21259f57dff6ae8 | stilvoid/buggy | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\n\t\"github.com/hackebrot/turtle\"\n)\n\n// JSONWriter writes Emojis as JSON\ntype JSONWriter struct {\n\te *json.Encoder\n}\n\n// NewJSONWriter creates a new JSONWriter\nfunc NewJSONWri... | go | edit | 0 | 3 | mit | 72babd93910d2458ce8764451125e6642149392c | hackebrot/turtle | cmd/turtle/writer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n)\n\ntype Configuration struct {\n\tUsername string `json:\"username\"`\n\tPassword string\n\tRememberMe bool `json:\"remember_me\"`\n}\n\nfun... | go | edit | 3 | 4 | mit | b573d5ad08cfc3a909d62aa9464bfdc4b97c452a | adrien-f/gotify | config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package logrusadapter provides a logger that writes to a github.com/sirupsen/logrus.Logger\n// log.\npackage logrusadapter\n\nimport (\n\t\"github.com/jackc/pgx\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Logger struct {\n\tl *logrus.Logg... | go | edit | 0 | 7 | mit | 4dea6c902e54088f52b6ef59a4c382d125cce060 | jackc/pgx,silviucm/pgx,silviucm/pgx,plopik/pgx,plopik/pgx,jackc/pgx,jackc/pgx,silviucm/pgx,plopik/pgx,jackc/pgx | log/logrusadapter/adapter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"http\"\n)\n\n// support for running \"redwood -test http://example.com\"\n\n// runURLTest prints debugging information about how the URL and its content would be rated.\nfunc runURLTest(u string) {\n\tur... | go | edit | 0 | 10 | bsd-2-clause | 9e5c624a5635e3b60623bbf033ebe13de6dc5733 | andybalholm/redwood,vishnuvaradaraj/redwood,yinheli/redwood-filter,unixabg/redwood,vishnuvaradaraj/redwood,unixabg/redwood,andybalholm/redwood,yinheli/redwood-filter,yinheli/redwood-filter,vishnuvaradaraj/redwood | testmode.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Func: Add basic test for calculating signature"
},
{
"role": "assistant",
"content": "package signature\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"testing\"\n)\n\nconst testTs = \"1544544948\"\nconst testQp = \"abc=foo&def=... | go | new_file | 3 | 3 | bsd-2-clause | b38424b6f1c08cbec2416918169f2b3323cb78c7 | messagebird/go-rest-api | signature/signature_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pipeline\n\nimport (\n\t\"time\"\n)\n\n// TimingPipe invokes a custom callback function with the amount of time required to run a specific Pipe\ntype TimingPipe struct {\n\ttimedPipe Pipe\n\tcallback func(begin time.Time, duration time... | go | edit | 18 | 2 | mit | 21dc5cf2e69cf2eac66ec3f0e1e1b2ab13380623 | skidder/pipeline | timing_pipe.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add basic test for generated track\n\nWe generated a track that had 25_DEG_UP followed by 3 tile flat left turn,\nwhich shouldn't be possible. Adds a test that rules out that possibility in one\nplace in the codebase."
},
{
"role": "assi... | go | new_file | 0 | 4 | mit | a5b2b56c52161d152b62d2fff84fe5089cb5099f | kevinburke/rct,kevinburke/rct,kevinburke/rct,kevinburke/rct | tracks/segmentfns_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tricks_test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/aviddiviner/tricks\"\n)\n\nvar animals = []string{\"dog\", \"cat\", \"bear\", \"cow\", \"bull\", \"pig\", \"iguana\"}\n\nfunc ExampleSlice() {\n\tbearCow := tricks.Slic... | go | edit | 0 | 1 | mit | adedb81854fbe6263e409bb510947b39331d39a0 | aviddiviner/tricks | example_test.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/nsf/termbox-go\"\n)\n\ntype Lesser struct {\n\tfile *os.File\n}\n\nfunc (l Lesser) Run() {\n\tfor {\n\t\te := termbox.PollEvent()\n\t\tswitch e.Type {\n\t\tcase termbox.EventKey:\n\t\t\tswitc... | go | edit | 6 | 4 | mit | 91baf8de9889ed5053fcff1202c09233a0a0ebd2 | prattmic/lesser | lesser.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\"flag\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\n\t\"github.com/localhots/satan\"\n\t\"github.com/localhots/satan/example/daemons\"\n)\n\nfunc main() {\n\tvar debug bool\n\tflag.BoolVar(&debug, \"v\... | go | edit | 0 | 2 | mit | 86c1b4254099d44ab9e9b7afe228d0aa074b6512 | 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 core\n\nimport (\n\t\"github.com/akutz/gofig\"\n)\n\nfunc init() {\n\tinitDrivers()\n\tgofig.Register(globalRegistration())\n\tgofig.Register(driverRegistration())\n}\n\nfunc globalRegistration() *gofig.Registration {\n\tr := gofig.NewR... | go | edit | 3 | 1 | apache-2.0 | c8f432d96a4c035b1036143874600a53ff9006e0 | oppodeldoc/rexray,emccode/rexray,oppodeldoc/rexray,codedellemc/rexray,thecodeteam/rexray,clintonskitson/rexray,emccode/rexray,akutz/rexray,oppodeldoc/rexray,oppodeldoc/rexray,clintonskitson/rexray,oppodeldoc/rexray,thecodeteam/rexray,thecodeteam/rexray,clintonskitson/rexray,oppodeldoc/rexray,cduchesne/rexray,cduchesne/... | core/core.go | rejected_duplicate | Near-duplicate of sample 118340 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/ligato/networkservicemesh/nsmdp\"\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n)\n\nfunc main() {\n\tlog.Println(\"Starting NSM\")\n\n\tdp := nsmdp.NewNSMDevicePlugin()\n\tdp.Serve()\n\n\tsigCha... | go | edit | 0 | 1 | apache-2.0 | b6b82dc2bf009343b5210728f5ff9a201ee963b6 | networkservicemesh/networkservicemesh,networkservicemesh/networkservicemesh,networkservicemesh/networkservicemesh,networkservicemesh/networkservicemesh | cmd/nsm/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 <chaishushan{AT}gmail.com>. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build ignore\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"code.... | go | edit | 9 | 1 | bsd-3-clause | 9ff243e677d44894259071b75222d9eb37a253f2 | chai2010/gettext-go | gettext/hello.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\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\ntype Config struct {\n\tConfigFile string\n\tPaths map[string]string\n}\n\nfunc (c *Config) readConfig() error {\n\tc.Paths = make(map[string]string)\n\n\tfi... | go | edit | 6 | 4 | mit | 9c195e0ab9de746af9602c88ca7f9f95580f3ec6 | dmcbane/curd,dmcbane/curd | config/config.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport \"math\"\n\nfunc IsPrime(num int) bool {\n\tfloatNum := float64(num)\n\tfor i := 2; i <= int(math.Floor(math.Sqrt(floatNum))); i++ {\n\t\tif num%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n```\n\nApply ... | go | edit | 0 | 5 | mit | fbe3145728ced5e18f3c139446c1208fd805670a | rafax/goeuler | utils/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage uploader\n\nimport (\n\t\"github.com/matthew-andrews/s3up/objects\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype stubS3Client struct{}\n\nfunc (stub stubS3Client) UploadFile(string, objects.File) error {\n\ttime.Sleep(50 * time.Millisecond)\n\... | go | edit | 6 | 2 | mit | 90e787723d4efbc080f0491e18a205f964c47326 | matthew-andrews/s3up | uploader/uploader_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage iam\n\nimport (\n\t\"github.com/jagregory/cfval/constraints\"\n\t. \"github.com/jagregory/cfval/schema\"\n)\n\n// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html\nvar AccessKey = Reso... | go | edit | 0 | 0 | mit | f5babce21c18273d9c71a4d3b2f19d63e61005f1 | jagregory/cfval,jagregory/cfval | resources/iam/access_key.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*Package consts implements constants for the entire project\n */\npackage consts\n\n// ConfigurationFileName is the configuration file name of Goyave\nconst ConfigurationFileName = \".goyave\"\n\n// GitFileName is the name of the git directory... | go | edit | 0 | 0 | mit | 162c6afaa4d6d08e83e46d7e85acfad2be69ff53 | k0pernicus/goyave | consts/consts.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli_test\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc TestShowAppHelp(t *testing.T) {\n\toutput := new(bytes.Buffer)\n\tapp := cli.NewApp()\n\tapp.Writer = output\n\n\tc := cli.NewContext(app, n... | go | edit | 0 | 2 | mit | f952f5ac6f80d952248256b1061334bca89036c9 | minio/cli,jgeewax/cli,minio/cli,minio/cli,murdinc/cli,cmars/tools,pjvds/cli,txgruppi/cli,murdinc/cli,squillace/cli,cmars/tools,pjvds/cli,nodirt/cli,oiooj/cli,klueska/cli,DirtyHairy/cli,codegangsta/cli,DirtyHairy/cli,keybase/cli,squillace/cli,masterlink720/cli,w4ngyi/cli,motain/cli,ykanda/cli,klueska/cli,jgeewax/cli,key... | help_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage channels\n\nimport \"testing\"\n\nfunc TestInfiniteChannel(t *testing.T) {\n\tvar ch Channel\n\n\tch = NewInfiniteChannel()\n\ttestChannel(t, \"infinite channel\", ch)\n\n\tch = NewInfiniteChannel()\n\ttestChannelPair(t, \"infinite chan... | go | edit | 18 | 3 | mit | 2938f8ee621c3005cbd98935150212a565ce38b1 | jonahglover/channels,eapache/channels | infinite_channel_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tests\n\nimport (\n\t\"fmt\"\n\tnetworking \"git.cyberdust.com/radicalapp/go-networking\"\n\t\"testing\"\n)\n\nfunc TestGetConnection(t *testing.T) {\n\turlString := \"https://jsonplaceholder.typicode.com/posts\"\n\tparams := networking... | go | edit | 0 | 1 | mit | 7d9f5aa81dfdb68cc5e5a82c3b51f40c10fcce03 | RadicalApp/go-networking | tests/connection_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage meta\n\n// CueSheet contains the track information of a cue sheet.\n//\n// https://www.xiph.org/flac/format.html#metadata_block_cuesheet\ntype CueSheet struct{}\n\n```\n\nApply this change: meta: Add CueSheet, CueSheetTrack and CueSheet... | go | edit | 0 | 0 | unlicense | 0194aff9e0cae475df41f9d4bd4b650e630ce65f | mewkiz/flac | meta/cuesheet.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net\"\n\t\"os\"\n)\n\nfunc handleConnection(conn net.Conn) {\n\tconnection := NewConnection(conn)\n\tdefer connection.Close()\n\tconnection.Handle()\n}\n\nfunc acceptedConnsChannel(listener net.Listener) chan net.C... | go | edit | 15 | 3 | mit | 55150389a7df5078332274f7a042f835a3da7d9c | film42/turbulence | turbulence.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scipipe\n\nimport (\n\t// \"github.com/go-errors/errors\"\n\t//\"os\"\n\t\"os\"\n\t\"os/exec\"\n\tre \"regexp\"\n)\n\nfunc ExecCmd(cmd string) string {\n\tInfo.Println(\"Executing command: \", cmd)\n\tcombOutput, err := exec.Command(\"b... | go | edit | 12 | 2 | mit | fa33810efaf76a30f8426f5001a217fc04f86782 | scipipe/scipipe,scipipe/scipipe,samuell/scipipe | utils.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\r\n\r\nimport (\r\n\t\"io\"\r\n\t\"log\"\r\n\t\"os\"\r\n\t\"os/exec\"\r\n\t\"time\"\r\n)\r\n\r\nfunc runner(what string) {\r\n\tf, err := os.OpenFile(\"testlogfile\", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)\r\n\tif err != nil {\r\... | go | edit | 0 | 3 | mit | 08c9e67dfb30d14fb5346e958ddf68b7223d8e84 | elezar/go-faster,elezar/go-faster | prototype/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/nsf/termbox-go\"\n)\n\nfunc MaybePanic(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nvar (\n\tQuit chan struct{}\n\tRedraw chan struct{}\n)\n\nfunc main() {\n\tflag.... | go | edit | 27 | 2 | mit | c5cd9c7ed6f0e13b7c7b843d50311f72bcea6759 | chrisseto/Sux | sux.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux,!darwin\n\npackage loadavg\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n)\n\nfunc LoadAvg() ([3]float64, error) {\n\treturn [...]float64{-1, -1, -1}, fmt.Errorf(\"loadavg: unsupported platform %q\", runtime.GOOS)\n}\n\n```\n\nApply t... | go | edit | 0 | 1 | bsd-2-clause | 7e344772ede68f7cb8b2dbda8be81ac3dd251436 | davecheney/loadavg | loadavg_stub.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nvar sourceURITests = []struct {\n\tsrc string\n\tdst string\n}{\n\t{\n\t\t\"https://github.com/sunaku/vim-unbundle\",\n\t\t\"https://github.com/sunaku/vim-unbundle\",\n\t},\n}\n\nfunc TestSourceURI(... | go | edit | 3 | 4 | mit | 20eb61f2d513968ae7c916473f377f537f2fc19c | kusabashira/vub | package_test.go | rejected_duplicate | Near-duplicate of sample 118583 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tumblr\n\nimport (\n\t\"encoding/json\"\n)\n\n// Blog Info\nfunc (blog Blog) Info() (*BlogInfo, error) {\n\turl, err := blog.blogEntityURL(\"info\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata, err := callAPI(url)\n\tvar v Blog... | go | edit | 3 | 1 | mit | f20d09acce7fdae6c6a9ac6c4596a90ec4b596b5 | hut8/tumblr-go | blog_info.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage regexp_test\n\nimport (\n\t\"github.com/Shopify/go-lua\"\n\t\"github.com/Shopify/goluago/regexp\"\n\t\"testing\"\n)\n\nfunc TestLuaRegexp(t *testing.T) {\n\tl := lua.NewState()\n\n\tlua.OpenLibraries(l)\n\tregexp.Open(l)\n\n\tfailHook :... | go | edit | 9 | 4 | mit | 1fa40f443b5aeb9204a6d0e63b2d1d1a46316e68 | Shopify/goluago,Shopify/goluago | regexp/luaregexp_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gohr\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"golang.org/x/crypto/ssh/terminal\"\n)\n\n// getWidth gets number of width of terminal from crypto subdirectory ssh/terminal\nfunc getWidth() (int, error) {\n\tw, _, err := terminal... | go | edit | 0 | 6 | mit | e5756de03d7c5d651cdb9013b749e40e1a561716 | hasit/gohr | gohr.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\trat \"github.com/ericfreese/rat/lib\"\n\tflag \"github.com/spf13/pflag\"\n)\n\nvar (\n\tRatVersion = \"0.0.2\"\n)\n\nvar flags struct {\n\tcmd string\n\tmode string\... | go | edit | 0 | 5 | mit | 674cfed2ec1f4f196760464d42a7c3b72f7aa197 | ericfreese/rat,ericfreese/rat | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\n\t\"github.com/bsphere/le_go\"\n\t\"github.com/emreler/finch/config\"\n)\n\n// Logger .\ntype Logger struct {\n\tconn *le_go.Logger\n}\n\n// NewLogger .\nfunc NewLogger(token config.... | go | edit | 0 | 2 | mit | eb88e3d88f3402a2373f83feae265d276d57aac3 | emreler/finch,emreler/finch | logger/logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n \"net/http\"\n \"fmt\"\n)\n\nvar AboutPath = \"/about/\"\n\nfunc AboutHandler(w http.ResponseWriter, r *http.Request) {\n fmt.Fprintf(w, \"About, %s!\", r.URL.Path[1:])\n}\n\n```\n\nApply this change: Add send json... | go | edit | 3 | 2 | apache-2.0 | 47d1899c4c5b8eaf3899d7131c7bc1a5e811098a | mwharris1313/goapi,mwharris1313/goapi,mwharris1313/goapi | api/about.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Hajime Hoshi\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apa... | go | edit | 3 | 2 | apache-2.0 | 3619a796dc015f673260575a1910b31bb924ebc8 | hajimehoshi/ebiten,hajimehoshi/ebiten | internal/ui/ui_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vaultutil\n\nimport (\n\tvaultapi \"github.com/hashicorp/vault/api\"\n)\n\nfunc GetGroups(c *vaultapi.Client) (*vaultapi.Secret, error) {\n\tresp, err := c.Logical().List(\"auth/ldap/groups\")\n\tif err != nil {\n\t\treturn resp, err\n\... | go | edit | 0 | 2 | apache-2.0 | 8db782f83c1e97472e09b7e4dc1639eed65f98fd | gobins/vaultutil | ldap.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slackapi\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc CheckResponse(t *testing.T, x interface{}, y string) {\n\tout, err := json.Marshal(x)\n\tif err != nil {\n\t\tt.Fatal(\"json fromat;\", err)\n\t}\n\tif string(out) != y... | go | edit | 3 | 3 | mit | 09f9059971da62e8e8716ce7c80707884a8e3002 | cixtor/slackapi | slackapi_test.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/containerd/containerd/log\"\n\t\"github.com/urfave/cli\"\n)\n\nvar pullCommand = cli.Command{\n\tName: \"pull\",\n\tUsage: \"pull an image from a remote\",\n\tArgsUsage: \"[flags] <... | go | edit | 0 | 0 | apache-2.0 | 14fe2d5f2026f28eb99e1f14c91343981618a714 | crosbymichael/containerd,mikebrow/containerd,kunalkushwaha/containerd,AkihiroSuda/containerd,mikebrow/containerd,vdemeester/containerd,crosbymichael/containerd,vdemeester/containerd,containerd/containerd,kunalkushwaha/containerd,dmcgowan/containerd,containerd/containerd,estesp/containerd,miaoyq/containerd,thaJeztah/con... | cmd/ctr/pull.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Google Inc. All Rights Reserved.\n// This file is available under the Apache license.\n\npackage errors\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/google/mtail/internal/vm/position\"\n\t\"github.com/pkg/errors\"\n)\n\ntype compi... | go | edit | 0 | 4 | apache-2.0 | f10c846ab60d234aa449c042068ce461b2f6ed9a | SuperQ/mtail,google/mtail,google/mtail,SuperQ/mtail | internal/vm/errors/errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage websocket\n\nimport(\n \"net/http\"\n \"log\"\n \"github.com/gorilla/websocket\"\n)\n\nvar upgrader = websocket.Upgrader{\n CheckOrigin: func(r *http.Request) bool {\n return true\n },\n}\n\ntype WebSocketHandler s... | go | edit | 0 | 1 | bsd-3-clause | 4e9c8d2907b38876ee935cc4d48001e8269d9fd4 | ipastushenko/simple-chat | server/controllers/websocket/handler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack9gag\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc init() {\n\thttp.HandleFunc(\"/\", handler)\n\tfmt.Println(\"listening...\")\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\t// Read the Request Parameter \"com... | go | edit | 0 | 2 | mit | 539fdb752f5cd88f5b1d12f6892adf722fe24786 | jayeshsolanki93/slack9gag | slack9gag.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/bgv/workerpool\"\n)\n\nfunc main() {\n\t// Number of workers, and Size of the job queue\n\tpool := workerpool.New(10, 50)\n\t// Release the resources after we finish\n\tdefer poo... | go | edit | 0 | 2 | mit | 6e54d481b21c3f91953456c10de9f75a1bce7926 | bgv/workerpool | _example/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc CallBrowser(url string) error {\n\tfmt.Fprintf(os.Stderr, \"Running a browser to open %s...\\r\\n\", url)\n\n\tvar attr os.ProcAttr\n\tattr.Sy... | go | edit | 3 | 3 | mit | 09bb70a91fca004f8266151bdfcb2f8a7abed691 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmds/util/callbrowser_windows.go | rejected_duplicate | Near-duplicate of sample 117887 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage device\n\nimport (\n\t\"sync\"\n\n\t\"github.com/tarm/serial\"\n)\n\ntype Manager struct {\n\tdevices map[string]serial.Config\n\tmu sync.RWMutex\n}\n\nfunc (m *Manager) AddDevice(name string) error {\n\tcfg := serial.Config{Name: ... | go | edit | 0 | 2 | mit | 8a07b4ba433f108fbcc5b3f8732c67a50d527278 | FarmRadioHangar/fessboxconfig,FarmRadioHangar/fessboxconfig | device/device.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage parser\n\nfunc ParseInstruction(instruction string) ([]Instruction, error) {\n\n\tl := lexer{}\n\ttokens, err := l.lex([]byte(instruction))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp := parser{}\n\tinstructions, err := p.parse(... | go | edit | 0 | 4 | bsd-3-clause | 6fdfddc8784b517b5a0e3ed71d7b2df25028ae35 | proullon/ramsql,mlhoyt/ramsql | engine/parser/interface.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/ehazlett/interlock/plugins\"\n\t\"github.com/samalba/dockerclient\"\n)\n\ntype (\n\tEventHandler struct {\n\t\tManager *Manager\n\t}\n)\n\nfunc NewEvent... | go | edit | 6 | 1 | apache-2.0 | c4544aef06a17f5d368db08118c747a31f2f53c0 | mbentley/interlock,aerospike/interlock,wr0ngway/interlock,vixns/interlock,mbentley/interlock,krishamoud/interlock,ehazlett/interlock,krishamoud/interlock,everett-toews/interlock,everett-toews/interlock,aerospike/interlock,vixns/interlock,wr0ngway/interlock | interlock/handler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright IBM Corp. 2016 All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\t\t http://www... | go | edit | 0 | 1 | apache-2.0 | 130f896e2e3ca78e01794a174382e547ba23adc0 | muralisrini/fabric,xixuejia/fabric,xixuejia/fabric,hyperledger/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric,manish-sethi/fabric,binhn/fabric,jimthematrix/fabric,stemlending/fabric,muralisrini/fabric,manish-sethi/fabric-sidedb,jimthematrix/fabric,stemlending/fabric,manish-sethi/fabric-sidedb,muralisrini/fabric,... | core/ledger/kvledger/pkg_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Eleme Inc. All rights reserved.\n\npackage metric\n\n// Metric with name and value\ntype Metric struct {\n\tName string // metric name\n\tStamp uint32 // metric timestamp (able to use for 90 years from now)\n\tValue floa... | go | edit | 0 | 1 | mit | 1038cc56ae8b5bc51c6cafbbb85d5dea3822609b | facesea/banshee,eleme/banshee,facesea/banshee,eleme/banshee,facesea/banshee,facesea/banshee,eleme/banshee,eleme/banshee,eleme/banshee | metric/metric.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sofa\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n)\n\n// FutonURL attempts to correctly convert any CouchDB path into a URL to be used to\n// access the same documents through the Futon web GUI.\nfunc (con *Connection) FutonURL(path stri... | go | edit | 27 | 6 | mit | 0a8f980f31c1139e45048cf704fb57dd1b000681 | joelnb/sofa,joelnb/sofa | util.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"errors\"\n\t\"net/url\"\n)\n\ntype getExternalLinksResponse struct {\n\tStatusFeed *string `json:\"statusFeed,omitempty\"` // Location of the a JSON Feed for client's Status page News Feed\n\tCustomLinks []... | go | edit | 0 | 5 | mit | 3b76f82d47732f6d9378ade276b32a1488c01a7f | influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdata/i... | server/links.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage common\n\nimport (\n\tbosherr \"github.com/cloudfoundry/bosh-utils/errors\"\n)\n\ntype AgentOptions struct {\n\t// e.g. \"https://user:password@127.0.0.1:4321/agent\"\n\tMbus string\n\n\t// e.g. [\"0.us.pool.ntp.org\"]. Ok to be empty\n... | go | edit | 0 | 3 | apache-2.0 | da43f34f3d2a5b7417f72e36d0a137674a282764 | mattcui/bosh-softlayer-cpi-release,maximilien/bosh-softlayer-cpi,maximilien/bosh-softlayer-cpi,mattcui/bosh-softlayer-cpi-release,mattcui/bosh-softlayer-cpi-release,mattcui/bosh-softlayer-cpi-release | src/bosh-softlayer-cpi/softlayer/common/agent_options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage engine\n\nimport (\n\t\"archive/tar\"\n\t\"bytes\"\n\t\"io\"\n)\n\ntype Stream struct {\n\tio.ReadCloser\n\tSize int64\n}\n\nfunc NewStream(data io.ReadCloser, size int64) Stream {\n\treturn Stream{data, size}\n}\n\nfunc (s Stream) Out(... | go | edit | 0 | 3 | apache-2.0 | b63844bcb5922c6683451a392c732bd00f918d2b | sclevine/forge,sclevine/forge | engine/engine.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage io\n\ntype Reader interface {\n\tRead([]byte) (int, error)\n}\n\ntype Writer interface {\n\tWrite([]byte) (int, error)\n}\n\ntype ReadWriter interface {\n\tReader\n\tWriter\n}\n```\n\nApply this change: io: Add Closer, ReadCloser, Write... | go | edit | 0 | 0 | bsd-3-clause | 6355d3a293054747b3344a9fe4bf153e4c9cff34 | ziutek/emgo,ziutek/emgo,ziutek/emgo,ziutek/emgo | egroot/src/io/interfaces.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc hello(resp http.ResponseWriter, req *http.Request) {\n\tfmt.Fprintln(resp, \"<html><head><title>How about them apples?!</title></head><body><h1>\")\n\tfmt.Fprintln(resp, \... | go | edit | 3 | 2 | mit | b4039d9645e7c9479ab84427030da6e01acb7ed1 | jgastal/mural,jgastal/mural,jgastal/mural,jgastal/mural | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n)\n\nconst (\n\t// BtrfsCommand is the name of the btrfs command-line tool binary.\n\tBtrfsCommand = \"btrfs\"\n)\n\n// Snapshot creates a Btrfs snapshot of src at dst, optionally making\n// it... | go | edit | 0 | 4 | mit | 8bf0cb99cb56fa9d59f13fa48875d579215c6591 | DeedleFake/yabs | btrfs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n)\n\n// DecodeJSON decodes json\nfunc DecodeJSON(src io.Reader, dst interface{}) error {\n\tdecoder := json.NewDecoder(src)\n\terr := decoder.Decode(dst)\n\treturn err\n}\n\n// EncodeJSON... | go | edit | 0 | 1 | mit | b57a46492faa9cf590f0b41086e310a0c977537d | NaExpire/API | src/util/json.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage horizon\n\nimport (\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"github.com/stellar/go-horizon/test\"\n\t\"github.com/zenazn/goji/web\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc TestRootAction(t *testi... | go | edit | 12 | 1 | apache-2.0 | e39a4f111b95a17c5b40afe33771017a52a3f8cb | irisli/horizon,irisli/horizon,stellar/horizon,masonforest/go-horizon,nullstyle/go-horizon,masonforest/horizon,masonforest/go-horizon,FredericHeem/go-horizon,lackac/horizon,lackac/horizon,lackac/horizon,irisli/horizon,FredericHeem/go-horizon,masonforest/go-horizon,masonforest/horizon,stellar/horizon,nullstyle/go-horizon... | root_action_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"code.google.com/p/gcfg\" //Ref: http://code.google.com/p/gcfg/\n\t\"fmt\"\n\t\"os\"\n\t\"os/user\"\n)\n\ntype Config struct {\n\tAuth struct {\n\t\tAccessKey string\n\t\tSecretKey string\n\t}\n}\n\n//Get the config... | go | edit | 0 | 3 | bsd-3-clause | 06b4a129a7b0c469553182195721a97cf170e181 | codehill/s3upload | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestIsVersion2(t *testing.T) {\n\tworkingDir, _ := os.Getwd()\n\n\tv1FilePath := filepath.Join(workingDir, \"fixtures\", \"docker-compose-v1.yml\")\n\tv1ComposeFi... | go | edit | 9 | 3 | mit | 91d71c1963c50743d1dea5395c87561983171b97 | dtan4/paus-gitreceive,dtan4/paus-gitreceive,dtan4/paus-gitreceive,dtan4/paus-gitreceive | receiver/compose_file_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\ntype Word struct {\n\tRomaji string\n\tCommon bool\n\tDialects []string\n\tFields []string\n\tGlosses []Gloss\n\tEnglish []string\n\tEnglishHL []string // highlighted english\n\tFurigana string\n\tFuriga... | go | edit | 3 | 3 | mit | de7434595e538eaad5408277add41eef13b4a2d0 | shawnps/nihongo,gojp/nihongo,shawnps/nihongo,shawnps/nihongo,gojp/nihongo,shawnps/nihongo,gojp/nihongo,gojp/nihongo | app/models/word.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/harlow/kinesis-connectors\"\n\t\"github.com/joho/godotenv\"\n\t\"github.com/sendgridlabs/go-kinesis\"\n)\n\nfunc main() {\n\tgodotenv.Load()\n\n\t// Initialize Kinesis... | go | edit | 0 | 3 | mit | d542fa996f4dcd62cc81289b4a3e8f7066c84b64 | harlow/kinesis-connectors | examples/seed-stream/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage io_throttler\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"io/ioutil\"\n\n\t\"github.com/efarrer/iothrottler\"\n)\n\n//CopyThrottled does a normal io.Copy but with throttling\nfunc CopyThrottled(bandwidth iothrottler.Bandwidth, dest io.Writer... | go | edit | 0 | 3 | mit | fbcadc864aec621e64895f6ba4b2f3eb9c7102d9 | golang-devops/go-psexec | shared/io_throttler/copy.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage minion\n\nimport (\n\t\"mime/multipart\"\n\n\t\"github.com/pressly/chi\"\n)\n\nfunc (c *Context) ByGet(name string) string {\n\treturn chi.URLParam(c.Req, name)\n}\n\nfunc (c *Context) ByQuery(name string) string {\n\tvalues := c.Req.UR... | go | edit | 9 | 2 | mit | 78993420d67f70ffa6d5b77e22eece9e4add01b4 | ustrajunior/minion | routerparams.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\"errors\"\n\t\"sdl\"\n)\n\nconst (\n\tdefaultWidth, defaultHeight = 1024, 768\n\tgameName = \"gogame\"\n)\n\nfunc main() {\n\tctx, err := sdl.NewContext(gameName, defaultWidth, defaultHeight)\n\tif err != nil {\n\t\... | go | edit | 0 | 5 | mit | f47cde8a0ba3994cc17f9517f0bf217a2c9756a3 | DrJosh9000/gogame,DrJosh9000/gogame | src/main/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage venom\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestParseEmpty(t *testing.T) {\n\tm, err := parseMapStringString(\"\", \",\", \"=\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, m, map[string]string{}... | go | edit | 0 | 2 | mit | 61b5fe7f2fcb11a25696b2232359958dfef63869 | themalkolm/venom | stringutil_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nfunc LocalSearch(packages []string) error {\n\treturn run(\"apt-cache\", \"pkgnames\", nil)\n}\n\n```\n\nApply this change: Correct -Q to actually only show local packages."
},
{
"role": "assistant",
"content": "... | go | edit | 3 | 1 | cc0-1.0 | 6d1edf4e732228c3f30570cf834e2239819c24f2 | LaPingvino/jogurto | commands/query.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/ricochet2200/go-disk-usage/du\"\n)\n\nvar KB = uint64(1024)\n\nfunc main() {\n\tusage := du.NewDiskUsage(\"C:\\\\\")\n\tfmt.Println(\"Free:\", usage.Free()/(KB*KB))\n\tfmt.Println(\"Available:... | go | edit | 0 | 1 | unlicense | 7800bb6a249e4c4621e00110b8e13ebbb0743d07 | ricochet2200/go-disk-usage,d4l3k/go-disk-usage | duexample.go | rejected_duplicate | Near-duplicate of sample 119029 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/ciarand/notify\"\n)\n\nvar (\n\ttext *string\n\ttitle *string\n\tsubtitle *string\n\tsound *string\n)\n\nfunc init() {\n\ttext = flag.String(\"text\", \"\", \... | go | edit | 0 | 5 | isc | 1c86598206ddb259fb9bc3e404114bc53731743f | ciarand/notify | cmd/notify/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage buildpackrunner\n\n// Used to generate YAML file read by the DEA\ntype DeaStagingInfo struct {\n\tDetectedBuildpack string `json:\"detected_buildpack\",yaml:\"detected_buildpack\"`\n\tStartCommand string `json:\"start_command\",yam... | go | edit | 0 | 0 | apache-2.0 | 5ecc1ac3effa43b8bd713070c9a81342243e6571 | cloudfoundry-incubator/buildpack_app_lifecycle,cloudfoundry-incubator/buildpack_app_lifecycle | buildpackrunner/dea_staging_info.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"delay\"\n\t\"fmt\"\n\n\t\"stm32/hal/gpio\"\n\t\"stm32/hal/system\"\n\t\"stm32/hal/system/timer/systick\"\n)\n\nvar led gpio.Pin\n\nfunc init() {\n\tsystem.Setup(-48, 6, 20, 0, 0, 2)\n\tsystick.Setup()\n\n\tgpio.A.E... | go | edit | 0 | 3 | bsd-3-clause | c221fc168f807d4b53ea37127736027b3811cf2a | ziutek/emgo,ziutek/emgo,ziutek/emgo,ziutek/emgo | egpath/src/stm32/examples/nucleo-l476rg/blinky/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\n/*\n Copyright The containerd 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... | go | edit | 0 | 2 | apache-2.0 | 9ff702b9a146c02b90df58e558cafde0d398debe | kunalkushwaha/containerd,dmcgowan/containerd,thaJeztah/containerd,estesp/containerd,dmcgowan/containerd,vdemeester/containerd,containerd/containerd,kunalkushwaha/containerd,crosbymichael/containerd,mikebrow/containerd,miaoyq/containerd,crosbymichael/containerd,estesp/containerd,thaJeztah/containerd,vdemeester/container... | cmd/containerd-shim-runc-v1/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nFresh is a command line tool that builds and (re)starts your web application everytime you save a go or template file.\n\nIf the web framework you are using supports the Fresh runner, it will show build errors on your browser.\n\nIt current... | go | edit | 0 | 3 | mit | 2d65002b593899a225f18e239ce6991c677ff69e | lateefj/fresh | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handlers\n\nimport (\n\t\"io\"\n \"encoding/json\"\n \"strings\"\n \"strconv\"\n \"math/rand\"\n \"time\"\n \"github.com/nelsonleduc/calmanbot/handlers/models\"\n)\n\nfunc ParseJSON(bytes []byte, path string) string {\... | go | edit | 0 | 5 | mit | b1c39e28adb6d566b154f8c1d4cc747930d8d8fd | NelsonLeDuc/CalmanBot,NelsonLeDuc/CalmanBot | handlers/parser.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Benchmark parallel downloading and combination of some pdf files.\npackage main\n\nimport (\n \"pdfcombiner/combiner\"\n \"net/http\"\n \"net/url\"\n \"fmt\"\n)\n\n// Validate that the required URL params are present and correct.\nfunc c... | go | edit | 3 | 3 | mit | 8f19f346309b3ef383d4d9c6e7f4768fd02fbd48 | PeopleAdmin/pdfcombiner,PeopleAdmin/pdfcombiner,PeopleAdmin/pdfcombiner | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pdf\n\nimport \"testing\"\n\nfunc TestTestFile (t *testing.T) {\n\tf := NewFile(\"/tmp/foo.pdf\")\n\tf.Close()\n}\n\n\n```\n\nApply this change: Add File.AddObject() and File.DeleteObject() to unit test."
},
{
"role": "assistant... | go | edit | 0 | 1 | apache-2.0 | a3b2d4ac6387d4aa149357f15ff5fc7eea79b6f0 | mawicks/PDFiG | pdf/file_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gash\n\n// A simple chained hash.\n\ntype SimpleHash struct {\n items [][]*KvPair\n capacity int\n}\n\nfunc CreateSimpleHash(capacity int) SimpleHash {\n table := SimpleHash{}\n table.capacity = capacity\n table.items = m... | go | edit | 15 | 4 | mit | ea4fc2697902b77eaf2a8e62771da71dacbd2972 | elvinyung/gash | simplehash.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cas\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestLearnHttpTestServer(t *testing.T) {\n\texpected := \"Hello, client\"\n\n\turl, _ := url.Par... | go | edit | 6 | 3 | mit | ce8f5550040fae19ab44214004afb7508c0a650c | yp-engineering/cas,go-cas/cas | client_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage crawl\n\ntype AnalyzeSentiment interface {\n\tGetScoreForTweet(tweet string) int\n}\n\n```\n\nApply this change: Update the SentimentAnalyzer interface and provide a mock"
},
{
"role": "assistant",
"content": "/*\nPackage fo... | go | edit | 0 | 1 | mit | 008987952df156f1574f15e44344f6033ce4b28a | arianht/meantweets,arianht/meantweets,arianht/meantweets,arianht/meantweets,arianht/meantweets | crawl/sentiment.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bletchley\n\nimport (\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n)\n\nconst (\n\tsymmetricNonceLength = 12\n\tsymmetricKeyLength = 32\n)\n\n// We are allowed to use an empty nonce because we never re-use keys\n// see Section 8.2.1 of NIS... | go | edit | 0 | 2 | mit | 6978577fdf63f3f02ca9c3ac842abab583811f93 | pivotal-cf-experimental/bletchley | symmetric.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"strings\"\n\n\t\"k8s.io/apiserver/pkg/authentication/user\"\n\t\"k8s.io/apiserver/pkg/authorization/authorizer\"\n\n\tauthorizationapi \"github.com/openshift/origin/pkg/authorization/apis/authorization\"\n)\n\n// T... | go | edit | 0 | 3 | apache-2.0 | 9f63fe35253102000bb68692b423f8e594f7ae51 | liangxia/origin,tnozicka/origin,akram/origin,jeremyeder/origin,liangxia/origin,liangxia/origin,JacobTanenbaum/origin,ryanj/origin,mrogers950/origin,jim-minter/origin,openshift/origin,ryanj/origin,xiuwang/origin,spadgett/origin,markllama/origin,nhr/origin,dobbymoodge/origin,miminar/origin,luciddreamz/origin,soltysh/orig... | pkg/authorization/registry/util/attributes.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scraperService\n\nimport (\n\t\"math/rand\"\n\t\"net\"\n\n\t\"github.com/ewhal/nyaa/model\"\n)\n\nconst InitialConnectionID = 0x41727101980\n\ntype Bucket struct {\n\tAddr net.Addr\n\ttransactions map[uint32]*Transaction\n}\n\nf... | go | edit | 12 | 2 | mit | 3d8727d1e374af101c3f8be8514f33865cc698ff | ElegantMonkey/nyaa,majestrate/nyaa,kipukun/nyaa,steindornatorinn/nyaa,yueou/nyaa,ElegantMonkey/nyaa,Nutjob/nyaa,Nutjob/nyaa,Nutjob/nyaa,ipatrol/nyaa,yueou/nyaa,moose65468/nyaa,steindornatorinn/nyaa,kipukun/nyaa,NyaaPantsu/nyaa,moose65468/nyaa,moose65468/nyaa,moose65468/nyaa,majestrate/nyaa,steindornatorinn/nyaa,ipatrol... | service/scraper/bucket.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 The Prometheus Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.a... | go | edit | 3 | 2 | apache-2.0 | 366bd4d57c93af27cb1b721cb61821b4a853da7e | jimmidyson/prometheus-client_golang,stapelberg/client_golang,m3db/prometheus_client_golang,mattkanwisher/client_golang,prometheus/client_golang,asbjornenge/client_golang | text/fuzz.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sel\n\nimport (\n\t//\"encoding/json\"\n\t\"fmt\"\n)\n\nfunc SelectLink() {\n\tfmt.Println(\"Selecting link from json file\")\n\n\t// TODO\n}\n```\n\nApply this change: Implement first (unfinished) version of SelectLink and adjust impor... | go | edit | 0 | 3 | mit | b560fe0c6060f3cb3905e350b003926214054baa | danielkocher/link-select | sel/sel.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"github.com/anonx/sunplate/skeleton/assets/views\"\n\n\t\"github.com/anonx/sunplate/action\"\n)\n\n// App is a sample controller that is used for demonstration purposes.\ntype App struct {\n\t*Controller\n}\n... | go | edit | 12 | 1 | bsd-2-clause | 6940bd44abef845b0af9b8c9916799cf3d8450d0 | goaltools/goal,anonx/sunplate,anonx/sunplate,goaltools/goal,goaltools/goal,anonx/sunplate | skeleton/controllers/app.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gosolar\n\nimport \"fmt\"\n\n// RemoveNCMNodes is now even more awesome.\nfunc (c *Client) RemoveNCMNodes(guids []string) error {\n\treq, endpoint := getRemoveNCMNodesRequest(guids)\n\t_, err := c.post(endpoint, req)\n\n\tif err != nil ... | go | edit | 3 | 2 | apache-2.0 | 2acdad7b5e64197c30856961327f8f4fede122f8 | mrxinu/gosolar | ncm.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build freebsd openbsd netbsd darwin linux\n\npackage gopass\n\n/*\n#include <termios.h>\n#include <unistd.h>\n#include <stdio.h>\n\nint getch() {\n int ch;\n struct termios t_old, t_new;\n\n tcgetattr(STDIN_FILENO, &t_o... | go | edit | 0 | 7 | isc | dcac83ec49ec4af6f563ff585858935c8aa8d7da | yp-engineering/gopass,keybase/gopass,howeyc/gopass | nix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2018 Cisco and/or its affiliates.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at:\n//\n... | go | edit | 0 | 3 | apache-2.0 | bf9b085cdbb0f7c5b194fabb546267b3858a31c6 | ligato/cn-infra,ligato/cn-infra | kvscheduler/internal/utils/conversions.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www... | go | edit | 0 | 3 | apache-2.0 | 8af4e501f361c7ee297d2ac0c46ab72312fa2e84 | sharifelgamal/runtimes-common,sharifelgamal/runtimes-common,priyawadhwa/runtimes-common,dlorenc/runtimes-common,sharifelgamal/runtimes-common,priyawadhwa/runtimes-common,sharifelgamal/runtimes-common,priyawadhwa/runtimes-common,nkubala/runtimes-common,priyawadhwa/runtimes-common,dlorenc/runtimes-common,nkubala/runtimes... | ctc_lib/ctc_lib.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/imdario/mergo\"\n\t\"io/ioutil\"\n)\n\n// Configuration is the configuration type\ntype Configuration struct {\n\tEnvironment\n\tEnvironments map[string]Environment `json:... | go | edit | 0 | 3 | unlicense | 7d4f73c5edec959fa2bec9391a19f0154b1455f0 | elwinar/rambler,rsterbin/rambler | configuration.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\"log\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nconst baseURL = \"https://api.github.com/search/repositories\"\n\ntype Query struct {\n\tQ string\n\tLang string\n\tLimit int\n}\n\nfunc escapeSear... | go | edit | 0 | 2 | mit | c391df26fbf86adf29d648d03effc22a7a9e2b13 | keith/ghs | ghs.go | rejected_duplicate | Near-duplicate of sample 117044 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tfmt.Println(\"Hello, world!\")\n}\n\n```\n\nApply this change: Add command option for name"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"fmt\"\n\t\"gi... | go | edit | 3 | 2 | mit | e557bbc61fca084ebbb4d948000e2394047244b8 | jackc/go-hello,jackc/go-hello | 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.