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 sigctx\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"sync\"\n\t\"syscall\"\n\n\t\"github.com/SentimensRG/ctx\"\n)\n\nvar (\n\tc ctx.C\n\tonce sync.Once\n)\n\n// New signal-bound ctx.C that terminates when either SIGINT or SIGTERM\n// i... | go | edit | 0 | 3 | mit | bd81cec4e8000b0be2c8b0191b70568040972529 | SentimensRG/ctx | sigctx/sigctx.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage connections\n\nimport \"encoding/json\"\n\ntype InputMessageType uint8\n\nconst (\n\tInputMessageTypeGameCommand InputMessageType = iota\n)\n\ntype InputMessage struct {\n\tType InputMessageType\n\tPayload json.RawMessage\n}\n\n```\n... | go | edit | 0 | 0 | bsd-2-clause | d07ad6ce43c4c4c4a17b8763d8fe275a81215aeb | ivan1993spb/clever-snake | connections/input_message.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache License, Version 2.0\n// that can be found in the LICENSE file.\n\n// Package allwinner exposes H3/A64 AllWinner GPIO functionali... | go | edit | 0 | 0 | apache-2.0 | b709538fd684223edb269fb326d92c98b8c1c91a | maruel/dotstar,maruel/dlibox,maruel/dlibox,maruel/dlibox,maruel/dlibox,maruel/dlibox,maruel/dotstar,maruel/dlibox,maruel/dlibox | go/pio/host/internal/allwinner/doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright IBM Corp. All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n*/\n\npackage metadata_test\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"github.com/hyperledger/fabric/common/tools/cryptogen/metadata\"\n\t\"gi... | go | edit | 0 | 1 | apache-2.0 | 51f6ea9733e0df4a123b27448f58325e1a8bb8c4 | lukehuangch/fabric,manish-sethi/fabric-sidedb,blockc/fabric,Ryan--Yang/fabric,lukehuangch/fabric,Ryan--Yang/fabric,kchristidis/fabric,Ryan--Yang/fabric,stemlending/fabric,kchristidis/fabric,thakkarparth007/fabric,manish-sethi/fabric-sidedb,hyperledger/fabric,binhn/fabric,cophey/fabric,xixuejia/fabric,binhn/fabric,kchri... | common/tools/configtxlator/metadata/metadata_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage restorer\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc preallocateFile(wr *os.File, size int64) error {\n\t// try contiguous first\n\tfst := unix.Fstore_t{\n\t\tFlags: unix.F_ALLOCATECONT... | go | edit | 0 | 2 | bsd-2-clause | 23531be27262f6065cdb46fa4c346b11a8b85a98 | restic/restic,restic/restic | internal/restorer/preallocate_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/esimov/diagram/io\"\n\t\"github.com/esimov/diagram/ui\"\n\t\"github.com/esimov/diagram/canvas\"\n\t\"math/rand\"\n\t\"time\"\n\t\"flag\"\n\t\"log\"\n\t\"os\"\n)\n\nvar (\n\tsource\t\t= flag.String(\"sour... | go | edit | 0 | 3 | mit | 6a551765b2f511639e525e8ac40ae9069b843157 | esimov/diagram,esimov/diagram | main.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/nitishparkar/muffliato/crawler\"\n\t\"io/ioutil\"\n\t\"strings\"\n)\n\nconst sitesFile string = \"sites.txt\"\n\nfunc main() {\n\tdata, err := ioutil.ReadFile(sitesFile)\n\n\tif err != nil {\n... | go | edit | 0 | 6 | mit | 6050d3d83fb673ec1f92a3841a73b756427390b7 | nitishparkar/muffliato | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage challenge21\n\nimport (\n\t\"testing\"\n)\n\nfunc TestExtract(t *testing.T) {\n\tSeed(123)\n\toutputs := make([]int, 10)\n\tfor i := 0; i < 10; i++ {\n\t\toutputs[i] = Extract()\n\t}\n\n\tfor i, num := range outputs {\n\t\tfor j, otherN... | go | edit | 18 | 3 | mit | 27c646fdcceadb08aebec333c75cf17183d9d51b | stripedpajamas/cryptopals-go,stripedpajamas/cryptopals-go | set3/challenge21/21_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux darwin\n\npackage logging\n\nimport (\n\tslog \"log/syslog\"\n\n\tlog \"gopkg.in/inconshreveable/log15.v2\"\n)\n\n// getSystemHandler on Linux writes messages to syslog.\nfunc getSystemHandler(syslog string, debug bool, format l... | go | edit | 0 | 3 | apache-2.0 | d3282567a68491e4a494e3a028ea1d74f2497b77 | lxc/lxd,hallyn/lxd,stgraber/lxd,pcdummy/lxd,jsavikko/lxd,lxc/lxd,Skarlso/lxd,stgraber/lxd,jsavikko/lxd,erikmack/lxd,hallyn/lxd,erikmack/lxd,hallyn/lxd,hallyn/lxd,mjeanson/lxd,atxwebs/lxd,lxc/lxd,stgraber/lxd,pcdummy/lxd,stgraber/lxd,pcdummy/lxd,mjeanson/lxd,erikmack/lxd,hallyn/lxd,atxwebs/lxd,atxwebs/lxd,lxc/lxd,Skarls... | shared/logging/log_posix.go | rejected_duplicate | Near-duplicate of sample 118113 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\ntype Server struct {\n\tDebug bool\n\tAPI API\n\tDB DB\n\tHelm Helm\n\tLDAP LDAP\n\tSecretsDir string `valid:\"dir\"`\n\tEnforcer Enforcer\n}\n\nfunc (s Server) IsDebug() bool {\n\treturn s.De... | go | edit | 3 | 2 | apache-2.0 | cf55065be31b1751e5e05d5aca78dff00313ccf4 | Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi | pkg/config/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage naisrequest\n\nimport (\n \t\"encoding/json\"\n\t\"testing\"\n \"github.com/nais/naisd/api/naisrequest\"\n \"github.com/stretchr/testify/assert\"\n )\n\n func TestStringMethodInDeployNaisRequestShouldHidePasswordAndUsername(t *t... | go | edit | 0 | 2 | mit | 34ab2dfcb1651ade8e18cd7cf1f07b556e548d90 | nais/naisd,nais/naisd | api/naisrequest/deploy_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage consistency\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\n\t\"github.com/pivotal-cf/cf-redis-broker/redis\"\n)\n\ntype InstancesProvider interface {\n\tInstances() ([]redis.Instance, error)\n}\n\ntype stateFileAvailableInstances struct ... | go | edit | 0 | 3 | apache-2.0 | 07fa0ed0bde1554ece5c18dcb3237114175c1c73 | pivotal-cf/cf-redis-broker,pivotal-cf/cf-redis-broker | consistency/instances_provider.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os/exec\"\n)\n\nfunc mem() (string, error) {\n\tmem, err := exec.Command(\"/usr/bin/free\", \"-tmo\").Output()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn string(mem), nil\n}\n\n```\n\nApply th... | go | edit | 3 | 3 | mit | fe19e27865a77bdc4e78957126206a6c2abbcb73 | adelq/go-dash | mem.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ospatch\n\nimport \"time\"\n\ntype PatchInfo struct {\n\tExecution_id string\n\tStatus string\n\tStart_time time.Time\n\tEnd_time time.Time\n\tInit_messages []map[string]interface{}\n}\n\n```\n\nApply this change: Use ba... | go | edit | 0 | 0 | apache-2.0 | 381b54073efdfe910f4cf5a0f06226d74f18be9d | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | models/ospatch/entities.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2012 the u-root Authors. All rights reserved\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nsh reads in a line at a time and runs it. \nprompt is '% '\n*/\n\npackage... | go | edit | 0 | 4 | bsd-3-clause | fb46262897f93c101c0a7d79e62e2ea9c0f0ad24 | rminnich/u-root,u-root/u-root,GanShun/u-root,GanShun/u-root,rminnich/u-root,hugelgupf/u-root,rminnich/u-root,u-root/u-root,hugelgupf/u-root,hugelgupf/u-root,GanShun/u-root,hugelgupf/u-root,u-root/u-root,rminnich/u-root | src/sh/sh.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\"os/user\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(111)\n\t}\n}\n\nfunc main() {\n\n\t//path := os.G... | go | edit | 0 | 2 | mit | 2796c102342b8408db9f7b5647c6717f3669e810 | tmiller/setuidgid | main.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\"log\"\n\t\"os/exec\"\n\n\t\"github.com/mgutz/ansi\"\n)\n\nfunc main() {\n\tcmd := exec.Command(\"./a.sh\")\n\terr := runCommand(cmd)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc ru... | go | edit | 0 | 4 | mit | 8cc8ad3ddb7aca6a47d36f5b556e2e75860b8e5c | hnakamur/execcommandexample,hnakamur/execcommandexample | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage packages\n\nimport (\n\t\"io\"\n)\n\nfunc probeRpms(pList *packageList, reader io.Reader) error {\n\treturn nil\n}\n\n```\n\nApply this change: Add support for RPM packages."
},
{
"role": "assistant",
"content": "package pac... | go | edit | 9 | 8 | apache-2.0 | d4c367852258e8c9fd2946de9c037ed311710fd9 | Symantec/health-agent,rgooch/health-agent,rgooch/health-agent,Symantec/health-agent | probers/packages/rpm.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage i18n\n\nimport (\n\t\"github.com/microcosm-cc/bluemonday\"\n\t\"github.com/qor/admin\"\n)\n\nvar htmlSanitizer = bluemonday.UGCPolicy()\n\ntype i18nController struct {\n\t*I18n\n}\n\nfunc (controller *i18nController) Index(context *admi... | go | edit | 6 | 2 | mit | 7da2256d250f7d6540366e066ba7fa4758aac477 | qor/i18n,qor/i18n | controller.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux darwin freebsd\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n)\n\n// ReturnCurrentUTC returns the current UTC time in RFC3339 format.\nfunc ReturnCurrentUTC() string {\n\tt := time.Now().... | go | edit | 6 | 4 | mit | acf60a8d46dd508c7919b4eaeb5b61d4e2187f88 | octohost/octo,octohost/octo | cmd/util.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage actions\n\nimport (\n\t\"bones/web/forms\"\n\t\"bones/web/templating\"\n\t\"net/http\"\n)\n\ntype SaveFormAndRedirect struct {\n\tResponseWriter http.ResponseWriter\n\tRequest *http.Request\n\tForm forms.Form\n\tSuccess... | go | edit | 3 | 4 | mit | 1feafcea579ef3a05996d2069324df29881b1374 | peterskeide/bones | web/actions/save_form_and_redirect.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage oplogc\n\nimport \"time\"\n\ntype Operation struct {\n\t// ID holds the operation id used to resume the streaming in case of connection failure.\n\tID string\n\t// Event is the kind of operation. I can be one of insert, update or delete... | go | edit | 0 | 1 | mit | 7101b0f7cb4064f5c901632392a3992a070ed13e | dailymotion/oplogc | operation.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage auth\n\nimport (\n\t\"time\"\n\n\t\"github.com/b2aio/typhon/server\"\n\t\"golang.org/x/net/context\"\n)\n\n// AuthenticationProvider provides helper methods to convert tokens to sessions\n// using our own internal authorization services... | go | edit | 0 | 0 | mit | 7c94a45bbf1f6fa4af9a47f1f21f8a2f5bd5ea25 | monzo/typhon,mondough/typhon | auth/auth.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\n/*\nCopyright 2019 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 ... | go | edit | 3 | 2 | apache-2.0 | 4301bbff08f60dbc254753309be1cc18055539ce | krmayankk/kubernetes,lojies/kubernetes,jfrazelle/kubernetes,spzala/kubernetes,mYmNeo/kubernetes,li-ang/kubernetes,cadmuxe/kubernetes,feiskyer/kubernetes,hex108/kubernetes,olivierlemasle/kubernetes,jagosan/kubernetes,zhouhaibing089/kubernetes,sanjeevm0/kubernetes,tengqm/kubernetes,erwinvaneyk/kubernetes,GulajavaMinistud... | pkg/kubelet/dockershim/docker_streaming_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scanner\n\ntype FilterEntry string\n\ntype Filter []FilterEntry\n\ntype Directory struct {\n}\n\ntype Image struct {\n\tfilter Filter\n\ttopDirectory *Directory\n}\n\ntype Hash [64]byte\n\ntype ImageDataBase struct {\n\timageMap m... | go | edit | 3 | 1 | apache-2.0 | 315cf74ac2bb2627fcfadb220668f814086f6022 | Symantec/Dominator,keep94/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator | imageserver/scanner/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage godbg\n\nimport (\n\t\"os\"\n\t\"testing\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nfunc TestProject(t *testing.T) {\n\tConvey(\"Test buffers\", t, func() {\n\n\t\tConvey(\"By Default, equals to std\", func() {\n\t\t\tSo(... | go | edit | 27 | 1 | mit | c6ab2c976b4e081deeefdcae50bca13f02e32dcf | VonC/godbg | gogdb_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage coordinator\n\nimport (\n\t\"cluster\"\n\t\"protocol\"\n\t\"time\"\n)\n\n// duration 1h, 1d, 7d\n// split duration to n shards\n// if n > 1\n// hash using either random or series name\n\n// These are things that the Coordinator need (de... | go | edit | 0 | 0 | mit | f6583bc41affb9ca601af6f6a9ef5d169d186ffd | mnuessler/influxdb,stvnwrgs/influxdb,egymgmbh/influxdb,GoIncremental/influxdb,apigee/influxdb,ehagan/InfluxDB,Wikia/influxdb,IMCG/InfluxDB,archsaber/influxdb,bspline/influxdb,radcheb/influxdb,slachiewicz/influxdb,opavader/influxdb,kingland/influxdb,CrazyJvm/influxdb,josephcopenhaver/influxdb,Venu4thFeb/influxdb,GrimDer... | src/coordinator/sharding.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fnlog_test\n\nimport (\n\t\"github.com/northbright/fnlog\"\n\t\"log\"\n)\n\nfunc Example() {\n\tiLog := fnlog.New(\"i\")\n\twLog := fnlog.New(\"w\")\n\teLog := fnlog.New(\"e\")\n\tvar noTagLog *log.Logger = fnlog.New(\"\")\n\n\tiLog.Pri... | go | edit | 0 | 1 | mit | f261e1402662b73208365da6ae1022fe938f364b | vonwenm/fnlog | unit_test.go | rejected_duplicate | Near-duplicate of sample 116760 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service\n\nimport(\n \"github.com/brutella/hap/model/characteristic\"\n)\n\ntype LightBulb struct {\n *Service\n On *characteristic.On\n Name *characteristic.Name\n Brightness *characteristic.Brightness\n Saturation ... | go | edit | 9 | 1 | apache-2.0 | 85c36d6e5d4896943122bf8297470593e2265de6 | brutella/hc,ninjasphere/hc,savaki/hc,mxlje/hc,sjfloat/hc,bahlo/hc | model/service/light_bulb.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nvar Name string = \"developers-account-mapper\"\nvar Version string = \"0.1.0\"\n\n// GitCommit describes latest commit hash.\n// This value is extracted by git command when building.\n// To set this from outside, use go build -... | go | edit | 0 | 0 | mit | ac9b0363cc984d0c80f0fce658c100cd41e23042 | wantedly/developers-account-mapper | version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/dustin/go-humanize\"\n \"time\"\n \"strings\"\n)\n\nfunc HumanTime(time time.Time) string {\n original := humanize.Time(time)\n parts := strings.Split(original, \" \")\n return parts[0] ... | go | edit | 3 | 1 | mit | 153ce8b0a263edce819a5df534ff89a100c5454a | jacobmarshall/pokevision-cli,jacobmarshall/pokevision-cli | human_time.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage usb\n\nimport \"testing\"\n\nfunc BenchmarkCGo(b *testing.B) {\n\tfor _, bc := range []struct {\n\t\tname string\n\t\tbfunc func(*libusbContext, int)\n\t}{\n\t\t{\n\t\t\tname: \"simple function\",\n\t\t\tbfunc: func(ctx *libusbContext,... | go | edit | 24 | 2 | apache-2.0 | d5a81790687a6aeaa8fd89165ee6f90309061bee | google/gousb,bernhardgoedel/gousb,google/gousb,google/gousb,bernhardgoedel/gousb,bernhardgoedel/gousb | usb/libusb_cgo_benchmark_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage p5r\n\n// Compatability functions for the \"regexp\" package\n\n// MatchString return true if the string matches the regex\n// Returns false if an error/timeout occurs\nfunc (re *Regexp) MatchString(s string) bool {\n\tm, err := re.run(... | go | edit | 18 | 2 | mit | 99d8e90c90cee52e7369de0b83b216dd77f40f0f | xyproto/p5r | compat.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/codegangsta/negroni\"\n \"github.com/gorilla/mux\"\n \"gopkg.in/unrolled/render.v1\"\n \"net/http\"\n)\n\nvar printer = render.New(render.Options {\n Layout: \"layout\",\n IndentJSON: tr... | go | edit | 3 | 1 | mit | d8f2cbc648a4d5b97c4d4daf999f2a4a21f909de | glevine/burl | server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\nimport (\n\t\"errors\"\n\t\"strings\"\n)\n\n// MultiError implements error interface.\n// An instance of MultiError has zero or more errors.\ntype MultiError struct {\n\terrs []error\n}\n\n// Push adds an error to MultiError.\nfu... | go | edit | 0 | 2 | mit | 4531cf31257db14549af03dff989cc5c4bc55b55 | rShetty/multierror | multi_error.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage v7\n\nimport (\n\t\"code.cloudfoundry.org/cli/command/translatableerror\"\n)\n\ntype PasswdCommand struct {\n\tBaseCommand\n\n\tusage interface{} `usage:\"CF_NAME passwd\"`\n}\n\nfunc (cmd PasswdCommand) Execute(args []string) error {\n... | go | edit | 24 | 8 | apache-2.0 | 2354c5e2bb0c0132cd6f91d7f772fdce481d1950 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | command/v7/passwd_command.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/dmaj/docker-volume-netshare/netshare\"\n)\n\nvar VERSION string = \"\"\nvar BUILD_DATE string = \"\"\n\nfunc main() {\n\tnetshare.Version = VERSION\n\tnetshare.BuildDate = BUILD_DATE\n\tnetshare.Execute(... | go | edit | 0 | 1 | apache-2.0 | b7aa6b9916cfae8bb8f26e41569a6238809917cd | ContainX/docker-volume-netshare,ContainX/docker-volume-netshare | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Andrew E. Bruno. 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 nwalgo\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAlign(t *testing.T) {\... | go | edit | 6 | 4 | mit | 8c19d3d91c0cada73a884a9ea80379afae837d7b | aebruno/nwalgo | align_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage migrations\n\nimport (\n\t\"github.com/rubenv/sql-migrate\"\n)\n\nfunc addUuidColumnToEnvironmentConfigsTable() *migrate.Migration {\n\treturn &migrate.Migration{\n\t\tId: \"7\",\n\t\tUp: []string{`\n ALTER TABLE environment_config... | go | edit | 6 | 1 | mit | 2a00ba31cb80f52454d0e67269b8c71c4ef69dd0 | generationtux/brizo,generationtux/brizo,generationtux/brizo,generationtux/brizo,generationtux/brizo | database/migrations/7_addUuidColumnToEnvironmentConfigsTable.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pnet\n\nimport (\n\t\"io\"\n\n\tipnet \"github.com/libp2p/go-libp2p-interface-pnet\"\n)\n\nfunc NewProtector(input io.Reader) (ipnet.Protector, error) {\n\tpsk, err := decodeV1PSKKey(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n... | go | edit | 6 | 2 | mit | 1128a7c6249e54f53c7efb48e4334892d3155cf9 | ipfs/go-libp2p,libp2p/go-libp2p,libp2p/go-libp2p | p2p/net/pnet/entry.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage env\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"os\"\n)\n\ntype config struct {\n\tDatabase string `json:\"database\"`\n\tTelegram telegram `json:\"telegram\"`\n\tVK vk `json:\"vk\"`\n}\n\ntype telegram struct {\n\tW... | go | edit | 3 | 3 | mit | 86160af288c338d0b661a83c2f6da7da71b49777 | droptheplot/rand_chat,droptheplot/rand_chat,droptheplot/rand_chat,droptheplot/rand_chat | env/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Add test for gradient descent"
},
{
"role": "assistant",
"content": "package gradientdescent_test\n\nimport (\n\t\"github.com/amitkgupta/goodlearn/optimizer/gradientdescent\"\n\n\t\"errors\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"g... | go | new_file | 36 | 2 | mit | 6e7b35036bf2e4421b599a007e55858c9042ddc9 | amitkgupta/goodlearn | optimizer/gradientdescent/gradientdescent_test.go | rejected_lint | Too many lint violations: 36 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage errors\n\nimport \"fmt\"\n\ntype HttpError interface {\n\tError\n\tStatusCode() int\n\tHeaders() string\n\tBody() string\n}\n\ntype httpError struct {\n\tstatusCode int\n\theaders string\n\tbody string\n\tcode string\... | go | edit | 0 | 2 | apache-2.0 | 67f9a654b4fc460c345ccfc3d120b850aee56fee | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | src/cf/errors/http_error.go | rejected_duplicate | Near-duplicate of sample 117734 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport \"fmt\"\n\n// An EnsuredState represents some state that is needed in order for a function to execute.\ntype EnsuredState interface {\n\t// EnsureState will check if the state is active and activate it if that is not th... | go | edit | 0 | 6 | apache-2.0 | 127e43e56ff58c72b11fb9d03314c4a1bfb3ed15 | datawire/telepresence,datawire/telepresence,datawire/telepresence | pkg/client/ensured_state.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage minion\n\n// AllRoutes a shortcut to be used on the UnauthenticatedRoutes when\n// you want to have all your routes without jwt verification\nconst AllRoutes = \"^.*$\"\n\nfunc lastChar(str string) (lc uint8) {\n\tsize := len(str)\n\tif... | go | edit | 0 | 2 | mit | 39b5a22f7ffa4202be49945b1ae88159c0173f72 | ustrajunior/minion | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// repository.go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os/exec\"\n)\n\ntype Repository struct {\n\tID int `json:\"id\"`\n\tCloneURL string `json:\"clone_url\"`\n}\n\n// StartBuild executes a build on the Com... | go | edit | 0 | 2 | mit | 6243af12bb9893a06c0dd14ae166f34c0e8de4cb | Machiel/go-docker-builder,Machiel/go-docker-builder | repository.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lxc\n\nimport (\n\t\"fmt\"\n\t\"github.com/docker/libcontainer/namespaces\"\n\t\"github.com/docker/libcontainer/utils\"\n)\n\nfunc finalizeNamespace(args *InitArgs) error {\n\tif err := utils.CloseExecFrom(3); err != nil {\n\t\treturn e... | go | edit | 6 | 4 | apache-2.0 | 582a79f00a1d87ba0debd8f3785d867c02451e5f | ABaldwinHunter/docker,beatle/docker,charleszheng44/moby,maaquib/docker,icaoweiwei/docker,bq-xiao/docker,CodyGuo/docker,HuKeping/docker,insequent/docker,jameseggers/docker,johnstep/docker.github.io,kkirsche/docker,yummypeng/docker,yummypeng/docker,ideaar/docker,pmorie/docker,sallyom/docker,dmcgowan/docker,elancom/docker... | daemon/execdriver/lxc/lxc_init_linux.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\"github.com/bmorton/deployster/fleet\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\ntype UnitsResource struct {\n\tFleet fleet.Client\n}\n\ntype UnitsResponse struct {\n\tUnits []VersionedUnit `json:\"units\"`\n}... | go | edit | 6 | 2 | mit | 2abbb29dd1512f32a7f85347c3c9554afaced493 | bmorton/deployster | units_resource.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pes\n\ntype PacketChannel <-chan *Packet\n\nfunc (input PacketChannel) PayloadOnly() <-chan []byte {\n\toutput := make(chan []byte)\n\tgo func() {\n\t\tfor packet := range input {\n\t\t\toutput <- packet.Payload\n\t\t}\n\t\tclose(output... | go | edit | 3 | 2 | mit | c3901ea2ea5913c711f65f1f3b7fa9d9b5b356e5 | 32bitkid/mpeg | pes/packet_channel.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/alecthomas/kingpin\"\n\t_ \"github.com/cockroachdb/pq\"\n\t\"github.com/npotts/arduino/WxShield2/wxplot\"\n\t\"os\"\n)\n\nvar (\n\tapp = kingpin.New(\"wxPlot\", \"Plot data pulled from postgre... | go | edit | 0 | 1 | mit | 8699545aa50426be14a575f141a033bc4ac5232f | npotts/arduino,npotts/arduino,npotts/arduino,npotts/arduino,npotts/arduino | WxShield2/wxplot/wxPlot/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nameconstraints\n\nimport (\n\t\"encoding/asn1\"\n\n\t\"crypto/x509/pkix\"\n\n\t\"github.com/globalsign/certlint/certdata\"\n\t\"github.com/globalsign/certlint/checks\"\n\t\"github.com/globalsign/certlint/errors\"\n)\n\nconst checkName ... | go | edit | 0 | 3 | apache-2.0 | b020b690d15205c8fd40e87edbe6e6331a45be63 | globalsign/certlint | checks/extensions/nameconstraints/nameconstraints.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage converter\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"strings\"\n)\n\ntype KrSpaKa struct {\n\tcomma rune\n}\n\nfunc NewKrSpaKa() KrSpaKa {\n\treturn KrSpaKa{\n\t\tcomma: ';',\n\t}\n}\n\nfunc (k KrSpaKa) Comma() rune {\n\treturn k.comma\n}\n... | go | edit | 12 | 3 | mit | 7a906eef4368b725fce6c1a3011e2dc329516c78 | st3sch/whycc,st3sch/whycc | bankfile/converter/krspaka.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sub\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/filesystem\"\n\t\"github.com/Symantec/Dominator/lib/hash\"\n\t\"github.com/Symantec/Dominator/lib/triggers\"\n\t\"github.com/Symantec/Dominator/proto/common\"\n\t\"github.com/Symant... | go | edit | 0 | 0 | apache-2.0 | 2e3dc056df878fb0ee0c3718b7e1ede509fa6333 | rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator | proto/sub/messages.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage database\n\nimport (\n\t\"github.com/go-martini/martini\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// The Martini handler to use for injecting the database context\nfunc Middleware() martini.Handler {\n\tdb, err := OpenAndInit()\n\n\tif err != ... | go | edit | 3 | 2 | mit | 3d90a5b0a201b4a9aef0680d2910be0fb05ef0af | crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite | database/middleware.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package hashutil provides alloc free alternatives for pkg/hash\npackage hashutil\n\nfunc HashStringFnv64a(str string) uint64 {\n\th := NewInlineFNV64a()\n\th.WriteString(str)\n\treturn h.Sum64()\n}\n\n```\n\nApply this change: [hashutil][doc... | go | edit | 3 | 1 | mit | 91100e20169d61798d0fcd2ab631fc5448e809b8 | dyweb/gommon,dyweb/gommon,dyweb/gommon | util/hashutil/pkg.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage obj\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\n\t. \"github.com/polydawn/refmt/tok\"\n)\n\n// ErrInvalidUnmarshalTarget describes an invalid argument passed to UnmarshalDriver.Bind.\n// (Unmarshalling must target a non-nil pointer so that... | go | edit | 6 | 3 | mit | a2d14d4e98cb1620043c4ba868aad0e277ea41b4 | polydawn/refmt,polydawn/go-xlate,polydawn/go-xlate,polydawn/refmt | obj/errors.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fabric\n\nimport (\n\t\"context\"\n)\n\n// HandlerFunc defines the handler function for the server\ntype HandlerFunc func(context.Context, Conn) (context.Context, Conn, error)\n\n// NegotiatorFunc defines the negotiator functions for th... | go | edit | 9 | 0 | mit | b36483b7e15f8e905d4e38605d000665521ba097 | nimona/go-nimona,nimona/go-nimona,nimona/go-nimona,nimona/go-nimona | middleware.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\"github.com/labstack/echo\"\n\t\"net/http\"\n)\n\nfunc setupRoutes(e *echo.Echo) {\n\te.GET(\"/\", route_main)\n\te.GET(\"/search/:query\", route_search)\n}\n\nfunc route_main(c echo.Context) error {\n\treturn c.Str... | go | edit | 12 | 4 | mit | 0e9858422bd4db7f344a813ebe832705025f21e8 | anthonynguyen/mread,anthonynguyen/mread | route.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage util\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n)\n\nfunc openCommand() string {\n\tswitch runtime.GOOS {\n\tcase \"darwin\":\n\t\treturn \"open\"\n\tdefault:\n\t\treturn \"xdg-open\"\n\t}\n}\n... | go | edit | 0 | 4 | mit | d2165be69c2be3b528f816c52db19f045940f249 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmds/util/callbrowser.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !glib_deprecated\n\npackage glib\n\n// #include <gio/gio.h>\n// #include <glib.h>\n// #include <glib-object.h>\n// #include \"glib.go.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// DupSource is a wrapper around g_binding_dup_source().\nfu... | go | edit | 15 | 2 | isc | dcd7d0b4c61e204121f316665e7bc05efb1196b7 | gotk3/gotk3,gotk3/gotk3 | glib/gbinding_since_2_68.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main \n\nimport (\n \"net/http\"\n \"io/ioutil\"\n \"os\"\n \"log\"\n)\n\n\nfunc saveHandler(w http.ResponseWriter, r *http.Request) {\n\tfolder := \"/PRODUCTION/EXPERIMENT/web/savedfiles/\"\n filename := generateRandomUR... | go | edit | 9 | 3 | mit | 7cfbe3fd753f1e7cee6a86f130c5e1ec58947804 | elifkus/very-simple-service,elifkus/very-simple-service,elifkus/very-simple-service | src/webservice/server.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rest\n\nfunc compareEtag(etag, baseEtag string) bool {\n\tif etag == baseEtag {\n\t\treturn true\n\t}\n\tif l := len(etag); l == len(baseEtag)+2 && l > 3 && etag[0] == '\"' && etag[l-1] == '\"' && etag[1:l-1] == baseEtag {\n\t\treturn t... | go | edit | 0 | 7 | mit | 019c94bdfe2067142c48ce950e693d6eaaa10cf6 | rs/rest-layer | rest/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package deansify strips ANSI escape codes from either a named file or\n// from STDIN.\npackage deansify\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"regexp\"\n)\n\nvar version = \"0.0.2\"\nvar ansiRegexp = regexp.MustCompile(... | go | edit | 0 | 5 | mit | 8a951cf7c1e9d2ac5ad17892c6b760ea926ff643 | dpritchett/deansify,dpritchett/deansify | deansify.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage typetalk\n\nimport (\n\t\"errors\"\n\t\"github.com/Sirupsen/logrus\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\nconst (\n\tVERISON = \"1.0.0\"\n)\n\ntype TypetalkHook struct {\n\tAcceptedLevels []logrus.Level\n\tBotURL string\n}\n\nfu... | go | edit | 3 | 3 | mit | 3c1c4e9db1a0ba2e1f5947ed1cb3a7f2b1e7cb1d | dragon3/logrus-typetalk-hook | typetalk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage awsSdkGo\n\nimport (\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/autoscaling\"\n\t\"github.com/aws/aws-sdk-go/service/ec2\"\n\t\"github.com/aws/aws-sdk-go/serv... | go | edit | 0 | 2 | apache-2.0 | 5a003f0a067cde6e6b0f0fd9b0d7ba13444670b6 | kris-nova/kubicorn,k4k/kubicorn,kris-nova/kubicorn,k4k/kubicorn | cloud/amazon/awsSdkGo/sdk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage builder\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/openshift/origin/pkg/build/builder/cmd\"\n)\n\nconst longCommandSTIDesc = `\nPerform a Source-to-Image Build\n\nThis command executes a Source-to-Image bui... | go | edit | 0 | 1 | apache-2.0 | eeea7906918ed8e4a5e16272d7e439390df7fde5 | robertol/origin,jupierce/origin,hferentschik/origin,dmage/origin,yepengxj/df,jsafrane/origin,quantiply-fork/origin,biyiklioglu/origin,maleck13/origin,PI-Victor/origin,mrunalp/origin,hingstarne/origin,spinolacastro/origin,mingderwang/origin,gashcrumb/origin,mrogers950/origin,smarterclayton/origin,pkdevbox/origin,Nick-Ha... | pkg/cmd/infra/builder/builder.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage term\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n)\n\nfunc Clear() {\n\tvar cmd *exec.Cmd\n\tswitch os := runtime.GOOS; os {\n\tcase \"linux\":\n\t\tcmd = exec.Command(\"clear\")\n\tcase \"windows\":\n\t\tcmd = exec.Command(\"c... | go | edit | 3 | 3 | bsd-3-clause | 8b4d7b298ed528544e88f601ce92f4a1caac8f99 | d-bf/client,d-bf/client | term/term.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sqs\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/goadapp/goad/api\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc init() {\n}\n\nfunc TestAdapterConstruction(t *testing.T) {\n\tconf... | go | edit | 3 | 1 | mit | b6068a081e1a42cb6fdecc0bc1ff3df000031c9d | goadapp/goad,goadapp/goad,goadapp/goad | infrastructure/aws/sqs/sqsadapter_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage storage\n\nimport (\n\t\"os\"\n\n\t\"github.com/hnakamur/api2go-gorm-gin-crud-example/model\"\n\t\"github.com/jinzhu/gorm\"\n)\n\nfunc InitDB() (*gorm.DB, error) {\n\tdb, err := gorm.Open(os.Getenv(\"DB_DIALECT\"), os.Getenv(\"DB_PARAMS... | go | edit | 0 | 2 | mit | 03f0a64c65b93bb5a9cffc3097cb4f927cfa62f9 | pawmart/api2go-gin-gorm,pawmart/api2go-gin-gorm,hnakamur/api2go-gorm-gin-crud-example,hnakamur/api2go-gorm-gin-crud-example | storage/db.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage action\n\nimport (\n\tboshcomp \"github.com/cloudfoundry/bosh-agent/agent/compiler\"\n\tboshcrypto \"github.com/cloudfoundry/bosh-utils/crypto\"\n)\n\ntype CompilePackageWithSignedURLRequest struct {\n\tSignedURL string `json:\"signed_u... | go | edit | 0 | 1 | apache-2.0 | 95843c93cfab657ee8972509409a37054cdd2c2e | mattcui/bosh-agent,mattcui/bosh-agent,cloudfoundry/bosh-agent,gu-bin/bosh-agent,mattcui/bosh-agent,gu-bin/bosh-agent,gu-bin/bosh-agent,cloudfoundry/bosh-agent | agent/action/compile_package_with_signed_url.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage buffer\n\nimport (\n\t\"strings\"\n\n\tlog \"github.com/golang/glog\"\n\n\t\"github.com/youtube/vitess/go/vt/vterrors\"\n\n\tvtrpcpb \"github.com/youtube/vitess/go/vt/proto/vtrpc\"\n)\n\n// This function is in a separate file to make it... | go | edit | 0 | 7 | apache-2.0 | c5a6b9f60c0cf2b3a12e3df8989a229484d42872 | rnavarro/vitess,tirsen/vitess,rnavarro/vitess,rnavarro/vitess,HubSpot/vitess,davygeek/vitess,enisoc/vitess,tirsen/vitess,vitessio/vitess,dcadevil/vitess,alainjobart/vitess,mattharden/vitess,HubSpot/vitess,tirsen/vitess,mattharden/vitess,vitessio/vitess,enisoc/vitess,vitessio/vitess,pivanof/vitess,dcadevil/vitess,dcadev... | go/vt/vtgate/buffer/check_error_opensource.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nom\n\nimport (\n\t\"encoding/gob\"\n\t\"time\"\n)\n\n// NodeQuery queries the information of a node.\ntype NodeQuery struct {\n\tNode UID\n}\n\n// NodeQueryResult is the result for NodeQuery.\ntype NodeQueryResult struct {\n\tErr erro... | go | edit | 21 | 1 | apache-2.0 | 8350e81f8f574adfca1112ae26b2f38fa0587a96 | soheilhy/beehive-netctrl,kandoo/beehive-netctrl | nom/query.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage force\n\nimport (\n\t\"fmt\"\n)\n\n// Custom Error to handle salesforce api responses.\ntype ApiErrors []*ApiError\n\ntype ApiError struct {\n\tFields []string `json:\"fields,omitempty\" force:\"fields,omitempty\"`\n\tMessage ... | go | edit | 0 | 6 | mit | 0db9a9e40e2299bbf2fcc97b16f2dd2469edc58d | sarahyablok/go-force,coreos/go-force,nimajalali/go-force,omniprojects/go-force,ecnahc515/go-force,egtann/go-force | force/error.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ss13\n\nimport (\n\t\"log\"\n\t\"time\"\n)\n\nvar (\n\tnow = time.Now()\n\tdebugging bool = false\n)\n\nfunc log_error(err error) {\n\tif err != nil {\n\t\tlog.Panic(\"WARNING \", err)\n\t}\n}\n\nfunc check_error(err error) {... | go | edit | 0 | 2 | mit | a91ba8a5dd44892adef1afea347bfbf352bc7e0f | lmas/ss13_se | src/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage discountcalculator\n\ntype discountCalculator struct {\n\tstrategy func() (rate float64, strategyCode int)\n\tstrategyCode int\n}\n\nfunc New() *discountCalculator {\n\treturn &discountCalculator{}\n}\n\nfunc (calculator *discountCa... | go | edit | 33 | 5 | mit | a810920f7ff0f7bea0b597e2e3d3a8cf1e0b5888 | ihcsim/go101,ihcsim/golang-tutorial | discountcalculator/discountcalculator.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage retry\n\nimport (\n\t\"time\"\n)\n\n// Func is the function to retry returning true if it's successfully completed\ntype Func = func() bool\n\n// Do retries provided function \"attempts\" times with provided interval and returning true ... | go | edit | 0 | 0 | apache-2.0 | c641bba3196a7dc345fea05036d5ca9c2f95aadb | Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi,Aptomi/aptomi | pkg/util/retry/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rapi_test\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"github.com/waltzofpearls/relay-api/rapi\"\n)\n\nfun... | go | edit | 0 | 1 | mit | 598310d7ba550f65f475734cb5b624343f0ef387 | waltzofpearls/relay-api | rapi/endpoint_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jiradata\n\nimport (\n\t\"strings\"\n)\n\n// Find will search the transitions for one that matches\n// the given name. It will return a valid trantion that matches\n// or nil\nfunc (t Transitions) Find(name string) *Transition {\n\tnam... | go | edit | 0 | 5 | apache-2.0 | a646f76b1f34d5e94a474720beab4c3396fffd83 | Netflix-Skunkworks/go-jira,Netflix-Skunkworks/go-jira,Netflix-Skunkworks/go-jira,go-jira/jira,go-jira/jira | jiradata/TransitionsFuncs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sys\n\n/*\n#include <unistd.h>\n\nint f(int fd, pid_t pid) {\n\treturn tcsetpgrp(fd, pid);\n}\n*/\nimport \"C\"\nimport \"syscall\"\n\nfunc Tcsetpgrp(fd int, pid int) error {\n\ti := syscall.Errno(C.f(C.int(fd), C.pid_t(pid)))\n\tif i !... | go | edit | 0 | 2 | bsd-2-clause | 1f1e739ef21f8c63ebb997f935b3a4e34dbf2da1 | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | sys/tc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cloudfoundry/bosh-bootloader/flags\"\n\t\"github.com/cloudfoundry/bosh-bootloader/storage\"\n)\n\ntype FilteredDeleter interface {\n\tDelete(filter string) error\n}\n\ntype CleanupLeftov... | go | edit | 3 | 4 | apache-2.0 | c312d0485f02b60b412a41394f98dd8d45a4576c | pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | commands/cleanup_leftovers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nvim\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/garyburd/neovim-go/vim\"\n)\n\nfunc Echomsg(v *vim.Vim, format string, args ...interface{}) error {\n\treturn v.WriteOut(fmt.Sprintf(format, args...))\n}\n\nfunc Echoerr(v *vim.Vim, format s... | go | edit | 0 | 1 | bsd-3-clause | 3db7a9e89ee1b2195437eed89b7f18ce43915f87 | zchee/nvim-go,zchee/nvim-go | src/nvim-go/nvim/command.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage copy\n\nimport (\n\t\"strings\"\n)\n\n// Use the object Meta from files (move to other file?)\n\ntype LinkService struct {\n\tclient *Client\n}\n\nvar (\n\t// Links paths\n\tlinksTopLevelSuffix = \"links\"\n\tlinksGetSuffix = strin... | go | edit | 18 | 1 | mit | 645ef489efa037919f4f1c90129a8cd5a831a0c9 | slok/go-copy | copy/links.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage divsd\n\n// The top configuration structure for the DiVS daemon\ntype Config struct {\n\tGlobal globalConfig\n\tRaft raftConfig\n\tDiscover discoverConfig\n\tMdns mdnsConfig\n\tTun tunConfig\n}\n\n// Global config\ntype g... | go | edit | 3 | 1 | mit | ae4d399cfce162f6b8b5f0fa9fe902239cf6f9f4 | inercia/divs | divsd/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ambition\n\nimport (\n\t\"encoding/json\"\n)\n\nfunc PostOccurrenceByActionIdJson(ActionId int, occurrenceJson []byte) error {\n\tvar occurrence Occurrence\n\terr := json.Unmarshal(occurrenceJson, occurrence)\n\n\toccurrence.ActionId = ... | go | edit | 24 | 2 | unlicense | ab1b4bf8697a7ddc84a23407beea7cb8ef9593e0 | lelandbatey/ambition,lelandbatey/ambition,lelandbatey/ambition | jsonHandler.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage game\n\ntype EventType uint8\n\nconst (\n\tEventTypeError EventType = iota\n\tEventTypeObjectCreate\n\tEventTypeObjectDelete\n\tEventTypeObjectUpdate\n\tEventTypeObjectChecked\n)\n\ntype Event struct {\n\tType EventType\n\tPayload in... | go | edit | 0 | 2 | bsd-2-clause | c9f22a6baed84ae48fc91a326f4a0fc4b4a1b596 | ivan1993spb/clever-snake | game/event.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\nfunc TestLineBreaking(t *testing.T) {\n\tlog.SetLevel(log.DebugLevel)\n\n\tvar tests = []struct {\n\t\ttext string\n\t\tresult string\n\t}{\n\t\t{\n\t\t\t`\... | go | edit | 3 | 3 | mit | db1a85cd360a55632d78df9c5e3aad4ec765eeb5 | softashell/rpgmaker-patch-translator | text_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage net\n\nimport (\n\t\"time\"\n)\n\nfunc newMeasuringDialer(dialer Dialer) *MeasuringDialer {\n\treturn &MeasuringDialer{dialer: dialer}\n}\n\nfunc (d *MeasuringDialer) Dial(network, address string) (\n\t*MeasuringConnection, error) {\n\t... | go | edit | 18 | 2 | apache-2.0 | 0ad017c5d5b4a85a1a43f783c093d566ac076566 | Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator | lib/net/measuringDialer.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tif len(os.Args) != 3 {\n\t\tlog.Fatalf(\"Usage: %s data_file pattterns_file\", os.Args[0])\n\t}\n\n\tdataFile, err := os.Open(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatalf(\"... | go | edit | 3 | 4 | mit | 7aa75fc746a579e91feb3ec0e9a8c1e42cf3b0a0 | mtojek/oi | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rpcd\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/filter\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"github.com/Symantec/Dominator/proto/sub\"\n)\n\nfunc (t *rpcType) SetConfiguration(conn *srpc.Conn,\n\trequest sub.SetCo... | go | edit | 3 | 2 | apache-2.0 | d2e80daca0de30a0fc9c8821b0b7610d272a231c | rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator | sub/rpcd/setConfiguration.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"fmt\"\n\n\t\"encoding/json\"\n\n\t\"github.com/google/go-github/github\"\n\t\"golang.org/x/oauth2\"\n)\n\nvar Configuration = Config{}\n\nfunc main() {\n\tConfiguration = Configuration.I... | go | edit | 6 | 7 | mit | 39a071aa01998a4efc4a36b8737909fef3f2d968 | HippieStation/PRMirror | main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage base\n\n// OpaqueProxyFlyweight enables implementation of its eponymous design pattern. You need lots of\n// objects, but creating them is expensive. You want to externalize state, but your object is opaque\n// (you access it through an... | go | edit | 0 | 0 | mit | dc89120829d2b94286cae348df6bea5c837ae57a | johnny-morrice/webdelbrot-static,johnny-morrice/webdelbrot,johnny-morrice/webdelbrot-static,johnny-morrice/webdelbrot,johnny-morrice/godelbrot | src/functorama.com/demo/base/opaqueproxyflyweight.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (C) 2017 Google Inc.\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... | go | edit | 33 | 4 | apache-2.0 | 5789101f3be0afefd58c7aa0d5496b47a9488ad3 | dsrbecky/gapid,google/agi,google/gapid,google/gapid,google/agi,dsrbecky/gapid,pmuetschard/gapid,ek9852/gapid,pmuetschard/gapid,baldwinn860/gapid,Qining/gapid,ek9852/gapid,ben-clayton/gapid,google/gapid,Qining/gapid,baldwinn860/gapid,pmuetschard/gapid,pmuetschard/gapid,ben-clayton/gapid,ben-clayton/gapid,google/agi,ek98... | gapis/gfxapi/gles/vertex_attribute_array.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage retention\n\nimport (\n\t\"time\"\n\n\t\"github.com/influxdb/influxdb/toml\"\n)\n\ntype Config struct {\n\tEnabled bool `toml:\"enabled\"`\n\tCheckInterval toml.Duration `toml:\"check-interval\"`\n}\n\nfunc NewConfig() Co... | go | edit | 0 | 1 | mit | d771612718b65bd4b78609c4596246449fbe3ccd | benbjohnson/influxdb,tommymei/influxdb,CVTJNII/influxdb-tjnii,nooproblem/influxdb,imcom/influxdb,Venu4thFeb/influxdb,runcom/influxdb,toorop/influxdb,influxdb/influxdb,runcom/influxdb,pablolmiranda/influxdb,nckturner/influxdb,jipperinbham/influxdb,otoolep/influxdb,pkittenis/influxdb,toorop/influxdb,nckturner/influxdb,sa... | services/retention/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage engine\n\nimport (\n\t\"os/exec\"\n\n\tlog \"github.com/sirupsen/logrus\"\n)\n\n// OpenURL tries to open an URL with the system browser\nfunc (ac *Config) OpenURL(host, colonPort string, httpsPrefix bool) {\n\tif host == \"\" {\n\t\thos... | go | edit | 3 | 3 | bsd-3-clause | 9885f7c948fb4b76a7def7ef77083666e8d5cd1a | xyproto/algernon,xyproto/algernon,xyproto/algernon,xyproto/algernon | engine/url.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\"io/ioutil\"\n\t\"os\"\n)\n\ntype config struct {\n\tcontrollerKey string\n\tourPort string\n\tlogOut io.Writer\n}\n\nfunc loadConfigFromEnv() (*config, error) {\n\tc := &config{}\n... | go | edit | 0 | 6 | bsd-3-clause | 405ffed173eae9eea616acbad33565b5a5a035c0 | pkdevbox/flynn,kgrz/flynn,flynn/flynn,justintung/flynn,shads196770/flynn,TribeMedia/flynn,technosophos/flynn,philiplb/flynn,benbjohnson/flynn,GrimDerp/flynn,jzila/flynn,tonicbupt/flynn,tonicbupt/flynn,benbjohnson/flynn,felixrieseberg/flynn,shads196770/flynn,Brandywine2161/flynn,flynn/flynn,Brandywine2161/flynn,benbjohn... | controller/examples/config.go | rejected_duplicate | Near-duplicate of sample 118074 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/gholt/brimtext\"\n\t\"github.com/gholt/ring\"\n)\n\nfunc main() {\n\ti := -1\n\tfor j, v := range os.Args {\n\t\tif v == \"--no-color\" {\n\t\t\ti = j\n\t\t\tbreak\n\t\t}\n\t}\n\ti... | go | edit | 0 | 5 | bsd-3-clause | b4ae1a81edfe3c051bfd90c9d34d574c6a906f65 | pandemicsyn/ring,gholt/ring | ring/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage feature\n\nimport (\n\t\"sync\"\n)\n\nvar onlyonce sync.Once\nvar protect chan int\nvar singleton *Feature\n\nfunc getSingleton() (r *Feature) {\n onlyonce.Do(func() {\n \tsingleton = New()\n })\n\treturn singleton\n}\n\n// Cle... | go | edit | 9 | 1 | bsd-3-clause | 94ccbefcd4f98949222f061032b192563eb76d7e | cention/ferite-module-webframework,cention/ferite-module-webframework,cention/ferite-module-webframework | go/src/c3/feature/singleton.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tusd_test\n\nimport (\n\t\"github.com/tus/tusd\"\n\t\"github.com/tus/tusd/consullocker\"\n\t\"github.com/tus/tusd/filestore\"\n\t\"github.com/tus/tusd/limitedstore\"\n)\n\nfunc ExampleNewStoreComposer() {\n\tcomposer := tusd.NewStoreCom... | go | edit | 0 | 1 | mit | 5fceb7eb772c8fa1a50bbbc828da748c1e7232af | tus/tusd,tus/tusd | composer_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"log\"\n\t\"os\"\n)\n\ntype host struct {\n\tname string\n\tprotocol string\n\tendpoint string\n}\n\nvar hosts []host\n\n// readHosts reads in hosts from a file and populates hosts []hos... | go | edit | 0 | 4 | mit | 63dfe5fa377844a5e2fca137bc9ab8d0562ddc38 | wgjohnson/chooch | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"github.com/julienschmidt/httprouter\"\n\t\"github.com/raggaer/castro/app/util\"\n\t\"net/http\"\n)\n\nfunc ExtensionStatic(w http.ResponseWriter, req *http.Request, ps httprouter.Params) {\n\t// Get extensio... | go | edit | 0 | 5 | mit | 03d53d7265e2f1a708d7e560f6a2d0e1a5fa0b6b | Raggaer/castro,Raggaer/castro,Raggaer/castro | app/controllers/static.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.