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 arn\n\n// Register a list of supported character roles.\nfunc init() {\n\tDataLists[\"anime-character-roles\"] = []*Option{\n\t\t{\"\", \"Unknown\"},\n\t\t{\"main\", \"Main character\"},\n\t\t{\"supporting\", \"Supporting character\"},\... | go | edit | 9 | 1 | mit | 3df4996e33ff6f95b84e6400c77819e4b43ee068 | animenotifier/arn | AnimeCharacter.go | rejected_lint | Too many lint violations: 9 | 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/mistifyio/mistify-dhcp\"\n\tlogx \"github.com/mistifyio/mistify-logrus-ext\"\n)\n\nfunc main() {\n\tlog.SetFormatter(&log.JSONFormatter{})\n\tlog.AddHook(&logx.Error... | go | edit | 6 | 2 | apache-2.0 | 580cf7566a2b63c22ce551f72832e4f8fd5415ac | mistifyio/mistify-dhcp,mistifyio/mistify-dhcp | cmd/mistify-dhcp/main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\nfunc (dispatch *Dispatcher) Debug(args []string) {\n\tdispatch.BigV.DebugLevel = 1\n\n\tbody, err := dispatch.BigV.Request(args[0], args[1], \"\")\n\tif err != nil {\n\t... | go | edit | 3 | 2 | mit | 44f3c644b1a9d080d173e528caada50f5c3f208f | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmd/commands-debug.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"http2-impl/common\"\n)\n\nfunc Respond(data []byte) (common.Frame, bool) {\n\tf := common.GOAWAY{}\n\n\treturn f, false\n}\n\n```\n\nApply this change: Change package name to match github repository\n\nCan't figu... | go | edit | 0 | 1 | mit | 18cb5ae549565b015bd88af63a57c53ca2d33d32 | tildedave/go-http2-impl,tildedave/go-hpack-impl | server/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/hex\"\n\t\"flag\"\n\t\"log\"\n\n\t\"github.com/aarbt/bitcoin-base58\"\n\t\"github.com/aarbt/hdkeys\"\n)\n\nvar extendedKey = flag.String(\"extended_key\", \"\", \"\")\n\nfunc main() {\n\tflag.Parse()\n\n\t... | go | edit | 0 | 3 | mit | 95431df442eed97dcc6fd45b71bd14ab378346d2 | aarbt/hdkeys,aarbt/bitcoin-hdwallet,runeaune/hdkeys | bin/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"os\"\n \"net\"\n \"time\"\n \"sync\"\n)\n\nvar (\n host string // The host address to scan\n)\n\nfunc init() {\n if len(os.Args) != 2 {\n fmt.Fprintf(os.Stderr, \"Usage: %s host\\n\", os.Args[0])... | go | edit | 0 | 2 | mit | cca69fe3b6ffa7a6049d68d85e73507927c29a27 | redforks/portscan | app.go | rejected_duplicate | Near-duplicate of sample 117060 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {\n\tproc := exec.Command(args[0], args[1:]...)\n\tproc.Dir = workdir\n\tlogger.Printf(\"Command path: %v... | go | edit | 21 | 8 | mit | 7329c5f45a7f05244e6b2903d1b91af2fdbf681b | alco/goon,felixbuenemann/goon,alco/goon,felixbuenemann/goon | proto_0_0.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/fubarhouse/golang-drush/alias\"\n\t\"github.com/fubarhouse/golang-drush/vhost\"\n)\n\nfunc main() {\n\n\tvar WebserverDir = flag.String(\"vhost-dir\", \"... | go | edit | 0 | 3 | mit | cb51fb0426137cb746912163225cd5a5c800b599 | fubarhouse/golang-drush | cmd/yoink-validate/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\nconst (\n\tapiPrefix = \"/api/v1\"\n)\n\n//go:generate counterfeiter . Client\n\ntype Client interface {\n\tPipelines() ([]Pipeline, error)\n}\n\ntyp... | go | edit | 9 | 5 | mit | 7e25de93795124661b734e4d896dc8524e167de7 | robdimsdale/concourse-pipeline-resource,robdimsdale/concourse-pipeline-resource | concourse/api/pipelines.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\n// NOTE: install protoc as described on grpc.io before running go generate.\n\n//go:generate protoc -I. beam_runner_api.proto endpoints.proto --go_out=pipeline_v1\n//go:generate protoc -I. beam_fn_api.proto --go_out=Mbeam_runner_... | go | edit | 0 | 0 | apache-2.0 | 670b13c0902c41a38fc81ef8440ac61fe798b370 | charlesccychen/beam,markflyhigh/incubator-beam,iemejia/incubator-beam,apache/beam,lukecwik/incubator-beam,apache/beam,chamikaramj/beam,chamikaramj/beam,mxm/incubator-beam,apache/beam,tgroh/incubator-beam,lukecwik/incubator-beam,chamikaramj/beam,RyanSkraba/beam,tgroh/beam,markflyhigh/incubator-beam,lukecwik/incubator-be... | pkg/beam/core/runtime/api/gen.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage common\n\nimport (\n\t\"fmt\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\nvar DB gorm.DB\n\nfunc init() {\n\tvar err error\n\tDB, err = gorm.Open(\"postgres\", \"user=govcode password=govcode dbname=govcode_go sslmode... | go | edit | 0 | 2 | mit | 0aa2f9c1f9d471cfb3aff10620075f3eb1a0845d | dlapiduz/govcode.org,dlapiduz/govcode.org,HackAgenda/govcode,dlapiduz/govcode.org,HackAgenda/govcode | common/db.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\n\tlogrus \"github.com/sirupsen/logrus\"\n)\n\nfunc init() {\n\tlogger.SetLevel(logrus.PanicLevel)\n}\n\nfunc TestLogConfig(t *testing.T) {\n\tbackup := logru... | go | edit | 18 | 1 | mit | d3f84d8b2f9b3aa392b83d029787a2a452a0ca65 | groovenauts/magellan-gcs-proxy,groovenauts/magellan-gcs-proxy,groovenauts/magellan-gcs-proxy | log_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utp\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"sync\"\n\t\"testing\"\n\n\t_ \"github.com/anacrolix/envpprof\"\n\n\t\"golang.org/x/net/nettest\"\n)\n\nfunc init() {\n\tlog.SetFlags(log.Flags() | log.Lshortfile)\n}\n\nfunc TestNettestLocalhos... | go | edit | 6 | 2 | mit | 226a8dfc8e7a6f32a7fffacc7313dea1edc0d3e4 | anacrolix/go-libutp,anacrolix/go-libutp,anacrolix/go-libutp,anacrolix/go-libutp | utp_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mccli\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/materials-commons/config\"\n\t\"github.com/materials-commons/mcstore/server/mcstore\"\n)\n\nvar ShowCommand = cli.Command{\n\tName: \"show\",\n\tUsage: ... | go | edit | 0 | 1 | mit | d53db16e9d0e06d14912fec669c0be142744b2f7 | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | cmd/mccli/show_cmd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage acceptance\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Currency\", func() {\n\tIt(\"should return currency metrics\", func() {\n\t\tExpect(metricFamilies).To(SatisfyAll(\n\t\t\tHa... | go | edit | 15 | 1 | mit | 64b903100d4a8d9615a7bd365888ae4f3be5157c | alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf | tools/metrics/acceptance/currency_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage opentracing\n\nimport \"golang.org/x/net/context\"\n\ntype contextKey int\n\nconst activeSpanKey contextKey = iota\n\n// ContextWithSpan returns a new `context.Context` that holds a reference to\n// the given `Span`.\n//\n// The second ... | go | edit | 9 | 2 | apache-2.0 | 0792dca3fcf94bde8e5fb0150d3010a2e56bd6f7 | opentracing/opentracing-go | gocontext.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tprocess(os.Args[1:], os.Stdout)\n}\n\nfunc process(args []string, output io.Writer) {\n\tif len(args) == 0 {\n\t\tlog.Fat... | go | edit | 0 | 3 | mit | 4ad79a219fa376bfe31d085ec24948d5c03889a6 | jcgay/chtignore | chtignore.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"os\"\n\ntype ADFSConfig struct {\n\tUsername string\n\tPassword string\n\tHostname string\n}\n\nfunc newADFSConfig() *ADFSConfig {\n\tauthVars := &ADFSConfig{\n\t\tUsername: os.Getenv(\"AD_USER\"),\n\t\tPassword: os.Get... | go | edit | 6 | 5 | mit | 6e1802fab1fbeceef72dfc9d091a4bd3da78fb70 | tmiller/auth-aws,tmiller/auth-aws | adfs_config.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage floydwarshall\n\n// Grafos - Algoritmo de Floyd-Warshall em GO\n// Douglas Oliveira - 2021\n// https://github.com/xDouglas90\n// link Go PlayGround: https://go.dev/play/p/4fOHMMxWxiy\n\n// Algoritmo de Floyd-Warshall\nfunc FloydWarshall... | go | edit | 0 | 6 | mit | 054e660f270bc911378150ebce847b5ade5b9366 | kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-d... | src/go/floyd_warshall/floyd_warshall.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage vat helps you deal with European VAT in Go.\n\nIt offers VAT number validation using the VIES VAT validation API & VAT rates retrieval using jsonvat.com\n\nValidate a VAT number\n\t\tvalidity := vat.Validate(\"NL123456789B01\")\n\nG... | go | edit | 0 | 0 | mit | 38fdbf5b5a1ab56cb8bcd76f129e0dae2900b3de | dannyvankooten/govat | vat.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service\n\nimport (\n\t\"log\"\n\t\"time\"\n)\n\nfunc (b *Broker) Purge() {\n\tnow := time.Now()\n\n\tfor name, worker := range b.Service.workers {\n\t\tlog.Printf(\"I: Looking at worker %s\", name)\n\n\t\tif worker.Expiry.Before(now) {... | go | edit | 3 | 4 | apache-2.0 | d76e75300da746a1f9093509fc24c417ee268596 | radiodan/broker | service/purge.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"encoding/json\"\n\t\"strings\"\n)\n\ntype reference Reference\n\nfunc (r *Reference) UnmarshalJSON(data []byte) (err error) {\n\tref := reference{}\n\tif err = json.Unmarshal(data, &ref); err == nil {\n\t\tsplitU... | go | edit | 9 | 3 | apache-2.0 | ea46b63f3836d6a567d4c7c9e7bf4fd989a69ad0 | intervention-engine/fhir | models/reference_ext.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\"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 COMMAND [ARGS…]\")\n\t\tos.Exit(1)\... | go | edit | 3 | 5 | mit | 1ff58bfae05ef4b367a73a952e8edb218373f195 | mxey/aroc | aroc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 The goyy Authors. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage validate\n\nimport (\n\t\"fmt\"\n)\n\ntype Error struct {\n\tfield ... | go | edit | 0 | 1 | mit | aad51df75de3a018a6668ddbc180964b0fe21b2b | goyy/goyy,goyy/goyy,goyy/goyy,goyy/goyy | data/validate/validation_error.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nhttp://www.apache.org/licenses/LICENSE-2.0.txt\n\n\nCopyright 2015 Intel Coporation\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 cop... | go | edit | 0 | 1 | apache-2.0 | 51f18caa215d797c90eced231c718f193d4601d6 | intelsdi-x/snap-plugin-publisher-mysql,mkleina/snap-plugin-publisher-mysql,mkleina/snap-plugin-publisher-mysql,intelsdi-x/snap-plugin-publisher-mysql,intelsdi-x/snap-plugin-publisher-mysql | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello, Slate!\")\n}\n\n```\n\nApply this change: Add 'Load' function to fetch schema"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"encoding/json... | go | edit | 3 | 4 | mit | 8adefe828fbab9a9cb9ab84153816c650e99c483 | slate-io/slate | 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/soudy/mathcat\"\n\t\"gopkg.in/readline.v1\"\n\t\"os\"\n\t\"runtime\"\n)\n\nvar precision = flag.Int(\"precision\", 2, \"decimal precision used in results\")\n\nfunc getHomeDir() st... | go | edit | 0 | 6 | mit | 0dd24f825210ac212691217611db25f9d64b9fe8 | soudy/eparser,sodoz/mathcat,soudy/mathcat | cmd/mathcat/mathcat.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParseTHGR122NX(t *testing.T) {\n\tvar o Oregon\n\tres := o.Parse(\"OS3\", \"1D20485C480882835\")\n\tif res.ID != \"1D20\" {\n\t\tt.Error(\"Error parsing ID\")\n\t}\n\tif res.Data[\"Temperat... | go | edit | 3 | 6 | mit | 6fcc9a77e70103972d279e4df6d6856dd2de5c39 | geoffholden/gowx,geoffholden/gowx,geoffholden/gowx | parser/oregon_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage entities\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/Vladimiroff/vec2d\"\n)\n\ntype SpyReport struct {\n\tPlayer string\n\tName string\n\tOwner string\n\tPosition *vec2d.Vector\n\tShipCount int32\n\tValidUntil... | go | edit | 9 | 1 | mit | b13028a3f6da77d1e8325ab8719e9d3a703a5a03 | WarCluster/warcluster-server,WarCluster/warcluster-server | entities/spy_report.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Real-time massively multiplayer online space strategy arcade browser game!\npackage main\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"warcluster/config\"\n\t\"warcluster/entities/db\"\n\t\"warcluster/leaderboard\"\n\t\"warclu... | go | edit | 0 | 1 | mit | 64b032ba5aab9cd1e90c1db5bd5173a1f5927bd0 | WarCluster/warcluster-server,WarCluster/warcluster-server | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\nimport \"crypto/md5\"\n\n// url, gfy-url\nfunc convert(input string, n, max int) []int {\n\tb := md5.Sum([]byte(input)) // 16 bytes\n\tresult := make([]int, n)\n\tblocksize := (numbits(max) / 8) + 1\n\tj := 0\n\t... | go | edit | 0 | 2 | mit | a33fcd6e1bb3586af2104d7fe5acbfc0b85773ea | nindalf/linkto | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage library\n\nimport (\n\t\"sort\"\n\n\t\"github.com/anaminus/rbxmk\"\n)\n\n// registry contains registered Libraries.\nvar registry []rbxmk.Library\n\n// register registers a Library to be returned by All.\nfunc register(library rbxmk.Lib... | go | edit | 0 | 2 | mit | 1d75f3068755f9c2185beecada12c7ee484c7260 | Anaminus/rbxmk,Anaminus/rbxmk | library/0.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 The Knative Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org... | go | edit | 9 | 3 | apache-2.0 | 68e8972aa89efb63ed117b46fea44a42bf9d9bc6 | tektoncd/pipeline,tektoncd/pipeline | pkg/apis/pipeline/v1alpha1/taskrun_defaults.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage liner\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestHistory(t *testing.T) {\n\tinput := `foo\nbar\nbaz\nquux\ndingle`\n\n\tvar s State\n\tnum, err := s.ReadHistory(strings.NewReader(input))\... | go | edit | 6 | 8 | mit | 4cda2c8dc737e1ed9946ce71a018398e62c1290b | mvo5/liner,PLWagner/golang-liner,Cofyc/liner,go-delve/liner,platinasystems/liner,moander/liner,glycerine/liner | line_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 0 | 0 | apache-2.0 | 9970ae85fb0cc5374233b223f04b025ecdd7f0be | kubernetes-retired/cluster-registry,kubernetes-retired/cluster-registry | apis/federation/annotations.go | rejected_duplicate | Near-duplicate of sample 117342 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tumblr\n\nimport (\n\t\"testing\"\n)\n\nfunc TestPosts(t *testing.T) {\n\tb := makeTumblr().NewBlog(\"lacecard.tumblr.com\")\n\t// Check for unique post\n\tparams := PostRequestParams{\n\t\tId: int64(76803575816),\n\t\tNotesInfo: true,\... | go | edit | 0 | 3 | mit | 3028ded78c0b1c0c9f4ccd3fce3c481361496161 | hut8/tumblr-go | blog_posts_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n\t\"log\"\n \"net/http\"\n\t\"path/filepath\"\n\t\"github.com/docopt/docopt.go\"\n)\n\nfunc main() {\n\targuments, _ := docopt.Parse(usage(), nil, true, \"0.1\", false)\n\n\tport := arguments[\"--port\"].(s... | go | edit | 3 | 1 | mit | f768c1f1925bfb84d4fdddf6537b749d3776b590 | lminaudier/sws | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage common\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc Test_CSVDump(t *testing.T) {\n\ttype io struct {\n\t\tFields []string\n\t\tRows [][]string\n\t\tOutput string\n\t}\n\n\ttests := []io{\n\t\tio{\n... | go | edit | 0 | 2 | mit | c0f9835ae3e48ee703395248fdfd118f8fd66304 | yapdns/yapdnsbeat,yapdns/yapdnsbeat | common/csv_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage libkb\n\nimport (\n\t\"fmt\"\n)\n\n// NOTE: This file is the source of truth for our version number, but we have a\n// script that reads it at packaging/version.sh. If you refactor this\n// file, update that script.\n\n// Ve... | go | edit | 0 | 1 | bsd-3-clause | 4d94207434b1153e4359157c06025c56324fff5a | 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/version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage memstats\n\nimport (\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/format\"\n\t\"io\"\n\t\"runtime\"\n)\n\nfunc writeNamedStat(writer io.Writer, name string, value uint64) {\n\tfmt.Fprintf(writer, \" %s=%s\\n\", name, format.Format... | go | edit | 0 | 1 | apache-2.0 | be125d66895c8d8a39735cc410bff05c1f8ba30b | keep94/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator | lib/memstats/memstats.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestGetMetadataProvider(t *testing.T) {\n\ttests := []struct {\n\t\tdesc string\n\t\tname string\n\t\terr error\n\t}{\n\t\t{\n\t\t\tdesc: \"supported provider\",\n... | go | edit | 0 | 3 | apache-2.0 | 57a0d8eaffc364164a7dd1392ddf82055aa10125 | coreos/coreos-metadata | internal/main_test.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\"runtime/debug\"\n\n\t\"testing\"\n\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/sclevine/agouti\"\n)\n\nconst (\n\tPORT = 9009\n)\n\nvar (\n\tbaseUrl = fmt.Sprintf(\"http://localhost:%v/admi... | go | edit | 6 | 2 | mit | 36b147fe697e6cb3bbed57fc96a4ab3f74ec1cdb | gavinzhs/qor,shaunstanislaus/qor,yanzay/qor,yanzay/qor,amirrpp/qor,amirrpp/qor,codedogfish/qor,trigrass2/qor,qor/qor,codedogfish/qor,shaunstanislaus/qor,insionng/qor,youprofit/qor,strogo/qor,youprofit/qor,shidao-fm/qor,gavinzhs/qor,trigrass2/qor,qor/qor,lance2088/qor,jmptrader/qor,insionng/qor,shidao-fm/qor,qor/qor,str... | test/integration/setup_integration_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestGenerateKeys(t *testing.T) {\n\tvar tests = []struct {\n\t\tkey string\n\t\tsize int\n\t\twant string\n\t}{\n\t\t{\"ecdsa\", 256, \"*ecdsa.PrivateKey\"},\n\t\t{\"rsa\", 10... | go | edit | 3 | 4 | mit | adc3c7f16051d51a58d96e32082aaeb051e3da20 | nsheridan/cashier,fuero/cashier,nsheridan/cashier,lyda/cashier,fuero/cashier,fuero/cashier,lyda/cashier | client/keys_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t. \"github.com/fholiveira/smartprompt/parsers\"\n)\n\nfunc loadPromptPattern() (string, error) {\n\targs := os.Args[1:]\n\n\tif len(args) != 1 {\n\t\treturn \"\", errors.New(\"Inv... | go | edit | 6 | 2 | mit | 4df939f9e31260b3e59eba285ea85330caa86df5 | fholiveira/smartprompt,fholiveira/smartprompt,julianosaless/smartprompt,julianosaless/smartprompt | smartprompt.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stellarbase\n\nimport \"github.com/stellar/go-stellar-base/xdr\"\n\n//go:generate rake xdr:update\n//go:generate go fmt ./xdr\n\n// AddressToAccountId converts the provided address into a xdr.AccountId\nfunc AddressToAccountId(address s... | go | edit | 3 | 2 | apache-2.0 | 60f167f8d15af3b840802b35d5f9919b0377e4b7 | stellar/go-stellar-base,stellar/go-stellar-base | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schema\n\nimport \"time\"\n\ntype Access struct {\n\tID string `gorethink:\"id,omitempty\"`\n\tDataset string `gorethink:\"dataset\"`\n\tBirthtime time.Time `gorethink:\"birthtime\"`\n\tMTime time.Time `goreth... | go | edit | 0 | 1 | mit | e817a299c4faf29af3b52a17a9e646298a2e9d25 | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | pkg/db/schema/access.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Add test for main but need to revise."
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"net/http/httptest\"\n\t\"testing\"\n)\n\nfunc TestHandler(t *testing.T) {\n\tserver := httptest.NewServer(handler)\n\tdefer se... | go | new_file | 3 | 1 | mit | 9e07d85eb0bbb0ea6795aa52191272a5e4fb6ed5 | Code-Craftsmanship-Saturdays/software-security,Code-Craftsmanship-Saturdays/software-security,Code-Craftsmanship-Saturdays/software-security,Code-Craftsmanship-Saturdays/software-security | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype Config struct {\n\tport string\n\tallowedContentTypes string // uncompiled regex\n}\n\nfunc main() {\n\tconfig := Config{\n\t\tport: os.Geten... | go | edit | 3 | 2 | mit | 5567f18d6343710291d090828b0e7f3daa244e9d | ryanlower/front,experiment/front | glaze.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goatee\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n)\n\ntype configuration struct {\n\tRedis Redis\n\tWeb Web\n}\n\ntype Redis struct {\n\tHost string\n}\n\ntype Web struct {\n\tHost string\n}\n\nvar (\n\tD... | go | edit | 0 | 6 | mit | 1c90c3abd2cadb746ffe076e9104c27b3c8b5957 | johnernaut/goatee,johnernaut/goatee | config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ilium\n\ntype Scene struct {\n\tAggregate Primitive\n\tLights []Light\n}\n\nfunc MakeScene(config map[string]interface{}) Scene {\n\taggregateConfig := config[\"aggregate\"].(map[string]interface{})\n\tprimitives := MakePrimitives(ag... | go | edit | 15 | 3 | bsd-3-clause | 421493e8da1f761d7948372ff13526f7d0ef8423 | akalin/ilium | ilium/scene.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage certstream\n\nimport (\n\t\"time\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/jmoiron/jsonq\"\n\t\"github.com/pkg/errors\"\n)\n\nfunc CertStreamEventStream(skipHeartbeats bool) (chan jsonq.JsonQuery, chan error) {\n\toutputSt... | go | edit | 0 | 8 | mit | 1e4326f15a345fac981f5e295f0049275db5d2d4 | CaliDog/certstream-go | certstream.go | rejected_duplicate | Near-duplicate of sample 117234 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pixur\n\nimport (\n\t\"encoding/json\"\n\t\"mime/multipart\"\n\t\"net/http\"\n)\n\nfunc (s *Server) uploadHandler(w http.ResponseWriter, r *http.Request) error {\n\tif r.Method != \"POST\" {\n\t\thttp.Error(w, \"Unsupported Method\", ht... | go | edit | 6 | 7 | apache-2.0 | 11d7be08e4d9e79b55c3181720ce8122dad4c020 | carl-mastrangelo/pixur,carl-mastrangelo/pixur | createPicHandler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Hello, world!\")\n}\n\n```\n\nApply this change: Make sqlite-squish accept SQL on stdin"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"bufio\"\n\... | go | edit | 0 | 4 | mit | 2a528e4492e2284641e8c164dda5aba801f2153a | griffithsh/sqlite-squish | cmd/sqlite-squish/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mm\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype Measurement struct {\n\tWhen time.Time\n\tWhat string\n\tValue []byte\n}\n\nfunc (m *Measurement) String() string {\n\treturn fmt.Sprintf(\"when=%s measure=%s val=%s\", m.When.Format(ti... | go | edit | 0 | 2 | bsd-3-clause | b7bef4feabe2966a326af0d7d0d9508f104e489f | heroku/shh,heroku/shh | mm/mm.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage docker\n\nimport (\n\t\"fmt\"\n\t\"github.com/dotcloud/docker/utils\"\n\t\"sync\"\n\t\"time\"\n)\n\ntype State struct {\n\tsync.Mutex\n\tRunning bool\n\tPid int\n\tExitCode int\n\tStartedAt time.Time\n\tGhost bool\n}\n\n// ... | go | edit | 0 | 3 | apache-2.0 | 91520838fc72f4004d65844b8e57df85473808a1 | xiaods/docker,remh/docker,rsmitty/docker,erikstmartin/docker,VishvajitP/docker,medallia/docker,maxwell92/docker,1HLtd/docker,EricPai/docker,alexisbellido/docker.github.io,docker/docker,allencloud/docker,boite/docker,cezarsa/docker,wzzrd/docker,mtesselH/docker,ZenikaOuest/docker,liaoqingwei/docker,SaiedKazemi/docker,tha... | state.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hpack\n\nimport (\n\t\"github.com/summerwind/h2spec/config\"\n\t\"github.com/summerwind/h2spec/spec\"\n\t\"golang.org/x/net/http2\"\n)\n\nfunc IndexAddressSpace() *spec.TestGroup {\n\ttg := NewTestGroup(\"2.3.3\", \"Index Address Space\... | go | edit | 3 | 2 | mit | a2e32be6a119d60bfa069c9775497c3de8e85ed8 | summerwind/h2spec | hpack/2_3_3_index_address_space.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar ARGV []string\n\nfunc main() {\n\tARGV = os.Args[1:]\n\n\tif len(ARGV) >= 1 {\n\t\tfor _, filename := range ARGV {\n\t\t\tif filename == \"--\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t... | go | edit | 6 | 6 | mit | b036222a738c50f73e9f376da31424f73a58cd79 | caius/gocat | gocat.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage monitor_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/BurntSushi/toml\"\n\t\"github.com/influxdb/influxdb/monitor\"\n)\n\nfunc TestConfig_Parse(t *testing.T) {\n\t// Parse configuration.\n\tvar c monitor.Config\n\tif _, ... | go | edit | 0 | 5 | mit | 106fe688c265dca7ec30f5cbe663e639a16d7ec8 | jipperinbham/influxdb,mnuessler/influxdb,nooproblem/influxdb,lgpeterson/influxdb,benbjohnson/influxdb,GrimDerp/influxdb,imcom/influxdb,jipperinbham/influxdb,apriendeau/influxdb,mcanthony/influxdb,DanielMorsing/influxdb,pablolmiranda/influxdb,pkittenis/influxdb,archsaber/influxdb,mcanthony/influxdb,influxdb/influxdb,ale... | monitor/config_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage missinggo\n\nimport (\n\t\"net\"\n\t\"strconv\"\n)\n\n// Extracts the port as an integer from an address string.\nfunc AddrPort(addr net.Addr) int {\n\tswitch raw := addr.(type) {\n\tcase *net.UDPAddr:\n\t\treturn raw.Port\n\tdefault:\n... | go | edit | 0 | 5 | mit | 30fbdc9c0fe35fb538e83573373db3627feb3030 | anacrolix/missinggo | addr.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage plugins\n\nimport (\n\t_ \"github.com/gengo/goship/plugins/helloworld\"\n)\n\n```\n\nApply this change: Add example plugin import as comment"
},
{
"role": "assistant",
"content": "package plugins\n\n// Import plugin packages... | go | edit | 0 | 0 | apache-2.0 | 71103f65b11f7f9c32a4ed77a10413732869e032 | cazacugmihai/goship,gengo/goship,gengo/goship,kgrvamsi/goship,gengo/goship,kgrvamsi/goship,cazacugmihai/goship,cazacugmihai/goship,kgrvamsi/goship | plugins/plugins.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage connection\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n)\n\nimport \"github.com/octoblu/vulcand-job-logger/pool\"\n\nvar redisPool *pool.Pool\nvar redisPoolOnce sync.Once\n\n// Connection connects to redis and\ntype Connection struct {\n\tredis... | go | edit | 0 | 1 | mit | 9e6d298502bf2888503b0146e8812c51ce62799e | octoblu/vulcand-job-logger | connection/connection.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\ntype Object interface {\n\t//Basic CRUD Method\n\tCreate() error\n\tRead() error\n\tUpdate() error\n\tDelete() error\n\t//Basic Object Method\n\tHas(name string) (bool, string, error)\n\tGetById(id string) error\n\tGetByName(n... | go | edit | 0 | 0 | mit | 2c12109b0628bc9c5b28724d1276e1bb502996f6 | yonh/wharf,maquanyi/wharf,maquanyi/wharf,yonh/wharf | models/object.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n\t\"strconv\"\n)\n\ntype RawAction struct {\n\tBaseAction `yaml:\",inline\"`\n\tOffset string\n\tSource string\n\tPath string\n}\n\nfunc (ra... | go | edit | 12 | 5 | apache-2.0 | 0197835acc0edd0bd82ea80b92055d85c1566bc4 | go-debos/debos,d4s/debos | raw_action.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Printf(\"My Hello Golang Program, Hello World\\n\")\n}\n\n```\n\nApply this change: Add version number in the program output"
},
{
"role": "assistant",
"content": "package mai... | go | edit | 0 | 1 | apache-2.0 | d9ddcf4f45f1a3aa4ffad31fcd5ce19274d8a88a | rjansen/hello | hello.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage debug\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGoInfo(t *testing.T) {\n\tassert.Equal(t, \"info_test.go\", filepath.Base(NewGoInfo(0).file))\n}\n\n```\n\nApply this chang... | go | edit | 9 | 2 | mit | e6e52ca44512859fb49f019c0aa2ddbdbf394ad3 | tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,raviqqe/tisp | src/lib/debug/info_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage io\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n)\n\ntype Output struct {\n\tw io.Writer\n\n\toutput *bytes.Buffer\n}\n\nfunc newOutput(w io.Writer) *Output {\n\treturn &Output{\n\t\tw: w,\n\t\toutput: &bytes.Buffer{},\n\t}\n}\n\... | go | edit | 0 | 2 | mit | a9eb40cee0c4287e8d049acc0c5b5afebfe2d036 | matematik7/codejam-go,matematik7/codejam-go-v2 | io/output.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/docker/engine-api/client\"\n\t\"github.com/docker/engine-api/types\"\n\t\"github.com/docker/engine-api/types/filters\"\n\t\"github.com/fatih/color\"\n\t\"github.com/urfave/cli\"\n\t\"golang.... | go | edit | 6 | 7 | mit | dadf097c0c5f7dec5a451c34464b8c5994d1f596 | mantika/whaleprint | output.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage dexcom provides functions to access a Dexcom CGM receiver\nover a USB or BLE connection.\n\nBased on the Python version at github.com/bewest/decoding-dexcom\n*/\npackage dexcom\n\nimport (\n\t\"log\"\n)\n\ntype Connection interface ... | go | edit | 6 | 3 | mit | 3233719aec01f5b9e40421ea30f3feeab5bd5113 | ecc1/dexcom | connection.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)\n\n/* Reverse an array of digits. Implemented natively for now, although\nthere might be an in-built library function that does this already */\nfunc reverse(digits []uint16) (reversed []uint16) {\n for... | go | edit | 0 | 2 | bsd-2-clause | 1af42dd4e0968133f3254d1b952b5b214072266d | ambidextrousTx/go-shorten | go-shorten.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage request\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n)\n\n// IpAddress returns client ip address from request\n// Will check X-Real-IP and X-Forwarded-For header.\n// Unless you have a trusted reverse proxy, you shouldn't use this... | go | edit | 0 | 6 | mit | 7a05e6f9e27d0e950de5b28621cd6e201e058abc | vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate | pkg/http/request/ip.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"provisioner/provisioner\"\n)\n\ntype CloseAllPorts struct {\n\tCmdRunner provisioner.CmdRunner\n}\n\nfunc (c *CloseAllPorts) Run() error {\n\terr := c.CmdRunner.Run(\"iptables\", \"-I\", \"INPUT\", \"-p\", \"tc... | go | edit | 0 | 3 | apache-2.0 | b4173a6d7fb6f10afb3d49dbca479a9e9ad85b52 | pivotal-cf/micropcf,pivotal-cf/micropcf | src/provisioner/provisioner/commands/close_all_ports.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dev\n\nimport (\n\t\"time\"\n\n\t\"github.com/udhos/jazigo/conf\"\n)\n\nfunc registerModelCiscoAPIC(logger hasPrintf, t *DeviceTable) {\n\ta := conf.NewDevAttr()\n\n\tpromptPattern := `\\S+#\\s*$`\n\n\ta.DisabledPromptPattern = promptPa... | go | edit | 6 | 2 | mit | 8afbc525e3d5bd02f87a6ae09c53bb737e3a4e36 | udhos/jazigo,udhos/jazigo | dev/model_cisco_apic.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage manifest\n\nimport (\n\t\"cf\"\n\t\"generic\"\n)\n\ntype Manifest struct {\n\tdata generic.Map\n\tApplications cf.AppSet\n}\n\nfunc NewEmptyManifest() (m *Manifest) {\n\tm, _ = NewManifest(generic.NewMap())\n\treturn m\n}\n\nfun... | go | edit | 9 | 3 | apache-2.0 | 213b1848284b005629208dd5b8ca4f154232d4f9 | nimbus-cloud/cli,srikanth88infy/cli,pishro-cc/cli,HuaweiTech/cli,EngineerBetter/cli,cgvarela/cli,xingzhou/cli,mcintyred/cli,mcintyred/cli,hyenaspots/cli,pishro-cc/cli,markstgodard/cli,saravana76/cli,carnell69/cli,zhang-hua/cli,nttlabs/cli,cgvarela/cli,nttlabs/cli,srikanth88infy/cli,AmitRoushan/cli,saurabhguptasg/cli,hy... | src/cf/manifest/manifest.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tokay\n\nimport (\n\t\"sync\"\n)\n\ntype (\n\t// routeStore stores route paths and the corresponding handlers.\n\trouteStore interface {\n\t\tAdd(key string, data interface{}) int\n\t\tGet(key string, pvalues []string) (data interface{}... | go | edit | 0 | 2 | bsd-3-clause | 2b46b0fbb8986f30543239c4edd861bdaf112bb5 | night-codes/tokay | storesMap.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Marcel Gotsch. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage goserv\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\nvar Err... | go | edit | 0 | 2 | bsd-3-clause | 1c03ff45cda99e5bf750797c2acbeb962b3a8e89 | gotschmarcel/goserv | error.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tworker \"github.com/contribsys/faktory_worker_go\"\n\tkeycloak \"github.com/kindlyops/mappamundi/havenapi/keycloak\"\n)\n\n// CreateUser creates a new user with keycloak\nfunc CreateUser(ctx worker.Conte... | go | edit | 0 | 2 | apache-2.0 | 42f2186cd3ba22bec9d91fa8db313dce0fdc126a | kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi | worker/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"image/png\"\n\t\"os\"\n)\n\nfunc main() {\n\n\t// load file\n\told_img_raw, _ := os.Open(\"img.png\")\n\n\t// decode png image\n\told_img, _ := png.Decode(old_img_raw)\n\n\t// get im... | go | edit | 3 | 3 | mit | 8110fd0448b9ab1da5ba9c7909276177e739b9d2 | TeaTracer/mipt-cg-tasks | task2/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scipipe\n\nimport (\n\t\"time\"\n)\n\n// AuditInfo contains structured audit/provenance logging information to go with an IP\ntype AuditInfo struct {\n\tCommand string\n\tParams map[string]string\n\tKeys map[string]string\n... | go | edit | 3 | 1 | mit | 5132a8f2c96dc778614e5a49a3fd1d7ec9be2beb | scipipe/scipipe,scipipe/scipipe,samuell/scipipe | audit.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage xlsx\n\nimport (\n\t. \"gopkg.in/check.v1\"\n)\n\ntype StyleSuite struct{}\n\nvar _ = Suite(&StyleSuite{})\n\nfunc (s *StyleSuite) TestNewStyle(c *C) {\n\tstyle := NewStyle()\n\tc.Assert(style, NotNil)\n}\n\nfunc (s *StyleSuite) TestMak... | go | edit | 45 | 1 | bsd-3-clause | 2c2734b57f5b39bd737e4a86c5f3d1a76f4b5d3d | ryho/xlsx | style_test.go | rejected_lint | Too many lint violations: 45 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 6 | 1 | apache-2.0 | 964099155bc6e7c91b81299ace4ed40336ad280b | tsupertramp/kops,aledbf/kops,mad01/kops,reactiveops/kops,robinpercy/kops,blakebarnett/kops,MadDogTechnology/kops,pdh/kops,faraazkhan/kops,BradErz/kops,mad01/kops,andrewsykim/kops,pdh/kops,kubernetes/kops,faraazkhan/kops,chrislovecnm/kops,gambol99/kops,andrewsykim/kops,MadDogTechnology/kops,BradErz/kops,robinpercy/kops,... | cmd/kops/secrets_expose.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lockfile_test\n\nimport (\n\tlockfile \".\"\n\t\"fmt\"\n)\n\nfunc ExampleLockfile() {\n\tlock, err := lockfile.New(\"/tmp/lock.me.now.lck\")\n\tif err != nil {\n\t\tfmt.Println(\"Cannot init lock. reason: %v\", err)\n\t\tpanic(err)\n\t}... | go | edit | 0 | 3 | mit | de97f13658dc19bf141e5e3bed280c2278f936ea | nightlyone/lockfile | lockfile_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\npackage userdir_test\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\t\"github.com/vrischmann/userdir\"\n)\n\nfunc TestGetDataHome(t *testing.T) {\n\td := userdir.GetDataHome()\n\trequ... | go | edit | 0 | 1 | mit | d7c69d7ce23febe4f5ee5a0c0e07865d71dca5fa | vrischmann/userdir | userdir_linux_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mutate\n\nimport (\n\t\"errors\"\n\t\"github.com/synw/microb/services/httpServer\"\n\t\"github.com/synw/microb/services/httpServer/state\"\n\t\"github.com/synw/terr\"\n)\n\nfunc StartHttpServer() *terr.Trace {\n\tif state.HttpServer.Run... | go | edit | 0 | 3 | mit | cd4217d2d57aba84245fa80b331f3c23a7cfa889 | synw/microb | services/httpServer/state/mutate/mutate.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//Full URI\n\t{\n\t\t\"https://github.com/sunaku/vim-unbundle\",\n\t\t\"https://github.com/sunaku/vim-unbundle\",\n\t},\n\n\t//Shor... | go | edit | 6 | 4 | mit | 444d3b0904aca36fd000db277829d3a5cc8e618f | kusabashira/vub | package_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport \"k8s.io/client-go/tools/cache\"\n\nvar (\n\tKeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc\n)\n\n```\n\nApply this change: Add QueueingEventHandler and BlockingEventHandler types"
},
{
"role": "assis... | go | edit | 0 | 2 | apache-2.0 | 2bab6b0768e6e4ebc68487196a10a04d5dbaaa4f | jetstack/navigator,jetstack/navigator | pkg/controllers/util.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/ioutil\"\n\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\nconst Thumbnails = map[string][]int{\n\t\"small\": []int{100, 100},\n\t\"large\": []int{500, 500},\n}\n\ntype Config... | go | edit | 3 | 2 | mit | 783d2cd6c71db72b198219bf9b627822bead736b | jaischeema/panorma,jaischeema/panorma,jaischeema/panorma | common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\npackage gps\n\nimport (\n\t\"os/exec\"\n\t\"testing\"\n)\n\n// setupUsingJunctions inflates fs onto the host file system, but uses Windows\n// directory junctions for links.\nfunc (fs filesystemState) setupUsingJunctions(t ... | go | edit | 9 | 3 | mit | d0ea5d5f730c5136152f99f05268b899b65ef4ff | ibrasho-forks/dep,golang/dep,ibrasho-forks/dep,golang/dep,golang/dep | filesystem_windows_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/skratchdot/open-golang/open\"\n)\n\nfunc main() {\n\tvar port int\n\tvar host string\n\tflag.IntVar(&port, \"port\", 2489, \"TCP port number\")... | go | edit | 0 | 4 | mit | 8d077c0d0a97cbd3e9c2d00c638898a2c2819236 | pocke/remote-open | remote-opend/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stripe\n\nimport \"encoding/json\"\n\n// DiscountParams is the set of parameters that can be used when deleting a discount.\ntype DiscountParams struct {\n\tParams `form:\"*\"`\n}\n\n// Discount is the resource representing a Stripe dis... | go | edit | 18 | 3 | mit | 2dc24e2646f6b63e315c7932c5476d6379fa9a86 | stripe/stripe-go,stripe/stripe-go | discount.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bot\n\nimport (\n\t\"os\"\n\t\"time\"\n)\n\n// LogLevel for determining when to output a log entry\ntype LogLevel int\n\n// Definitions of log levels in order from most to least verbose\nconst (\n\tTrace LogLevel = iota\n\tDebug\n\tInfo... | go | edit | 6 | 9 | mit | e922b582bf6d77901d5655ef32a15c78160693b5 | parsley42/gopherbot,uva-its/gopherbot,uva-its/gopherbot,uva-its/gopherbot,parsley42/gopherbot,uva-its/gopherbot,parsley42/gopherbot,parsley42/gopherbot | bot/logging.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gpsutil\n\nimport (\n\t\"math\"\n)\n\ntype LatLng struct {\n\tlat float64\n\tlng float64\n}\n\ntype GeohashDecoded struct {\n\tlat float64\n\tlng float64\n\terror struct {\n\t\tlat float64\n\t\tlgn float64\n\t}\n}\n\ntype BBox struc... | go | edit | 0 | 1 | mit | aba5e8ece4b430bb78cd4337634487cc891d4c0a | vanng822/gpsutil | gpsutil.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n Simplistic ansynchronous routines for the masses.\n*/\npackage async\n\n/*\n Done types are used for shorthand definitions of the functions that are\n passed into each Routine to show that the Routine has completed.\n\n An example a Do... | go | edit | 0 | 0 | mit | 609a2e8e8787a7bfbba7070b88376d9f2edb5803 | Southern/async | async.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helpers\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n)\n\ntype IntegrationConfig struct {\n\tAppsDomain string `json:\"apps_domain\"`\n\tPersistentAppHost string `json:\"persistent_app_host\"`\n}\n\nfunc LoadConfig() (config Integ... | go | edit | 0 | 4 | apache-2.0 | 5a5d6af6ba1d256e8f0d3220dea078736abe4389 | matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests | helpers/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\toutput := make(chan int, 1) // create channel\n\n\twrite(output, 1)\n\n\tclose(output) // close channel\n\n\twrite(output, 2)\n}\n\n// how to write on possibly closed channel\nfunc wr... | go | edit | 6 | 2 | mit | c5e052ffcee4389934b9fee7848f16c2f70f7b79 | udhos/nexthop,udhos/nexthop | src/sample/closing_channel.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\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// search for repos named \"registry\" on the central registry\nfunc TestSearchOnCentralRegistry(t *testing.T) {\n\tsearchCmd := exec.Command(dockerBinary, ... | go | edit | 12 | 4 | apache-2.0 | dad2fcb1993d9cd7c513db10965aa37d7f9a542d | SophiaGitHub/newGitHub,duglin/docker,jwuwork/docker,mtrmac/docker,kyle-wang/docker,Gobella/docker,coolsvap/docker,tianon/docker,rhuss/docker,majst01/docker,DBCDK/docker,mikebrow/docker,rillig/docker.github.io,jamesmarva/docker,bleuchtang/docker,boucher/docker,johnstep/docker.github.io,hristozov/docker,clintonskitson/do... | integration-cli/docker_cli_search_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\"os\"\n\t\"exec\"\n\t\"bytes\"\n\t\"io\"\n\t\"strings\"\n\t\"clingon\"\n)\n\ntype ShellEvaluator struct{}\n\nfunc (eval *ShellEvaluator) Run(console *clingon.Console, command string) os.Error {\n\tout, err := system... | go | edit | 3 | 1 | mit | 538315817baca5005b9eea0604ecddbebdfa4d66 | remogatto/clingon | example/evaluator.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"os/exec\"\n)\n\nconst script = `\ntell application \"System Events\"\n set frontApp to name of first application process whose frontmost is true\n\n set activeURL to \"\"\n if frontApp is \"Google C... | go | edit | 0 | 1 | mit | a8190d917573989235fc9db76d495ce87f3485b7 | lucapette/tracker | script.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"html/template\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"sort\"\n\n\t\"github.com/eknkc/amber\"\n)\n\n//template map\nvar templateMap map[string]*template.Template\n\n//initialization of the template ma... | go | edit | 3 | 1 | mit | 4ba47bc9e4e1b7b0a0c8d656a18c73f623f74010 | gagizagi/Axolotl-GO,gagizagi/Axolotl-GO | server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"os\"\n \"log\"\n \"io/ioutil\"\n \"github.com/ghodss/yaml\"\n)\n\nfunc main() {\n byteArray, _ := ioutil.ReadAll(os.Stdin)\n y, err := yaml.YAMLToJSON(byteArray)\n if err != nil {\n lo... | go | edit | 0 | 3 | unlicense | 04424fcb68e0e22159d396b7d3223b9c3ffce001 | iameli/ym | cmd/ym/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/exercism/cli/api\"\n\t\"github.com/exercism/cli/config\"\n\t\"github.com/exercism/cli/user\"\n)\n\n// Tracks lists available tracks.\nfunc Tracks(... | go | edit | 0 | 3 | mit | 5bfebe965af2f669a87e85aff2952a11a3edfa96 | lcowell/cli,zabawaba99/cli,yeah-right/cli,Tonkpils/cli,zabawaba99/cli,arvidsaur/cli,lcowell/cli,exercism/cli,neslom/cli,neslom/cli,arvidsaur/cli,zabawaba99/cli,yeah-right/cli,arvidsaur/cli,Tonkpils/cli,Tonkpils/cli,exercism/cli,yeah-right/cli,lcowell/cli,neslom/cli | cmd/tracks.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.