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 main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\ttransmission \"github.com/metalmatze/transmission-exporter\"\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\nconst (\n\tpath string = \"/metrics\"\n\taddr string = \":19091\"\... | go | edit | 3 | 1 | mit | c131b0b4397f177324d693b09759eea007b8c41e | metalmatze/transmission-exporter | cmd/transmission-exporter/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nvar agentBinary string\n\n// This init compiles a bootstrap to be invoked by the bootstrap tester\n// ... | go | edit | 0 | 3 | mit | afa6221178a5ceb0ff20a9232307d183f264ae0f | buildkite/agent,buildkite/agent,buildkite/agent | bootstrap/integration/main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service\n\nimport \"github.com/containerum/kube-client/pkg/model\"\n\ntype ServiceList []Service\n\nfunc ServiceListFromKube(kubeList model.ServicesList) ServiceList {\n\tvar list ServiceList = make([]Service, 0, len(kubeList.Services))... | go | edit | 12 | 4 | mit | f527e9ddd72dd7995afac6bab46c7ec1d15b5437 | containerum/chkit,containerum/chkit | pkg/model/service/list.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage index\n\nimport (\n\t\"database/sql\"\n\t\"html/template\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/concourse/atc\"\n\t\"github.com/concourse/atc/db\"\n\t\"github.com/pivotal-golang/lager\"\n)\n\ntype TemplateData struct{}\n\nfunc N... | go | edit | 0 | 4 | apache-2.0 | 3d5157391c693f892c9c25eeebb5fef4ac83cd81 | simonjjones/atc,pivotal-devin-fallak/atc,zachgersh/atc,zachgersh/atc,savaki/atc,zachgersh/atc,savaki/atc,utako/atc,simonjjones/atc,savaki/atc,utako/atc,pivotal-devin-fallak/atc,pivotal-devin-fallak/atc,simonjjones/atc,zachgersh/atc,utako/atc | web/index/handler.go | rejected_duplicate | Near-duplicate of sample 116850 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport \"github.com/labstack/echo\"\n\n// GetProjectID returns projectID for current HTTP request\nfunc GetProjectID(c echo.Context) int64 {\n\treturn c.Get(\"projectID\").(int64)\n}\n\n```\n\nApply this change: Use safe type ass... | go | edit | 0 | 2 | mit | bdad1a9d5e902c11f0854bbc61a1e4e8136c9bba | diyan/assimilator,diyan/assimilator,diyan/assimilator | api/endpoints/context_helpers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage sentences is a golang package will convert a blob of text into a list of sentences.\n\nThis package attempts to support a multitude of languages:\nczech, danish, dutch, english, estonian, finnish,\nfrench, german, greek, italian, no... | go | edit | 0 | 0 | mit | 50edc3655ef91f22de01ba122a09f722557fa469 | neurosnap/sentences,neurosnap/sentences | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage index\n\nimport (\n\t\"database/sql\"\n\t\"html/template\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/concourse/atc\"\n\t\"github.com/concourse/atc/db\"\n\t\"github.com/pivotal-golang/lager\"\n)\n\ntype TemplateData struct{}\n\nfunc N... | go | edit | 0 | 4 | apache-2.0 | 3d5157391c693f892c9c25eeebb5fef4ac83cd81 | simonjjones/atc,pivotal-devin-fallak/atc,zachgersh/atc,zachgersh/atc,savaki/atc,zachgersh/atc,savaki/atc,utako/atc,simonjjones/atc,savaki/atc,utako/atc,pivotal-devin-fallak/atc,pivotal-devin-fallak/atc,simonjjones/atc,zachgersh/atc,utako/atc | web/index/handler.go | rejected_duplicate | Near-duplicate of sample 116850 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/gordonklaus/portaudio\"\n)\n\nconst playBufferSize = 8192\n\nfunc playTune(tune []int32, sampleRate float64) error {\n\terr := portaudio.Initialize()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer port... | go | edit | 0 | 7 | bsd-2-clause | 7c89dc46f539fe69588b2721f03875624ac455da | draringi/synthia | play.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nvar (\n\t// Whitelist crawlers here\n\tcrawlerPatterns = [...]string{\n\t\t\"Googlebot\",\n\t\t\"bingbot\",\n\t\t\"MSNbot\",\n\t\t\"facebookexternalhit\",\n\t\t\"PlurkBot\",\n\t\t\"T... | go | edit | 0 | 3 | mit | 95d18b713432aa052b3d2cdc8a71d63482127875 | ptt/pttweb | useragent.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage signaller\n\nimport (\n\t\"fmt\"\n)\n\n// NotifySource indicates what mechanism triggered the event.\ntype NotifySource int\n\n// String provides a printable representation of a NotifySource.\nfunc (ns NotifySource) String() string {\n\... | go | edit | 0 | 4 | bsd-2-clause | 73367ff68093dfddc3bf4ecafed31853d0867375 | mredivo/pulldeploy,mredivo/pulldeploy | signaller/notification.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage settings\n\nimport (\n\t\"io/ioutil\"\n\t\"upper.io/db\"\n\t\"upper.io/db/mysql\"\n)\n\n// CHANGE IN PRODUCTION\n// KEEP SECRET!!!\nvar SecretKey = \"dongLyfe420\"\n\nvar Themes = [...]string{\"material\", \"space\"}\n\nvar dbsettings =... | go | edit | 3 | 3 | bsd-2-clause | e3b45696e080e7f51f1fcf0e0881200e83a256fd | marcusant/Lambda-Go,marcusant/Lambda-Go,mstojcevich/Lambda-Go,mstojcevich/Lambda-Go,marcusant/Lambda-Go,mstojcevich/Lambda-Go | settings/settings.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage p01\n\nimport (\n\t\"fmt\"\n\t\"common\"\n)\n\nfunc Solve(input string) (string, string) {\n\treturn solve(input, 1), solve(input, len(input)/2)\n}\n\nfunc solve(input string, lookahead int) string {\n\tsum := 0\n\tfor i := 0; i < len(i... | go | edit | 0 | 3 | apache-2.0 | e3fe637d6d2c21d7027982ccd220345a6acbee11 | shaeberling/euler,shaeberling/euler,shaeberling/euler,shaeberling/euler | go/src/aoc17/problems/p01/p01.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage collectors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/mjibson/snmp\"\n)\n\n// snmp_subtree takes an oid and returns all data exactly one level below it. It\n// produces an error if there is more than one level below.\nfunc snmp_... | go | edit | 6 | 8 | mit | 6c463461d2ffecfcf911bf0915bdf44144fb698b | couchand/bosun,bosun-sharklasers/bosun,dieface/bosun,bridgewell/bosun,dimamedvedev/bosun,couchand/bosun,briantist/bosun,seekingalpha/bosun,objStorage/bosun,mxk1235/bosun,bosun-monitor/bosun,madhukarreddy/bosun,jareksm/bosun,bridgewell/bosun,youngl98/bosun,shanemadden/bosun,augporto/bosun,couchand/bosun,bosun-sharklaser... | cmd/scollector/collectors/snmp.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"mime\"\n\t\"net/http\"\n\t\"path\"\n\t\"path/filepath\"\n\n\t\"github.com/facette/facette/pkg/logger\"\n)\n\nfunc (server *Server) serveError(writer http.ResponseWriter, status int) {\n\terr := server.execTemplat... | go | edit | 6 | 2 | bsd-3-clause | d77e77680d52d232305d0f12af6e3e1c857903cb | facette/facette,vovkasm/facette,facette/facette,vovkasm/facette,facette/facette,vovkasm/facette,facette/facette | pkg/server/handler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n \"fmt\"\n \"github.com/spf13/cobra\"\n \"github.com/spf13/viper\"\n \"os\"\n)\n\nvar Vebose bool = false\nvar cfgFile string\n\nvar RootCmd = &cobra.Command{\n Short: \"Proj simplifies local development ... | go | edit | 0 | 3 | mit | 9d9132668ae3d395940c3c67c4c23265c48f9c92 | SolidWorx/ProJ | cmd/root.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nvar (\n\tproblemTemplate = `/*\n{{problem_description}}\n*/\npackage main\n\nimport \"github.com/jacobhands/pu\"\n\nvar (\n\tanswer = \"NA\" // Change to correct answer once solved.\n\tproblem = pu.Problem{\n\t\tID: ... | go | edit | 0 | 0 | mit | e6c27b2b8f76e5d664752aa5487169981756a5bc | jacobhands/pu | euler/templates.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n)\n\ntype offsetTest struct {\n\tdata []byte\n\toffset int\n\tbyteOffset int\n}\n\nvar offsetTests = []offsetTest{\n\toffsetTest{[]byte(\"abcdef\"), 0, 0},\n\toffsetTest{[]byte(\"a... | go | edit | 3 | 4 | bsd-2-clause | 8161abe1e7aaa6bfbdf87f6e635c8ba73c731701 | davidrjenni/agorn | agorn_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage markdown\n\nimport \"strings\"\n\nfunc isTerminatorChar(ch byte) bool {\n\t... | go | edit | 3 | 5 | bsd-2-clause | b90e4837fbb0c1c1be17a712e3390beef9015057 | golang-commonmark/markdown | text.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rpcd\n\nimport (\n\t\"encoding/gob\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"github.com/Symantec/Dominator/proto/objectserver\"\n)\n\nfunc (t *srpcType) CheckObjects(conn *srpc.Conn) error {\n\tvar request objectserver.CheckO... | go | edit | 3 | 2 | apache-2.0 | 3a361cb00c620e78cf4b6ab11976b862621723fb | rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator | objectserver/rpcd/checkObjects.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"io\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/kr/pty\"\n)\n\ntype Command struct {\n\tcommand string\n\targs []string\n}\n\nfunc NewCommand(command string, args ...string) Command {\n\treturn Command{comm... | go | edit | 3 | 3 | mit | 1d4341684f3124ce06f061929a512b31b7c57216 | hansrodtang/runcom,hansrodtang/runcom | core/exec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage persistence\n\nimport \"github.com/gogo/protobuf/proto\"\n\ntype NoSnapshotSupport struct {\n}\n\nfunc (provider *NoSnapshotSupport) GetSnapshotInterval() int {\n\treturn 0 //snapshotting is disabled\n}\n\nfunc (provider *NoSnapshotSupp... | go | edit | 0 | 2 | apache-2.0 | 7f750bd33ce9cd8eab697bd7c19cd2a19f4a6e05 | AsynkronIT/gam,AsynkronIT/protoactor-go,AsynkronIT/protoactor-go,rogeralsing/gam,Huawei-PTLab/protoactor-go,Huawei-PTLab/protoactor-go,AsynkronIT/gam | persistence/in_memory_provider.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build ignore\n\npackage main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar err error\n\n\tvar cmd = exec.Command(\"git\", \"describe\")\n\tvar out []byte\n\tout, err = cmd.CombinedOutput()\n\tif err != nil {... | go | edit | 0 | 4 | cc0-1.0 | 863b50faafe3f20297ec824f9c8c58c1c5dd0cf0 | uoregon-libraries/rais-image-server,uoregon-libraries/rais-image-server,uoregon-libraries/rais-image-server,uoregon-libraries/rais-image-server | src/version/gen.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vivoupdater\n\ntype BatchIndexer interface {\n\tName() string\n\tIndex(b map[string]bool) (map[string]bool, error)\n}\n\nfunc IndexBatch(ctx Context, i BatchIndexer, b map[string]bool) {\n\tib, err := i.Index(b)\n\tif err != nil {\n\t\t... | go | edit | 3 | 2 | mit | c99d5b2f83d87f24892841a0f21638753e753fc2 | OIT-ADS-Web/vivoupdater,OIT-ADS-Web/vivoupdater | src/vivoupdater/batch_indexer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net\"\n\t\"runtime\"\n\t\"sync/atomic\"\n)\n\nconst (\n\tBufSize = 256\n)\n\n// Copy data between two connections. Return EOF on connection close.\nfunc Pipe(a, b net.Conn) error {\n\tdone := make(chan error)\n\tva... | go | edit | 3 | 5 | bsd-3-clause | 5e53e3dd7de0df7b2426d14aff333f0d940e1694 | BlueDragonX/go-proxy-example | pipe.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage keys_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/kezhuw/leveldb/internal/keys\"\n)\n\ntype sequenceTest struct {\n\tseq keys.Sequence\n\tnext uint64\n\twant keys.Sequence\n}\n\nvar sequenceTests = []sequenceTest{\n\t{\n\t\tseq: ... | go | edit | 0 | 3 | mit | 054a9a6159d2d77ece3d249c88bd198891f6ff11 | kezhuw/leveldb,kezhuw/leveldb | internal/keys/sequence_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The http2amqp Authors. All rights reserved. Use of this\n// source code is governed by a MIT-style license that can be found in the\n// LICENSE file.\n\npackage queries_service\n\ntype Id int\n\ntype IdsRepository interface {... | go | edit | 0 | 1 | mit | 64e261132ad277dad02b866bdf66b07ec979d1be | aleasoluciones/http2amqp,aleasoluciones/http2amqp | queries_service/ids_repository.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bamstats\n\nimport (\n\t\"bufio\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc max(a, b uint32) uint32 {\n\tif a < ... | go | edit | 0 | 2 | bsd-3-clause | fbb0d707577616c12a770c5b82d84b401832e500 | guigolab/bamstats,guigolab/bamstats | utils.go | rejected_duplicate | Near-duplicate of sample 116929 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage manifestparser\n\nimport \"errors\"\n\ntype Application struct {\n\tName string `yaml:\"name\"`\n\tData map[string]interface{}\n}\n\nfunc (application Application) MarshalYAML() (interface{}, error) {\n\treturn application.Data, nil\n}\... | go | edit | 0 | 3 | apache-2.0 | 80b65c7a5bc3b61147e338e242655c3d31ba9ba0 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | util/manifestparser/application.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/container-storage-interface/spec/lib/go/csi\"\n)\n\nvar getCapacity struct {\n\tcaps volumeCapabilitySliceArg\n}\n\nvar getCapacityCmd = &cobra.... | go | edit | 0 | 1 | apache-2.0 | 9b7b65e49057b0baf39c96426f22b1d9d17a17e8 | akutz/gocsi,akutz/gocsi | csc/cmd/controller_get_capacity.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage exec\n\nimport (\n \"bufio\"\n \"os/exec\"\n \"testing\"\n)\n\nfunc TestSimpleRead(t *testing.T) {\n command := exec.Command(\"echo\", \"hoge\", \"piyo\")\n command_output, _ := command.Output()\n actual := string(command_output)\... | go | edit | 3 | 4 | mit | 2f53b95e6c61e2e08e23ac3f8086b11a8f86b718 | imos/go-samples | exec/exec_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/**\n * Copyright 2018 Comcast Cable Communications Management, LLC\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 ... | go | edit | 0 | 2 | apache-2.0 | 30637533818f789dffa39a51ce191484b026eee8 | Comcast/caduceus,Comcast/caduceus | src/caduceus/simpleCounter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"github.com/gsamokovarov/jump/cli\"\n)\n\nfunc Example_helpCmd() {\n\t_ = helpCmd(cli.Args{}, nil)\n\n\t// Output:\n\t// Usage: jump [COMMAND ...]\n\t//\n\t// Jump to a fuzzy-matched directory passed as an argument.\... | go | edit | 3 | 1 | mit | c2ff1a0a00e8c67c5d53e9b6e5a590ce3cd8e3cb | gsamokovarov/jump | cmd/help_test.go | rejected_duplicate | Near-duplicate of sample 117227 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestListCmdHasUse(t *testing.T) {\n\tassert.NotEmpty(t, ListCmd.Use)\n}\n\nfunc TestListCmdHasShort(t *testing.T) {\n\tassert.NotEmpty(t, ListCmd.Shor... | go | edit | 9 | 1 | mit | 81a379d4295da4cc1980a5187ba6c5634988305f | hoop33/limo | cmd/list_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage locationClient\n\nimport (\n\t\"encoding/xml\"\n)\n\ntype LocationList struct {\n\tXMLName xml.Name `xml:\"Locations\"`\n\tXmlns string `xml:\"xmlns,attr\"`\n\tLocations []Location `xml:\"Location\"`\n}\n\ntype Location stru... | go | edit | 0 | 0 | apache-2.0 | fd2b1b4c99bf2c9bb2c0951091fa4dc2c0d2ae83 | StorReduce/azure-sdk-for-go,bingosummer/azure-sdk-for-go,paulmey/azure-sdk-for-go,MindFlavor/azure-sdk-for-go,mvanotti/azure-sdk-for-go,bingosummer/azure-sdk-for-go,paulmey/azure-sdk-for-go,Nepomuceno/azure-sdk-for-go,Nepomuceno/azure-sdk-for-go,curoverse/azure-sdk-for-go,lirao/azure-sdk-for-go,mvanotti/azure-sdk-for-g... | clients/locationClient/entities.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build OMIT\npackage main\n\nimport (\n\t\"fmt\"\n\n\t_ \"v.io/core/veyron/profiles\"\n\t\"v.io/core/veyron2/rt\"\n\n\t\"pingpong\"\n)\n\nfunc main() {\n\truntime, err := rt.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer runtime.Clea... | go | edit | 0 | 3 | bsd-3-clause | 8491877a9019062c68e21a05a7cf0b73f29b49c7 | vanadium/playground,vanadium/playground,vanadium/playground,vanadium/playground | testdata/src/ping/ping.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux dragonfly freebsd netbsd openbsd solaris\n\npackage common\n\nimport (\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n)\n\n// GetConfigName gets the correct full path of the configuration file.\nfunc GetConfigName(program, filen... | go | edit | 6 | 4 | mit | 93ecd403e3b1c6037e61d8b2c8602d078530b8b9 | Urethramancer/lbapi,Urethramancer/lbapi | common/config_unix.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"time\"\n)\n\nvar tickLog = GetLogger(\"stats\")\n\n// The interval between logging the number of actions/sec\nvar ReportInterval = time.Second * 5\n\nvar ticks = make(map[string]int)\n\nfun... | go | edit | 0 | 5 | mit | 9ce57fbcbca565916398e1c11623b87fd032edfb | ninjasphere/go-ninja,ninjasphere/go-ninja | logger/stats.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 Volker Dobler. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage ht\n\nimport (\n\t\"testing\"\n)\n\nvar jr = Response{BodyBytes: []byte(... | go | edit | 21 | 2 | bsd-3-clause | 044b900af4fa20c3403b4b59830c9b08e16c9846 | vdobler/ht,vdobler/ht,vdobler/ht,vdobler/ht | json_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport \"golang.org/x/net/context\"\n\n// AccountByAddressQuery represents a query that retrieves a composite\n// of the CoreAccount and the HistoryAccount associated with an address.\ntype AccountByAddressQuery struct {\n\tHistor... | go | edit | 33 | 6 | apache-2.0 | 48d9c0605c92f092ea82e675a103b645446db0e3 | FredericHeem/go-horizon,stellar/horizon,lackac/horizon,stellar/horizon,FredericHeem/go-horizon,lackac/horizon,nullstyle/go-horizon,stellar/horizon,irisli/horizon,masonforest/go-horizon,masonforest/horizon,masonforest/horizon,masonforest/go-horizon,irisli/horizon,nullstyle/go-horizon,masonforest/horizon,nullstyle/go-hor... | db/query_account_by_address.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage adapters\n\nimport \"regexp\"\n\n// TODO: handle installing js assets?\n// [error] Could not start node watcher because script \"/Users/richard/workspace/moocode/hoot/apps/web/assets/node_modules/brunch/bin/brunch\" does not exist. Your... | go | edit | 6 | 1 | mit | b18307394e8b3b2c96d409a5abd74fd2456baf4f | moomerman/zap,moomerman/zap,moomerman/zap,moomerman/phx-dev,moomerman/phx-dev,moomerman/phx-dev,moomerman/phx-dev,moomerman/zap | adapters/phoenix.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage list\n\nimport \"fmt\"\n\ntype List struct {\n\tfirst *Node\n\tlast *Node\n\tsize int\n}\n\ntype Node struct {\n\tnext *Node\n\tval int\n}\n\nfunc (l *List) String() string {\n\tif l.IsEmpty() {\n\t\treturn \"List()\"\n\t} else {\n\t... | go | edit | 0 | 2 | unlicense | 2249452542dee82b463de4870b40f05ff467a99b | neilvallon/alGo | list/list.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage translator\n\nimport (\n\t\"github.com/Shopify/go-lua\"\n\t\"github.com/fsouza/go-dockerclient\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestUnknownPropertiesConfig(t *testing.T) {\n\tsource := `x = {blah = 5}`\n\n\texpected := docker.... | go | edit | 21 | 3 | apache-2.0 | 09a66644df9a7c9e23ddd69dc57298c5de69ffac | thriqon/involucro,involucro/involucro | file/translator/unknown_key_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage xlog_test\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"log\"\n\n\t\"github.com/rs/xlog\"\n)\n\nfunc Example_log() {\n\tctx := context.TODO()\n\tl := xlog.FromContext(ctx)\n\n\t// Log a simple message\n\tl.Debug(\"message\")\n\n\tif err... | go | edit | 0 | 2 | mit | 55b8f3486ff718f6383dc6f42e1bf06635baf453 | rs/xlog | xlog_examples_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage markdown\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestWatcher(t *testing.T) {\n\texpected := \"12345678\"\n\tinterval := time.Millisecond * 100\n\ti := 0\n\tout := \"\"\n\tstopChan := Ticke... | go | edit | 6 | 4 | apache-2.0 | faaef83954e9564a9ec054c464a59e041c8c2b3d | tgulacsi/caddy,devangels/caddy,yukimochi/caddy,tpng/caddy,devangels/caddy,eiszfuchs/caddy,hackintoshrao/caddy,guilhermebr/caddy,evermax/caddy,DenBeke/caddy,tw4452852/caddy,tgulacsi/caddy,dusty/caddy,liufuqiang/caddy,eiszfuchs/caddy,lukw00/caddy,tobya/caddy,elcore/caddy,hackintoshrao/caddy,tobya/caddy,buddhamagnet/caddy... | middleware/markdown/watcher_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage todoist\n\nimport (\n\t\"fmt\"\n\t\"golang.org/x/oauth2\"\n\t\"log\"\n)\n\nfunc buildConfig() *oauth2.Config {\n\t// todoist.com requires ClientID and ClientSecret to be set as parameters\n\t// in the POST.\n\toauth2.RegisterBrokenAuthH... | go | edit | 6 | 2 | mit | c6a7d2da7552e42a81b25cf2db328223e02fba24 | seanrees/tripist,seanrees/tripist | todoist/oauth2.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tport int\n\tstorage string\n\tdockerHost string\n\tdockerCertPath string\n)\n\nfunc init() {\n\tflag.IntVar(&port, \"port\", 8080, \"port number\")\n\... | go | edit | 0 | 2 | mit | 54e415353fe766cd7d856e9cd6d7d04013b90b28 | monochromegane/torokko | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 - 2017 Ka-Hing Cheung\n// Copyright 2015 - 2017 Google Inc. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n/... | go | edit | 0 | 1 | apache-2.0 | dfb5c8189269c3e0f5ce21bf4b78f9a09562b7b0 | kahing/goofys,kahing/goofys,kahing/goofys | internal/perms.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage v7\n\nimport (\n\"code.cloudfoundry.org/cli/command\"\n\"code.cloudfoundry.org/cli/command/flag\"\n\"code.cloudfoundry.org/cli/command/translatableerror\"\n)\n\ntype RenameServiceBrokerCommand struct {\n\tRequiredArgs flag.RenameServ... | go | edit | 0 | 1 | apache-2.0 | ee11e6aded00aa3f8f5fd2b5fd8780238b523c4a | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | command/v7/rename_service_broker_command.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"syscall\"\n)\n\n// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.\nfunc IsCgroup2UnifiedMode() (bool, error) {\n\tisUnifiedOnce.Do(func() {\n\t\t_cgroup2SuperMagic := int64(0x63677270... | go | edit | 12 | 2 | apache-2.0 | 6e277a2d8f4af200197d02a126f92351c2b15e21 | TomSweeneyRedHat/buildah,nalind/buildah-1,nalind/buildah,rhatdan/buildah,rhatdan/buildah,rhatdan/buildah,TomSweeneyRedHat/buildah,nalind/buildah-1,projectatomic/buildah,projectatomic/buildah,nalind/buildah-1,TomSweeneyRedHat/buildah,projectatomic/buildah,nalind/buildah | util/util_linux.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nTests\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\t// \"strings\"\n\t\"testing\"\n)\n\nfunc TestIndentConnects(t *testing.T) {\n\tsource := readFileToSlice(\"./tests_data/source_indentConnects.cpp\")\n\tresult := readFileToSlice(\"./tests_da... | go | edit | 9 | 3 | mit | 691d4f94dc338751a31f38828457a5abdaab6336 | vaz-ar/cpp_format,vaz-ar/cpp_format | cpp_format_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage collector\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\ntype SquidCounter struct {\n\tSection string\n\tCounter string\n\tDescription string\n}\n\nvar squidCounters = []SquidCounter{\n\t{\"... | go | edit | 9 | 2 | mit | 184e4c0f422b5d31ea7cf7b56b3cf7e99fc4c58a | boynux/squid-exporter,boynux/squid-exporter | collector/counters.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage storage\n\nimport \"regexp\"\n\nfunc init() {\n\tSupportedStorageTypes[\"Regex\"] = new(interface{})\n}\n\ntype remap struct {\n\tRegex *regexp.Regexp\n\tReplacement string\n}\n\ntype Regex struct {\n\tremaps []remap\n}\n\nfunc Ne... | go | edit | 6 | 3 | mit | 459fe1d23ffb6e03ce168ad6fcfe858cb84776b6 | thomaso-mirodin/go-shorten,thomaso-mirodin/go-shorten,thomaso-mirodin/go-shorten | storage/regex.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2017, Janoš Guljaš <<EMAIL>>\n// All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage web\n\nimport (\n\t\"net\"\n\t\"time\"\n)\n\n// TCPKeepA... | go | edit | 0 | 4 | bsd-3-clause | e64cb6727eb613289f51428610899293de452b64 | janos/web,janos/httputils | tcp_listeners.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage flags_test\n\nimport (\n\t\"github.com/cloudfoundry/bosh-bootloader/flags\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Flags\", func() {\n\tvar (\n\t\tf flags.Flags\n\t\t// boolVal bool\... | go | edit | 27 | 1 | apache-2.0 | ff179ac586827cbd0b969abb50818775b6809288 | pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | flags/flags_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"gopkg.in/antage/eventsource.v0\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\tes := eventsource.New(nil, nil)\n\tdefer es.Close()\n\thttp.Handle(\"/\", http.FileServer(http.Dir(\"./public\")))\n\th... | go | edit | 0 | 2 | mit | 323289ab27d509f732d2e9055d229de21a4d5d1c | XuYunnan/eventsource,antage/eventsource,XuYunnan/eventsource,torfuzx/eventsource | examples/greeter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage alert\n\nimport (\n\t\"fmt\"\n)\n\ntype CreateReq struct {\n\tName string `valid:\"required\"`\n\tActions []Action\n\tTriggers []Trigger\n}\n\nfunc (c *CreateReq) Validate() error {\n\tif len(c.Actions) == 0 {\n\t\treturn fmt.Error... | go | edit | 12 | 3 | apache-2.0 | ee2d48c1aa78d1ef9aa227d03629298cf4e87e44 | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | models/alert/create.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gosort\n\nimport (\n \"testing\"\n)\n\ntype testFunc func(elem int) bool\n\nfunc trueForAll(a []int, test testFunc) bool {\n\n for _, v := range a {\n if !test(v) {\n return false\n }\n }\n\n return ... | go | edit | 6 | 4 | mit | b81494ba22d323a52ec7f6b8200f45de26462c1b | munckymagik/gosort | partition_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux,!darwin !cgo\n\npackage imports\n\nimport (\n\t\"github.com/nitrogen-lang/nitrogen/src/eval\"\n\t\"github.com/nitrogen-lang/nitrogen/src/moduleutils\"\n\t\"github.com/nitrogen-lang/nitrogen/src/object\"\n\t\"github.com/nitrogen... | go | edit | 0 | 1 | bsd-3-clause | 05e56f036079dd18514b6d317c43c1d83eca5535 | nitrogen-lang/nitrogen,nitrogen-lang/nitrogen | src/builtins/imports/modules_stub.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage aspect\n\nimport (\n\t\"testing\"\n)\n\nfunc TestUpdate(t *testing.T) {\n\ts1 := Update(users, Values{\"name\": \"client\"})\n\texpectedSQL(\n\t\tt,\n\t\ts1,\n\t\t`UPDATE \"users\" SET \"name\" = $1`,\n\t\t1,\n\t)\n\n\tvalues := Values{... | go | edit | 24 | 3 | mit | 4653497dc470d2d9e10d16bf8450d83a47abd522 | namesjames/aspect,aodin/aspect | update_test.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\"encoding/hex\"\n\t\"github.com/piotrnar/gocoin/btc\"\n\t\"log\"\n)\n\nfunc main() {\n\tencryptedKey := \"6PfMxA1n3cqYarHoDqPRPLpBBJGWLDY1qX94z8Qyjg7XAMNZJMvHLqAMyS\"\n\n\tdec := btc.Decodeb58(encryptedKey)[:39] // ... | go | edit | 0 | 6 | mit | 3e1b6d848452ba5f680ecb894884c4d1c542891b | chigley/bip38 | bip38-cracker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pkg\n\nimport \"time\"\n\nfunc fn1() {\n\tfor range time.Tick(0) {\n\t\tprintln(\"\")\n\t}\n}\n\nfunc fn2() {\n\tfor range time.Tick(0) { // MATCH /leaks the underlying ticker/\n\t\tprintln(\"\")\n\t\tif true {\n\t\t\tbreak\n\t\t}\n\t}\... | go | edit | 6 | 3 | mit | 327913be97e9a92a4f0c34578b1a5471a21851ec | dominikh/go-tools,dominikh/go-tools,dominikh/go-tools,dominikh/go-tools | staticcheck/testdata/CheckLeakyTimeTick.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Challenge 41 - Implement unpadded message recovery oracle\n// http://cryptopals.com/sets/6/challenges/41\n\npackage cryptopals\n\nimport (\n\t\"crypto/rand\"\n\t\"math/big\"\n)\n\ntype challenge41 struct {\n}\n\nfunc (challenge41) Client(key... | go | edit | 15 | 1 | mit | d8cdcfcb0ba09bfc1e506b82da0d438e563059c5 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge41.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage test\n\ntype T struct {\n\tF1 string `json:\"F1\"`\n\tF2 string `json:\"f2\"`\n\tF3 string `json:\"-\"`\n\tF4 string `json:\"-,\"`\n\tF5 string `json:\",\"`\n\tF6 string `json:\"\"`\n}\n\n```\n\nApply this change: Add test for json tag ... | go | edit | 0 | 0 | mit | c1411e0ad5199695c808c647e066bfc1c7650a7f | json-iterator/go,json-iterator/go | output_tests/struct_tags/fieldname/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"math/rand\"\n\t\"time\"\n\n\t\"github.com/Shopify/toxiproxy\"\n)\n\nvar host string\nvar port string\nvar config string\n\nfunc init() {\n\tflag.StringVar(&host, \"host\", \"localhost\", \"Host for toxi... | go | edit | 0 | 2 | mit | 5eae7957e545c730709673dc68647941f4870a14 | Shopify/toxiproxy,Shopify/toxiproxy | cmd/toxiproxy.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\"net\"\n\t\"os\"\n\t\"time\"\n\t\"strings\"\n)\n\nvar argvPort = flag.Int(\"port\", 8117, \"port to listen\")\nvar argvCandidates = flag.String(\"nodes\", \"\", \"comma separated list of nodes... | go | edit | 6 | 4 | apache-2.0 | 68d547ec5f8cf5f52b17bd0f608187d64f41ac46 | monnand/bully | main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage state\n\nimport (\n\t\"github.com/centurylinkcloud/clc-go-cli/config\"\n\t\"io/ioutil\"\n\t\"path\"\n\t\"os\"\n)\n\nfunc readFromFile(name string) ([]byte, error) {\n\tp, err := config.GetPath()\n\tif err != nil {\n\t\treturn nil, err\n... | go | edit | 0 | 3 | apache-2.0 | ec7f7929b272fc3072d1b2824db3069cdb5cbc7c | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | state/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage tokenize implements functions to split strings into slices of substrings.\n*/\npackage tokenize\n\nimport (\n\t\"github.com/jdkato/prose/internal/util\"\n\t\"gopkg.in/neurosnap/sentences.v1/english\"\n)\n\n// ProseTokenizer is the i... | go | edit | 0 | 2 | mit | 6bc03bbc469dbc19709075b4dcabf0c9d20540e2 | jdkato/prose,jdkato/prose,jdkato/prose | tokenize/tokenize.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// The MIT License (MIT)\n//\n// Copyright (c) 2015 Douglas Thrift\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in t... | go | edit | 6 | 2 | mit | 918b45befd6a8aff7c3941b7022f0d125ada12a4 | douglaswth/rsrdp | rdp_darwin.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"bytes\"\n\t\"os/exec\"\n)\n\nfunc ExecCmd(name string, args ...string) (string, error) {\n\tcmd := exec.Command(name, args...)\n\tvar out bytes.Buffer\n\tcmd.Stdout = &out\n\n\terr := cmd.Run()\n\tif err != nil {\... | go | edit | 0 | 2 | apache-2.0 | 7c5fccd7a80a7eb164d08afb8c5e95e5be787e32 | mikebrow/cri-o,jwhonce/ocid,kubernetes-incubator/cri-o,resouer/cri-o,apilloud/cri-o,jwhonce/ocid,nalind/cri-o,vbatts/cri-o,mikebrow/cri-o,sameo/cri-o,14rcole/cri-o,rhatdan/cri-o,rhatdan/cri-o,kubernetes-incubator/ocid,mikebrow/cri-o,nalind/cri-o,aweiteka/cri-o,resouer/cri-o,rhatdan/cri-o,mheon/cri-o,14rcole/cri-o,mikeb... | utils/utils.go | rejected_duplicate | Near-duplicate of sample 117237 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cloudformation\n\n//go:generate go run ./scraper/scrape.go -format=go -out=schema.go\n//go:generate go run ./scraper/scrape.go -format=json -out=schema.json\n\n```\n\nApply this change: Update scraper to use new script"
},
{
"ro... | go | edit | 0 | 0 | bsd-2-clause | 1d3abf94f912d1fc3edc8836ddcaf9a5bc725764 | crewjam/go-cloudformation,crewjam/go-cloudformation | schema_gen.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/joho/godotenv\"\n\t\"github.com/1Conan/transports\"\n\t\"os\"\n)\n\nfunc main() {\n\tgodotenv.Load()\n\n\tfmt.Println(\"Transports test\")\n\n\tfreefbTransport := transports.FreeFBTransport{\n... | go | edit | 0 | 1 | mit | 8ba518b63573fdf979311a04e3c962f38c8a0dc7 | matiasinsaurralde/transports | examples/main_freefb_client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage resource\n\nimport (\n\t\"github.com/stellar/horizon/httpx\"\n\t\"github.com/stellar/horizon/render/hal\"\n\t\"github.com/stellar/horizon/txsub\"\n\t\"golang.org/x/net/context\"\n)\n\n// Populate fills out the details\nfunc (res *Transa... | go | edit | 3 | 1 | apache-2.0 | 4a880b3f1a40ae91794092a9a63bceef1b51631c | irisli/horizon,nullstyle/go-horizon,irisli/horizon,nullstyle/go-horizon,stellar/horizon,stellar/horizon,stellar/horizon,irisli/horizon,nullstyle/go-horizon | src/github.com/stellar/horizon/resource/transaction_success.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage binary\n\nimport \"testing\"\n\nvar testCases = []struct {\n\tbinary string\n\texpected int\n}{\n\t{\"1\", 1},\n\t{\"10\", 2},\n\t{\"11\", 3},\n\t{\"100\", 4},\n\t{\"1001\", 9},\n\t{\"10001101000\", 1128},\n\t{\"12\", 0},\n}\n\nfunc T... | go | edit | 3 | 3 | mit | 87ce5635037d59ba58f6a66522b1c0083d06411b | robphoenix/exercism-go,exercism/xgo,exercism/xgo,leenipper/xgo,pminten/xgo,leenipper/xgo,pminten/xgo,robphoenix/exercism-go | assignments/go/binary/binary_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// safe -- 7.01ns/op\n// unsafe -- 0.60ns/op\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// can we unsafe cast to unwrap all the interface layers? Or is the value in\n// memory different now? No! We have a new la... | go | edit | 0 | 2 | bsd-3-clause | 0c643d4144cbffd995d76da04052656aa81b9f62 | dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps,dterei/Scraps | go/InterfaceValues/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tlog.Fatal(\"Usage: replace [filename] [old string] [new string]\")\n\t}\n\tfile := os.Args[1]\n\told := os.Args[2]\n... | go | edit | 0 | 4 | apache-2.0 | 59df433c4f34f2d8150b80a45b800d51c5d178bb | moznion/mackerel-agent,kamatama41/mackerel-agent,stanaka/mackerel-agent,mackerelio/mackerel-agent,stanaka/mackerel-agent,mackerelio/mackerel-agent,moznion/mackerel-agent,stanaka/mackerel-agent,kamatama41/mackerel-agent,yyljlyy/mackerel-agent,kamatama41/mackerel-agent,yyljlyy/mackerel-agent,moznion/mackerel-agent,stanak... | wix/replace/replace_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage weavedns\n\nimport (\n\t\"io\"\n\t\"log\"\n)\n\n// Inspired by http://www.goinggo.net/2013/11/using-log-package-in-go.html\n\nvar (\n\tDebug *log.Logger\n\tInfo *log.Logger\n\tWarning *log.Logger\n\tError *log.Logger\n)\n\nfunc I... | go | edit | 0 | 1 | apache-2.0 | 10685a495e984532ca683288685bf83b708277bb | narry/weave,cgvarela/weave,errordeveloper/weave,OnePaaS/weave,bboreham/weave,paladin74/weave,rade/weave,paladin74/weave,2opremio/weave,2opremio/weave,paulbellamy/weave,OnePaaS/weave,achanda/weave,awh/weave,errordeveloper/weave,philipz/weave,n054/weave,dpw/weave,squaremo/weave,Lawouach/weave,n054/weave,rade/weave,19hz/w... | server/logging.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"time\"\n\ntype UserResource struct {\n\tID int `json:\"id\"`\n\tUsername string `json:\"username\"`\n}\n\ntype TaskResource struct {\n\tID int `json:\"id\"`\n\tCreatedAt time.Time `db:\"c... | go | edit | 0 | 0 | mit | bca21e3b2a45c0d6521659e87c3ca1132cc38775 | yansal/task-manager | resources.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage resource\n\nimport (\n\t\"github.com/layeh/gopher-luar\"\n\t\"github.com/yuin/gopher-lua\"\n)\n\n// LuaRegisterBuiltin registers resource providers in Lua\nfunc LuaRegisterBuiltin(L *lua.LState) {\n\tfor typ, provider := range providerR... | go | edit | 18 | 2 | mit | 7389bea7c3c144aefed99e25d551eff30aeda29d | ranjithamca/gru | resource/lua.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage io\n\nimport \"github.com/valep27/GChip8/emu\"\n\n// Frontend is the basic interface for graphical output.\n// A frontend might be implemented by SDL, opengl or similar libraries.\ntype Frontend interface {\n\tInitialize()\n\tDraw(emula... | go | edit | 0 | 0 | mit | df2a903d9538ac5637f46fc3b88320fba4f18277 | valep27/GChip8 | io/interfaces.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage acmedns\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar (\n\tacmednsLiveTest bool\n\tacmednsHost string\n\tacmednsAccountsJson []byte\n\tacmednsDomain string\n)\n\nfunc init() {... | go | edit | 3 | 3 | apache-2.0 | 240828b27288e4f34c1fa9cfd8637dbfae9a9b27 | jetstack-experimental/cert-manager,jetstack/cert-manager,jetstack/cert-manager,jetstack/cert-manager,jetstack-experimental/cert-manager,cert-manager/cert-manager,cert-manager/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager | pkg/issuer/acme/dns/acmedns/acmedns_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage aggregator\n\nimport \"github.com/GoogleCloudPlatform/kubernetes/pkg/scaler/types\"\n\ntype Node struct {\n\tCapacity types.Resource\n\tUsage types.Resource\n}\n\ntype Aggregator interface {\n\t// Returns a map with node name as key.... | go | edit | 0 | 0 | apache-2.0 | 1ef5dd3af44bac441c55e8749268a1e2ddedc8f7 | rjnagal/kubernetes,rjnagal/kubernetes,rjnagal/kubernetes,rjnagal/kubernetes,rjnagal/kubernetes,rjnagal/kubernetes,rjnagal/kubernetes | pkg/scaler/aggregator/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015-2016, Cyrill @ Schumacher.fm and the CoreStore contributors\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 co... | go | edit | 0 | 0 | apache-2.0 | b3d5841c2eb1bafb23ac7b8dca8b8f1175f53ffc | corestoreio/csfw,corestoreio/csfw | net/doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//go:build android\n// +build android\n\npackage platform\n\ntype Platform struct{}\n\nconst name = \"platform\"\n\nfunc (self *Platform) Name() string {\n\treturn name\n}\n\nfunc (self *Platform) Collect() (result interface{}, err error) {\n\t... | go | edit | 0 | 1 | mit | f7d1bf45ba8439ba774f9518f9a6e847e616bebe | DataDog/gohai,DataDog/gohai | platform/platform_android.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"syscall\"\n)\n\nvar (\n\tpath string\n\tpidfile string\n)\n\nfunc init() {\n\tflag.StringVar(&path, \"path\", \"/Database/branch/master/watch/com.... | go | edit | 3 | 6 | apache-2.0 | 380c51010be4cbbc498a9e6bdda0a15f98c004dd | kencochrane/linuxkit,samoht/linuxkit,deitch/linuxkit,JohnnyLeone/linuxkit,djs55/linuxkit,zx2c4/linuxkit,samoht/linuxkit,t-koulouris/linuxkit,deitch/linuxkit,t-koulouris/linuxkit,JohnnyLeone/linuxkit,furious-luke/linuxkit,radu-matei/linuxkit,furious-luke/linuxkit,YuPengZTE/linuxkit,djs55/linuxkit,thebsdbox/linuxkit,rn/l... | alpine/packages/hupper/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage packet\n\ntype Handshake struct {\n\tProtocolVersion uint64 `type:\"uvarint\"`\n\tServerAddress string `type:\"string\"`\n\tServerPort uint16 `type:\"ushort\"`\n\tNextState uint64 `type:\"uvarint\"`\n}\n\n```\n\nApply this ... | go | edit | 0 | 0 | mit | e91798e5aa7b746a476bf9bfef3317a384ab6af2 | ttaylorr/minecraft | protocol/packet/handshake.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"os\"\n)\n\n// FileExists returns true if path exists\nfunc FileExists(path string) (bool, error) {\n\t_, err := os.Stat(path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn false, nil\n\t\t}\n\t\tret... | go | edit | 0 | 3 | apache-2.0 | a2d4da609ac43e9edcc3453ca60d2c49dbb8e547 | flant/dapp,flant/dapp,flant/dapp | pkg/util/file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"net/http\"\n\n\t\"github.com/pkg/errors\"\n)\n\ntype WebhookMessage struct {\n\tText string `json:\"text,omitempty\"`\n\tAttachments []Attachment `json:\"attachments,... | go | edit | 6 | 4 | bsd-2-clause | 68a9954511dd7825dc9b3744a68b51398ce120b1 | 178inaba/slack,james-lawrence/slack,nlopes/slack | webhooks.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage steps\n\nimport (\n\t\"github.com/mitchellh/multistep\"\n\t\"os\"\n\t\"os/exec\"\n\t\"testing\"\n)\n\nfunc TestStepCloneRepo(t *testing.T) {\n\tenv := make(map[string]interface{})\n\tenv[\"path\"] = \"tmp\"\n\tos.MkdirAll(\"tmp/pearkes/... | go | edit | 6 | 2 | mit | 5303926217ba004cd2b399e2693ca7f76a00a126 | pearkes/gethub | steps/step_clone_repo_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2015, Peter Mrekaj. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE.txt file.\n\npackage graphs\n\n// FindCelebrity returns an index into 2D slice f that ... | go | edit | 0 | 5 | mit | 2441f4c8b17aa535b2624e4803190c310f4f4d51 | mrekucci/epi,mrekucci/epi | graphs/celebrity.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage foo\n\ntype Closer interface {\n\tClose()\n}\n\ntype ReadCloser interface {\n\tCloser\n\tRead()\n}\n\nfunc Basic(s string) {\n\t_ = s\n}\n\nfunc BasicWrong(rc ReadCloser) { // WARN rc can be Closer\n\trc.Close()\n}\n\nfunc Array(ints [3... | go | edit | 0 | 1 | bsd-3-clause | 07276ba0ef5ce648bfff4d1146b0ef2cda9cafa2 | mvdan/interfacer | testdata/files/unusual_types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage youtube\n\nimport (\n\t\"log\"\n\t\"time\"\n)\n\nconst defaultCacheExpiration = time.Minute * time.Duration(5)\n\ntype playerCache struct {\n\tkey string\n\texpiredAt time.Time\n\tconfig playerConfig\n}\n\n// Get : get cache w... | go | edit | 9 | 3 | mit | a271cf10aff544c8ab29c60fd4d60285d36624d9 | kkdai/youtube | player_cache.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Based on aplay audio adaptor written by @colemanserious (https://github.com/colemanserious)\n\npackage audio\n\nimport (\n\t\"testing\"\n\n\t\"github.com/hybridgroup/gobot/gobottest\"\n)\n\nfunc TestAudioDriver(t *testing.T) {\n\td := NewAud... | go | edit | 6 | 1 | apache-2.0 | 68923c0822b4869fe9554fdaab12df2c88f896d9 | nzmichaelh/gobot,nzmichaelh/gobot | platforms/audio/audio_driver_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage epub_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/bmaupin/go-epub\"\n)\n\nfunc ExampleAddImage() {\n\t// Create a new EPUB\n\te := epub.NewEpub(\"My title\")\n\n\t// Add an image from a local file\n\timg1Path, err := e.AddIm... | go | edit | 3 | 3 | mit | bf0845baf4f06e46a8a73c87f76b1a63482002b7 | bmaupin/go-epub | example_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonpreprocess\n\nimport (\n\t\"testing\"\n)\n\nfunc TestUncomment(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\tinput string\n\t\texpected string\n\t}{\n\t\t{\"empty\", ``, ``},\n\t\t{\"spaces\", \" \\t\\n\", \" \... | go | edit | 3 | 4 | mit | 0e759c1e5ea129437368e00c70562ab3e9e3bc02 | hnakamur/jsonpreprocess | trimcomment_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"gopkg.in/mgo.v2\"\n\t\"gopkg.in/mgo.v2/bson\"\n\t\"time\"\n)\n\ntype Application struct {\n\tId bson.ObjectId `json:\"id\" bson:\"_id,omitempty\"`\n\tUserid bson.ObjectId\n\tName string\n\tSec... | go | edit | 9 | 1 | mit | f504ff8640d2d5e41feb43665e0168f445db88dd | vanng822/aguin,vanng822/aguin,vanng822/aguin,vanng822/aguin,vanng822/aguin | src/aguin/model/app.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage i\n\nimport (\n\t. \"github.com/alecthomas/chroma\" // nolint\n\t\"github.com/alecthomas/chroma/lexers/internal\"\n)\n\n// Ini lexer.\nvar Ini = internal.Register(MustNewLexer(\n\t&Config{\n\t\tName: \"INI\",\n\t\tAliases: []stri... | go | edit | 12 | 0 | mit | 0c0b382eca61a71c1eb4cb4dea2bc78aa4939d96 | alecthomas/chroma,alecthomas/chroma,alecthomas/chroma,alecthomas/chroma | lexers/i/ini.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/jessevdk/go-flags\"\n\t\"github.com/src-d/beanstool/cli\"\n)\n\nfunc main() {\n\tparser := flags.NewNamedParser(\"beanstool\", flags.Default)\n\tparser.AddCommand(\"stats\", \"print stats on ... | go | edit | 0 | 4 | mit | 075bcf92c669fd55c16629e37626aa94a37fe697 | src-d/beanstool,tyba/beanstool | beanstool.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage terminal\n\n/*\n Go 1.2 doesn't include Termios for FreeBSD. This should be added in\n 1.3 and th is could be merged with terminal_darwin.\n*/\n\nimport (\n\t\"syscall\"\n)\n\nconst ioctlReadTermios = syscall.TIOCGETA\n\ntype termios ... | go | edit | 3 | 0 | mit | d61450a18a537773e091facf8c9653ae85e4aa62 | BellerophonMobile/logberry | terminal/terminal_freebsd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Combinatoric is a simple Go port of the \"combinatoric\" parts of\n// Python's itertools--specifically, combinations, permutations, and\n// product.\n//\n// None of the iterators are threadsafe. Implement mutexes as required.\n// Additionall... | go | edit | 0 | 0 | mit | 94b26ded69ec220c213a9347f143bd69aa0f2b7f | ecooper/combinatoric | iterator.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage villa;\n\n// CmpFunc is the function compares two elements.\ntype CmpFunc func(interface{}, interface{}) int\n\n// IntCmpFunc is the function compares two int elements.\ntype IntCmpFunc func(int, int) int\n\n// FloatCmpFunc is the funct... | go | edit | 0 | 3 | bsd-2-clause | bf7837c0179609b80febaabc96b239a4bf349eb8 | postfix/go-villa,daviddengcn/go-villa | cmp.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.