blob_id
stringlengths
40
40
content_id
stringlengths
40
40
repo_name
stringlengths
5
114
path
stringlengths
5
318
language
stringclasses
5 values
extension
stringclasses
12 values
length_bytes
int64
200
200k
license_type
stringclasses
2 values
content
stringlengths
143
200k
6a355dcd51fad0ba1764c62dec0acd7618ce3ff4
fafcf9f1505cd47f7270e61ff352acd56ead8c59
magefile/mage
/parse/parse_test.go
Go
go
2,428
permissive
package parse import ( "log" "os" "reflect" "testing" "github.com/magefile/mage/internal" ) func init() { internal.SetDebug(log.New(os.Stdout, "", 0)) } func TestParse(t *testing.T) { info, err := PrimaryPackage("go", "./testdata", []string{"func.go", "command.go", "alias.go", "repeating_synopsis.go", "subco...
48f7eb4f3bc8dd4307abde38c3a656db45c45f8d
a0f8b6f1f3b4e5392c63345ec3f9dcad84a659b6
DIBYAJYOTINANDA/cli
/cf/ssh/terminal/terminalfakes/fake_terminal_helper.go
Go
go
8,741
permissive
// This file was generated by counterfeiter package terminalfakes import ( "io" "sync" "github.com/cloudfoundry/cli/cf/ssh/terminal" "github.com/docker/docker/pkg/term" ) type FakeTerminalHelper struct { StdStreamsStub func() (stdin io.ReadCloser, stdout io.Writer, stderr io.Writer) stdStreamsMutex ...
1b720f641236a2c7db1528f964abb9916f7a2915
f3fdb40737d04f25a475044f7653b7ed1be9dd48
triompha/k8s-web-terminal
/Godeps/_workspace/src/github.com/garyburd/redigo/redis/conn_test.go
Go
go
11,364
permissive
// Copyright 2012 Gary Burd // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wr...
4c81d1becdbd07e848d168806d6fc2f807b5715f
b21457db95b503664e36cc11c70f9dc4cb5ddd0d
conradf7/origin
/test/extended/project/project.go
Go
go
20,654
permissive
package project import ( "fmt" "time" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s...
764d91521a063685828cea7a83ec6fa15a299e85
3df2e7f6cb5680df36dcec5b657ff940b99a905b
morlay/aliyun-go
/clients/cloudphoto/get_similar_photos.go
Go
go
1,818
no_license
package cloudphoto import ( "encoding/json" "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" "github.com/morlay/aliyun-go/common" ) type GetSimilarPhotosRequest struct { requests.RpcRequest LibraryId strin...
5cdd509bbc49c63ccfa29c923cd5501f7e4073d9
8276bde3d0f7600d50054ce7c01a91e0b166e0db
moshloop/platform-cli
/pkg/api/kubeadm.go
Go
go
6,594
permissive
package api import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" type HostPathType string const ( // For backwards compatible, leave it empty if unset HostPathUnset HostPathType = "" // If nothing exists at the given path, an empty directory will be created there // as needed with file mode 0755, having the same...
3f15ecb7ca8b521de6747d3fdc3446e7ebffe978
edcca2a5bab82b21139db1357c0817028bdb3439
qsupremacy/huaweicloud-sdk-go-v3
/services/functiongraph/v2/model/model_export_function_response.go
Go
go
368
permissive
package model import ( "encoding/json" "strings" ) // Response Object type ExportFunctionResponse struct { HttpStatusCode int `json:"-"` } func (o ExportFunctionResponse) String() string { data, err := json.Marshal(o) if err != nil { return "ExportFunctionResponse struct{}" } return strings.Join([]string{...
fea6f18bd07cd2ba31763d5f2f4bd35b24df1b4c
e5ee678f12aee5f1b15c7e11b99cd21559534f14
swetharepakula/cf-acceptance-tests
/Godeps/_workspace/src/github.com/onsi/ginkgo/internal/codelocation/code_location.go
Go
go
905
permissive
package codelocation import ( "regexp" "runtime" "runtime/debug" "strings" "github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/ginkgo/types" ) func New(skip int) types.CodeLocation { _, file, line, _ := runtime.Caller(skip + 1) stackTrace := PruneStack(string(debug.Stack()), ski...
9c5131e47df69af79bf53a3d9034ed3e4328a254
ca2cfdc2ddfa57449c3fcb2c46de84ce136c5e78
piotrm89/client
/go/libkb/config.go
Go
go
26,492
permissive
// Copyright 2015 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. package libkb import ( "fmt" "strconv" "strings" "sync" "time" keybase1 "github.com/keybase/client/go/protocol/keybase1" jsonw "github.com/keybase/go-jsonw" ) type UserConfigWrapper struct...
0ac135cb444469baaf0eb2b45e6a947789118634
aaaebd1e8f7c5a8df2b62f5808bb44d55bbaf994
mgw2007/golang-microservices
/src/api/app/url_mappings.go
Go
go
761
permissive
package app import ( "net/http" "github.com/gin-gonic/gin" "github.com/mgw2007/golang-microservices/src/api/clients/restclient" "github.com/mgw2007/golang-microservices/src/api/config" "github.com/mgw2007/golang-microservices/src/api/controllers/repositories" "github.com/mgw2007/golang-microservices/src/api/co...
992792f7dd621f7fec83ea4e5a4f95d89414bd84
90a1b6a6fed59df8add88e4b3c3f11becaea5a62
kstrijder/kip
/cmd/kip/service.go
Go
go
1,140
permissive
/* Copyright © 2020 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
49ced81cf2d057aaeaae7f055cefb5a66de5674c
42797035d1ffa1f34740b1423dd1d1f4d431e997
GoogleCloudPlatform/declarative-resource-client-library
/services/google/compute/alpha/instance_group_manager.go
Go
go
59,142
permissive
// Copyright 2023 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
dd653c37501f5a25c73e99ea48647c771815878c
6405011382e0ff4bd2b13835c2f8a5aeae06ceb3
wazir-ahmed/cilium-cli
/.github/tools/kubeconfig-merger/main.go
Go
go
1,269
permissive
// SPDX-License-Identifier: Apache-2.0 // Copyright 2021 Authors of Cilium package main import ( "flag" "fmt" "os" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" ) func main() { flags() config1, err := clientcmd.LoadFromFile(flag.Arg(0)) if err != nil { fmt.Println(err) os.Ex...
d6262e7d7bff33af5318f18eff4c13ae6ce722dc
740dafd204799baaeb2ac7d4712c44e9f320b4bf
cloudxo/cassem
/internal/coordinator/coordinator.go
Go
go
1,994
permissive
package coord import "github.com/yeqown/cassem/pkg/datatypes" /* The coordinator's duty is to coordinate each component in cassem to work in flows. For example: ✈️ save-pair: web-server => coordinator.savePair => repository.savePair => watcher.change (todo) And als...
5461cc1633f579b44c3af07d6ade1ca1481879e2
cc67d69c3497954beeea6eda88b9b53a5fd3a18c
fgeth/fg-ipfs
/core/coreapi/pin.go
Go
go
7,561
permissive
package coreapi import ( "context" "fmt" bserv "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" offline "github.com/fgeth/fg-ipfs-exchange-offline" pin "github.com/fgeth/fg-ipfs-pinner" "github.com/ipfs/go-merkledag" coreiface "github.com/ipfs/interface-go-ipfs-core" caopts "github.com/ipfs/interfa...
07911d76cea5d34421c8feb1389155b19790703c
4fc364feaed9f3ce3f97d80ce768e1181ca46f62
janrpn/mockdev
/configuration/configuration.go
Go
go
383
permissive
package configuration import ( "github.com/thorsager/mockdev/mockhttp" "github.com/thorsager/mockdev/mocksnmp" "github.com/thorsager/mockdev/mockssh" ) type Config struct { Loglevel string `yaml:"loglevel"` Snmp []*mocksnmp.Configuration `yaml:"snmp"` Http []*mockhttp.Configuration `y...
0d815f2fcac8594ed7edb82c516094df05999a49
1b961db215c019d0ed3d7524010526fa142851e2
giantswarm/azure-operator
/service/controller/azureconfig/handler/service/desired.go
Go
go
1,220
permissive
package service import ( "context" "github.com/giantswarm/microerror" v1 "k8s.io/api/core/v1" apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "github.com/giantswarm/azure-operator/v8/service/controller/key" ) func (r *Resource) GetDesiredState(ctx context.Context, obj i...
f01fad805688fe70f081c2b3fb64cdd4e534b551
5c43df1e32215d2bfcbd3be5baed6d9e5ec76476
open-telemetry/opentelemetry-go
/exporters/otlp/otlptrace/otlptracegrpc/client_unit_test.go
Go
go
5,293
permissive
// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
33f636d66c7f020e2f225e59d671b5b980f1f2bc
2410cc43854e1dd690b09f91ba4a8508ddfc5aff
kubesphere/kubesphere
/vendor/github.com/elastic/go-elasticsearch/v7/esapi/api.snapshot.get_repository.go
Go
go
4,822
permissive
// Code generated from specification version 7.3.0: DO NOT EDIT package esapi import ( "context" "net/http" "strconv" "strings" "time" ) func newSnapshotGetRepositoryFunc(t Transport) SnapshotGetRepository { return func(o ...func(*SnapshotGetRepositoryRequest)) (*Response, error) { var r = SnapshotGetReposit...
368df000e177695762732c6b6152cbf674e6c548
1b0359b3c16fe85c53d047fa056e8ec155a54521
LuciusSec/vitess
/go/vt/topo/test/watch.go
Go
go
6,192
permissive
/* Copyright 2019 The Vitess Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
81b601522567c207815144e3e63d63923b0a2cf4
108ce007ff7c70acf32cb1c811ea347ede86f7d9
robertgmoss/brooklyn-cli
/api/application/applications.go
Go
go
1,784
no_license
package application import ( "encoding/json" "fmt" "github.com/robertgmoss/brooklyn-cli/models" "github.com/robertgmoss/brooklyn-cli/net" ) func Tree(network *net.Network) []models.Tree { url := "/v1/applications/tree" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } var tree []...
fb59b944bb423229f808e92395c3e6885e90c14a
0ccd466af28f4282aeaa229e0edcb46c3a44db8f
fredericalix/cds
/engine/api/workflow/workflow_importer_test.go
Go
go
9,705
permissive
package workflow_test import ( "bytes" "encoding/json" "io/ioutil" "net/http" "testing" "github.com/go-gorp/gorp" "github.com/ovh/cds/engine/api/application" "github.com/ovh/cds/engine/api/environment" "github.com/ovh/cds/engine/api/pipeline" "github.com/ovh/cds/engine/api/project" "github.com/ovh/cds/eng...
d4588338fe828018e0fcb2b65e7e671ef5fde54e
73247d593ce7bca331b47b0dfd961e2cd81b1563
ovh/cds
/engine/api/workflow_run_artifact.go
Go
go
979
permissive
package api import ( "context" "net/http" "strconv" "github.com/gorilla/mux" "github.com/ovh/cds/engine/api/cdn" "github.com/ovh/cds/engine/api/workflow" "github.com/ovh/cds/engine/service" "github.com/ovh/cds/sdk" ) func (api *API) getWorkflowRunArtifactLinksHandler() service.Handler { return func(ctx con...
fb51e9cdf4e5b17a35dd39a2753ed7b7322a1f20
46b989e29635f67086e32bb2887f318c44a58674
MohanKrishnaBade/Go_lang_practice
/src/BouncingBall/main.go
Go
go
925
no_license
package main import ( "fmt" "github.com/inancgumus/screen" _"time" ) func main() { const ( width = 50 height = 10 cellBall = '%' cellEmpty = ' ' maxFrames = 1200 ) var ( cell rune vx, vy = 1, 1 px, py int ) screen.Clear() //this will creates an muti dimenshional array. board := ...
79e7935d0091a1c0d11cc921e499ad6fdf246201
6f29edbd0437df4957e57bae99bd047bf3eee528
powerispower/tidb
/util/ranger/detacher.go
Go
go
14,151
permissive
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
943de99af4cb178b8280dccd436f72deec0e7465
d3e992aeeafb445b45d8a9d9fd5a486647d95baf
lumjjb/tornjak
/tornjak-backend/api/agent/server.go
Go
go
21,052
permissive
package api import ( "crypto/tls" "crypto/x509" "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path/filepath" "strings" "time" "github.com/cenkalti/backoff/v4" "github.com/gorilla/mux" agentdb "github.com/spiffe/tornjak/tornjak-backend/pkg/agent/db" ) type Server struct { ListenAddr ...
72e440fe341f335a916158f3f3c7804ac00fbd3c
17717f4580a3be4145b6508892e1c166b5e6d845
MisinformedDNA/pulumi-azure-nextgen
/sdk/go/azure/storage/latest/blobContainer.go
Go
go
12,881
permissive
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package latest import ( "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) // Properties of the blob container, including Id, res...
03042cb9c8a10cc7d4e8dcf021c6b6dac76f0acb
cb69d926c398927790443f97309d1b4e228fc019
gidden/cloudlus
/Godeps/_workspace/src/github.com/gonum/blas/native/pardgemm_test.go
Go
go
3,593
no_license
// Copyright ©2014 The gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package native import ( "math/rand" "testing" "github.com/rwcarlsen/cloudlus/Godeps/_workspace/src/github.com/gonum/blas" ) func TestDgemmParallel(t *...
03d59dcec1446a6685dc9e58c38776b9911ab3c0
5771392ccdd9f079f5b078d9b28af044050a7984
RiccardoCampitelli/advent-of-go
/day1/day1.go
Go
go
2,335
no_license
package day1 import "fmt" func Part1() { fmt.Println("hello from part 1 day 1") for i := 0; i < len(problemInput)-1; i++ { outerLoopValue := problemInput[i] for j := 0; j < len(problemInput)-1; j++ { if i == j { continue } innerLoopValue := problemInput[j] solution := outerLoopValue + innerL...
b1440bb48b0c27dd2c6c9d1c3be12484577655b4
a080e54455ace7270cdc2635f864e5084ecc572e
ropik/google-api-go-client
/cloudlatencytest/v2/cloudlatencytest-gen.go
Go
go
6,737
permissive
// Package cloudlatencytest provides access to the . // // Usage example: // // import "google.golang.org/api/cloudlatencytest/v2" // ... // cloudlatencytestService, err := cloudlatencytest.New(oauthHttpClient) package cloudlatencytest import ( "bytes" "encoding/json" "errors" "fmt" "google.golang.org/api/g...
f8139bc73e7aae9e7893823654e39c032d066ca0
ddb67bb5c82e90bc48512985d1a8add8e017c8ea
microsoft/KubeDevice
/kube-scheduler/pkg/internal/cache/interface.go
Go
go
5,286
permissive
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
46eb2e5eb9d82ac89fe4335422e8e7b1e9928021
2f5b64f23d02f9aed2b0bd023e8eddb72a211b86
eef808a24ff/aistore
/nl/listener.go
Go
go
9,081
permissive
// Package notifications provides interfaces for AIStore notifications /* * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. */ package nl import ( "errors" "fmt" "sync" "time" "github.com/NVIDIA/aistore/3rdparty/atomic" "github.com/NVIDIA/aistore/cluster" "github.com/NVIDIA/aistore/cmn" "g...
db074c91f7c6ddbc8e9896e7256182555fe46be5
c68479f9b09ec424d84956d6715c34a4dd30a436
drewmoseley/meta-dmoseley-local-config
/recipes-utilities/gofork/files/gofork.go
Go
go
284
permissive
package main import ( "log" "os/exec" ) var ( c uint64 = 8 * 1024 * 1024 * 1024 ) func main() { a := make([]byte, c, c) for i := range a { a[i] = byte(i % 255) } log.Print(exec.Command("sleep", "1").Run()) }
0999e88a98e9ff98deba00318da39541bf7eeec8
9fd20429a9c292f04b260e91767304220c438390
gyn/exercism
/go/food-chain/food_chain.go
Go
go
1,322
permissive
package foodchain const testVersion = 3 var animals = []string{ "", "fly", "spider", "bird", "cat", "dog", "goat", "cow", "horse", } var first = "I know an old lady who swallowed a " var second = []string{ "", "", "It wriggled and jiggled and tickled inside her.\n", "How absurd to swallow a bird!\n", "Imagine t...
52bee3554c068b29dab85123e16c0a6a188bbc60
7966c0228b5ecbf2e7aec2d75e00000f92e0092e
Palem1988/syzkaller
/dashboard/app/jobs_test.go
Go
go
20,829
permissive
// Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. // +build aetest package dash import ( "bytes" "fmt" "strings" "testing" "time" "github.com/google/syzkaller/dashboard/dashapi" "github.com/googl...
1bd9c27d93113011c3f0feb80c413985b153091a
70f15b771f542f17f8805acdbd2459eeb7f3b04f
andrecronje/cosmos-sdk
/client/rpc/block.go
Go
go
3,650
permissive
package rpc import ( "fmt" "net/http" "strconv" "github.com/gorilla/mux" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/andrecronje/cosmos-sdk/client/context" "github.com/andrecronje/cosmos-sdk/client/flags" "github.com/andrecronje/cosmos-sdk/codec" "github.com/andrecronje/cosmos-sdk/types/r...
2ce462551768f6d31acc7fb781b9e4d22a89e370
da8aacf0f880884ce83f5c41fe56958f85011ec8
sunhailiang/blockChain_Study
/src/就业班/自主练习/chatRoom.go
Go
go
232
no_license
package main //先创建客户端结构体 type Client struct { Name string Addr string C chan string } //储存在线用户 var onlineMap map[string]Client //全局channel var massage=make(chan string) // func main() { }
d756ccbd64fb45a6353335abbf4891a552be5543
cde347edd5cd74227cc1774a528f6b325cefc0f4
bonan/gosips
/sip/parser/AllowParser.go
Go
go
1,521
permissive
package parser import ( "github.com/bonan/gosips/core" "github.com/bonan/gosips/sip/header" ) /** SIPParser for Allow header. */ type AllowParser struct { HeaderParser } /** * Creates a new instance of AllowParser * @param allow the header to parse */ func NewAllowParser(allow string) *AllowParser { this := ...
1c2ef16522c9591ead7909a8979515ed2e0af932
4ac6fd0cdc1fe765c3e9d85abd1734bc052e97af
jonas747/gb
/cpu/rotshifts.go
Go
go
2,410
no_license
package cpu // duplicated // func RLCA(c *Cpu) { // highBit := c.A & 0x80 // c.A = c.A<<1 | c.A>>7 // z := false // if c.A == 0 { // z = true // } // c.setFlags(z, false, false, false) // c.F |= (highBit >> 3) // } // func RLA(c *Cpu) { // highBit := c.A & 0x80 // val := c.A << 1 // l...
7ce2399fbbb346c9d3aaa9fdb27fb8c6128709b9
cf97e8f6fd6f797e453aefd5f1a3b9e0ebeb3c3d
renjiema/algorithm-practice
/data_structure/linked_list/reverse_nodes_in_k_group/reverse_nodes_in_k_group.go
Go
go
758
permissive
package reverse_nodes_in_k_group type ListNode struct { Val int Next *ListNode } // https://leetcode-cn.com/problems/reverse-nodes-in-k-group/ func reverseKGroup(head *ListNode, k int) *ListNode { // 因为头节点有可能发生变化,使用虚拟头节点可以避免复杂的分类讨论 if head == nil { return head } dummyNode := &ListNode{Next: head} a, b := du...
48893bd2ed4accb2ef764302d9fc8a553b426e39
8a4f5f556d804b3008c192f3e6ffb522b94db019
i-make-razors/vouch-proxy
/pkg/model/site.go
Go
go
2,093
permissive
package model import ( "bytes" "encoding/gob" "time" log "github.com/Sirupsen/logrus" "github.com/boltdb/bolt" "github.com/vouch/vouch-proxy/pkg/structs" ) // PutSite inna da db func PutSite(s structs.Site) error { siteexists := false curs := &structs.Site{} err := Site([]byte(s.Domain), curs) if err != ni...
7ec834f5c57ef12b76b1d9d9ccfcdc3e15c5ba6c
16805ad8dde4e0c9b3779359775d2e5404a8106b
wagoodman/origin
/pkg/security/securitycontextconstraints/matcher.go
Go
go
16,124
permissive
package securitycontextconstraints import ( "fmt" "strings" "github.com/golang/glog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver...
20e1e734a13658c5d9013abe7a1d51eabfbc7368
77a03ee109fdc139ea9b04f338a8547db3d8250e
xinydev/sdk-go
/v2/event/eventcontext_v1_test.go
Go
go
4,182
permissive
/* Copyright 2021 The CloudEvents Authors SPDX-License-Identifier: Apache-2.0 */ package event_test import ( "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/cloudevents/sdk-go/v2/event" "github.com/cloudevents/sdk-go/v2/types" ) func TestValidateV1(t *testing.T) { now := types.Timest...
a18f23fbf85718e56836b8dfc63b3f40ba4aac07
569bab60922edf20c7184a3139322a62b274d973
yvdinesh/godel
/apps/distgo/cmd/publish/publish.go
Go
go
9,692
permissive
// Copyright 2016 Palantir Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law ...
65e39d86508b3c4ae075c746ac757eafa61c8f96
bc2256fc973a293b1ded1755bbc9d8762977422f
amunra1102/design-pattern-with-golang
/abstractfactory/iSportFactory.go
Go
go
247
no_license
package abstractfactory type ISportFactory interface { MakeShoe() IShoe MakeShort() IShort } func GetSportFactory(brand string) ISportFactory { switch brand { case "adidas": return &Adidas{} case "nike": return &Nike{} } return nil }
4781f35fcdb14a4c627a0b8082c3f6975350f755
434e504f56afb9dae1b6a2076b93076d46c8a529
stanislas/hyperdrive
/cf/dummy/dummy.go
Go
go
317
permissive
package main import ( "context" "github.com/aws/aws-lambda-go/cfn" "github.com/aws/aws-lambda-go/lambda" ) func main() { lambda.Start(cfn.LambdaWrap(processEvent)) } func processEvent(ctx context.Context, event cfn.Event) (string, map[string]interface{}, error) { return event.LogicalResourceID, nil, nil; }
554a85dde2a5454cfdc4d71d62714b557107a378
41c403ccf14f2409b020828c3b0355a7ad605066
byrnedo/prefab
/nats.go
Go
go
716
permissive
package prefab import ( "fmt" "time" "errors" nurl "net/url" ) const ( NatsImage = "nats:latest" ) func StartNatsContainer(clientOpts ...ConfOverrideFunc) (id string, url string) { var confFunc = func(baseOpts *SetupOpts){ baseOpts.Image = NatsImage baseOpts.ExposedPort = 4222 for _, clientOpt := range ...
5ce1e58f9ac547d82dee8f6c79dcba1a1ec5db08
a23cf1676aae2ca076b8c4c34a0970791b0bef94
geotrace/jwt
/header.go
Go
go
777
permissive
package jwt import ( "encoding/base64" "encoding/json" ) const tokenName = "JWT" // header описывает заголовок токена с информацией о подписи. type header struct { Alg string `json:"alg"` Typ string `json:"typ"` } // getHeader возвращает сгенерированный заголовок токена с указанием алгоритма // для подписи. fun...
27a1b1c768ab17b78a46efe9317ecd8b82c9a600
a73b027928b38688dc7981f44631860467a6bf83
rokka-io/rokka-go
/rokka/stats_test.go
Go
go
429
permissive
package rokka import ( "net/http" "testing" "github.com/rokka-io/rokka-go/test" ) func TestGetStats(t *testing.T) { org := "test" r := test.NewResponse(http.StatusOK, "./fixtures/GetStats.json") ts := test.NewMockAPI(t, test.Routes{"GET /stats/" + org: r}) defer ts.Close() c := NewClient(&Config{APIAddress:...
9e50cd33074874d3e681e881a984f823e47b78fc
59cb5fc7fcd5d47bddd321383de86631fa256857
DataDog/datadog-agent
/pkg/security/tests/hardlink_test.go
Go
go
2,830
permissive
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. //go:build functionaltests package tests import ( "os" "os/exec" "te...
748311b2fac76b298ac1a58989777efd86663916
89d04d634af65de08a03db9ae93f6b5918725c66
cleiner/v8go
/v8go_test.go
Go
go
476
permissive
// Copyright 2019 Roger Chapman and the v8go contributors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package v8go_test import ( "regexp" "testing" "rogchap.com/v8go" ) func TestVersion(t *testing.T) { t.Parallel() rgx := regexp....
18e2d058440d3a67ac97d674406f937354d46bdc
1c615def828d859c182ba092f50f7eb3d6e7c776
centrifuge/go-substrate-rpc-client
/rpc/beefy/beefy_test.go
Go
go
345
permissive
package beefy import ( "os" "testing" "github.com/centrifuge/go-substrate-rpc-client/v4/client" "github.com/centrifuge/go-substrate-rpc-client/v4/config" ) var testBeefy Beefy func TestMain(m *testing.M) { cl, err := client.Connect(config.Default().RPCURL) if err != nil { panic(err) } testBeefy = NewBeefy...
19f7ee38ff6c42bf6960809b6a48811f29b9c971
d94f6f7a9f6cf0cda67311b715f17154e4e8e33f
iammadab/tenderdash
/light/provider/http/http.go
Go
go
6,352
permissive
package http import ( "context" "fmt" "math/rand" "regexp" "strings" "time" "github.com/dashevo/dashd-go/btcjson" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/light/provider" rpcclient "github.com/tendermint/tendermint/rpc/client" rpchttp "github.com/tendermint/tendermint/r...
1109f2f7e41ef54f544a22902a5ad1329baaa20c
ce3a9bfcaae56079debeb74b9070e4e567d43d2b
microsoftgraph/msgraph-sdk-go
/models/teams_app_upgraded_event_message_detail.go
Go
go
5,512
permissive
package models import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) // TeamsAppUpgradedEventMessageDetail type TeamsAppUpgradedEventMessageDetail struct { EventMessageDetail } // NewTeamsAppUpgradedEventMessageDetail instantia...
4b460f5fe188c871ccd7fbd78bfb0d8b7a2d3548
993cbfa848e4f8efa190c192e73baa509a9e75fb
bm4cs/gotime
/myapp/app.go
Go
go
359
no_license
package main import "github.com/bm4cs/gotime/hackerrank" // nested package // package alias func main() { //templates.PipelineDemo1() //cake.StockPrice() hackerrank.SimpleArraySum() } /* To build and install: go install github.com/bm4cs/gotime/myapp Or with vim-go: :GoInstall To run: $GOPATH/bin...
9658980564a5b353e28d46cc9c035891f5e491e9
d322b5041611f2b1fe63d72cade1c56bde39e0d5
melan/go-force
/sobjects/secureagentscluster.go
Go
go
1,931
permissive
// This file was generated for SObject SecureAgentsCluster, API Version v43.0 at 2018-07-30 03:47:36.344407277 -0400 EDT m=+22.687865024 package sobjects import ( "fmt" "strings" ) type SecureAgentsCluster struct { BaseSObject CreatedById string `force:",omitempty"` CreatedDate string `force:",omitemp...
4e7d10a35b331330d026de5cab78f51b45688ef3
5aa5a6cf5bfd370ef80f03558679fe937a7cbf4c
DevatYHY/faem_GoProjects
/collector.core fresh/handler/handler.go
Go
go
1,420
no_license
package handler import ( "context" "gitlab.com/faemproject/backend/eda/eda.core/services/collector/config" "gitlab.com/faemproject/backend/eda/eda.core/services/collector/functions" "gitlab.com/faemproject/backend/eda/eda.core/services/collector/models" "gitlab.com/faemproject/backend/eda/eda.core/services/collec...
b731f48be442e4096f3a45e0ac324d61ab953ba9
d28dd09e5cf6a0fb7f9d26c60c4dea898986d437
timuthy/gardener-extension-provider-vsphere
/pkg/apis/vsphere/helper/scheme_test.go
Go
go
4,604
permissive
/* * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the L...
1890265052a02c87169fc15c076febf55cb5a22b
5a0474e4489cfc1efea987bc9e1f80fed05a2c8a
alqvia/layer0
/vendor/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_dns_a_record.go
Go
go
4,434
permissive
package azurerm import ( "fmt" "log" "github.com/hashicorp/terraform/helper/schema" "github.com/jen20/riviera/dns" ) func resourceArmDnsARecord() *schema.Resource { return &schema.Resource{ Create: resourceArmDnsARecordCreate, Read: resourceArmDnsARecordRead, Update: resourceArmDnsARecordCreate, Delet...
cca9a7bf5e419fedb06b0774f931e198b3546c9d
0ab40d6b3f3427fdd7637cabb0de82e8cede2225
dawidd6/vermin
/cmd/cp.go
Go
go
2,965
permissive
/* Copyright © 2020 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
a587a160c74206c21f10bbc0479bd089fd978d25
6a879f70803596cf72a1d437929b6c15d82d7b04
VladyslavLukyanenko/GopherAlert
/services/discordservice/messagebroker/amqp.go
Go
go
868
no_license
package messagebroker import ( "github.com/VladyslavLukyanenko/GopherAlert/DiscordService/configs" log "github.com/sirupsen/logrus" "github.com/streadway/amqp" ) var conn *amqp.Connection var Channel *amqp.Channel func InitAMQP() { var err error conn, err = amqp.Dial(configs.AppConfig.RabbitMQ.URI) if err != n...
1f3be7ec431feb10fbe09907ce0b57b2f911a9c8
1f5d2cb85d9d6fcffa7caaf23bf59bc011effaff
wwdz540/fortio
/dflag/dynstringslice.go
Go
go
2,895
permissive
// Copyright 2015 Michal Witkowski. All Rights Reserved. // See LICENSE for licensing terms. package dflag import ( "encoding/csv" "fmt" "strings" "sync/atomic" "unsafe" "flag" ) // DynStringSlice creates a `Flag` that represents `[]string` which is safe to change dynamically at runtime. // Unlike `pflag.Stri...
38978a93c89b6e085ed1d76adaddcbb95eb8573d
1a351429020eae776c19510d36c596dad2b0e8d1
kim-hangyeol/hcp
/Hybrid_Cluster/hybridctl/cmd/listAddon.go
Go
go
2,147
permissive
// Copyright © 2021 NAME HERE <EMAIL ADDRESS> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law ...
0309b88511c553328611e8e8cdab13c845b91e2d
83d2adffab13e68a2e3d60b7012c0ac97fd09d36
MissiaL/selenoid-ui
/main_test.go
Go
go
1,982
permissive
package main import ( "encoding/json" . "github.com/aandryashin/matchers" . "github.com/aandryashin/matchers/httpresp" "github.com/aerokube/selenoid-ui/selenoid" "github.com/aerokube/selenoid-ui/sse" "net/http" "net/http/httptest" "os" "testing" "time" "strings" "fmt" ) func TestRootLoads(t *testing.T) { ...
ee6c68a24de8668e07f2e25a4b37e27105e6567e
6f3d4f0ad3a4d2e598f7cdc13f43af93343400fc
st3v/cf-networking-release
/src/policy-server/store/metrics_wrapper.go
Go
go
2,322
permissive
package store import ( "policy-server/models" "time" ) //go:generate counterfeiter -o fakes/store.go --fake-name Store . Store type Store interface { Create([]models.Policy) error All() ([]models.Policy, error) Delete([]models.Policy) error Tags() ([]models.Tag, error) ByGuids([]string, []string) ([]models.Pol...
f914ea6b364a770841222770bfeb3941d5f16b41
a436394928d8f248cd7b2b08c32894b10cb97401
filelan/gopve
/internal/service/cluster/firewall_types.go
Go
go
8,737
permissive
package cluster import ( "fmt" "net/http" "github.com/xabinapal/gopve/internal/types" "github.com/xabinapal/gopve/pkg/request" "github.com/xabinapal/gopve/pkg/types/firewall" ) type FirewallAlias struct { svc *Service name string description string address string digest string } func NewFirew...
40a84f4e56d4c56589b070e55b4c8b9e54a39917
1345caca5b79672defdcc6b15eca2a8b5b66f068
askomorokhov/clickhouse
/stmt.go
Go
go
1,789
permissive
package clickhouse import ( "context" "database/sql/driver" "strings" ) type stmt struct { ch *clickhouse query string numInput int isInsert bool } var emptyResult = &result{} func (stmt *stmt) NumInput() int { if stmt.numInput < 0 { return 0 } return stmt.numInput } func (stmt *stmt) Exec(arg...
9e940b0204bc02dbd718fe77b0e66280f458d1ce
255d707f62e55dc0166bb5de7192c8b19de0b71e
baimax1/jfrog-client-go
/artifactory/services/go/publishzipandmod.go
Go
go
3,336
permissive
package _go import ( "github.com/jfrog/jfrog-client-go/artifactory/auth" rthttpclient "github.com/jfrog/jfrog-client-go/artifactory/httpclient" "github.com/jfrog/jfrog-client-go/artifactory/services/utils" "github.com/jfrog/jfrog-client-go/utils/errorutils" "github.com/jfrog/jfrog-client-go/utils/io/fileutils" "...
4776438b2948ed652169e78967c4205e8c5dfffc
c779510a4914eeb40f93375b84d6c986eee0dfec
DDDDt/learnGoLang
/learnBasicGo/LearnMake.go
Go
go
1,135
no_license
package main import "fmt" /*切片*/ func main() { // [] 表示式切片类型 s := []int{1, 2, 3} fmt.Println(s) // 将现有的数组转换为 切片 var array = [4]int{1, 2, 3, 4} s1 := array[:] fmt.Println(s1) // 截取现有的数组转换为切片 s2 := array[1:3] fmt.Println(s2) s3 := array[1:] s4 := array[:2] fmt.Println(s3) fmt.Println(s4) // 使用 make 初...
4858588d3f499be6a326bd42acbf383ec6a003d8
d854fe104730ed378e78ec57108e2ddae2b9391d
jangocheng/go-elasticsearch
/typedapi/types/highlight.go
Go
go
4,201
permissive
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
38a226520e7033434b4594185f0c8096ffee7e16
a4cb466260413d5c9115d46c7b32da8c734000e9
solt9029/TerraformPractice
/src/slack-notify.go
Go
go
1,906
permissive
package functions import ( "bytes" "context" "encoding/json" "log" "net/http" "os" "math/rand" ) // PubSubMessage : published message from Cloud Pub/Sub type PubSubMessage struct { Data []byte `json:"data"` } // SubscribedMessage | subscribed message from Cloud Pub/Sub // Mention :: ["channel", "here"...
752401faa567f6e20563a22e886b63a5a9c0c4c7
579929b20f845ac972ae284cee0377e18d0c5a3c
zuoshenglo/tools
/file/file.go
Go
go
937
no_license
package file import ( "crypto/md5" "fmt" "io" "net/http" "os" ) // down file func DownFile(url string, localFile string) { res, err := http.Get(url) if err != nil { panic(err) } defer res.Body.Close() f, err := os.Create(localFile) if err != nil { panic(err) } defer f.Close() io.Copy(f, res.Bod...
957c1d3df179af1c95c291aa432dc167b7f0ebc4
d179619775752fef0dbb63df20f6f2468f46fede
beefsack/hackerrank-old
/correctness-invariant/main.go
Go
go
808
no_license
package main import ( "fmt" "io" "io/ioutil" "os" "regexp" "strconv" "strings" ) func main() { fmt.Print(run(os.Stdin)) } func run(input io.Reader) string { b, _ := ioutil.ReadAll(input) lines := strings.Split(strings.TrimSpace(string(b)), "\n") nums := parseInts(lines[1]) for i := 1; i < len(nums); i++ ...
8bb03d41eaa8ff0c208f5f2fd4939c332489f023
fd4c0367f495c79cca40533977323e7d738c5719
johnbirdau/pulumi-azure-native
/sdk/go/azure/sql/extendedDatabaseBlobAuditingPolicy.go
Go
go
33,338
permissive
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package sql import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // An extended database blob auditing policy. ...
3589dfea0015f55d6ddef5693a5764e110635f1d
7f00a318e58ad4ad5ff945694d0d64ad7a3b7cbb
uudashr/marketplace
/internal/inmem/category.go
Go
go
1,296
no_license
package inmem import ( "errors" "github.com/uudashr/marketplace/internal/product" ) // CategoryRepository is repository for product category. type CategoryRepository struct { m map[string]product.Category nameIdx map[string]string } // NewCategoryRepository constructs new product category repository. func...
0431abb78f6dadd1a0ee5990fffa6b0b136ecffd
899549dc7c8097a6b77a8afaad6d8c17339d6b9b
ClassroomCode/GoLang
/Labs/03 Syntax and Types/examples/iota-shift/main.go
Go
go
382
no_license
package main import "fmt" const ( read = 1 << iota // 00000001 = 1 write // 00000010 = 2 remove // 00000100 = 4 // admin will have all of the permissions admin = read | write | remove ) func main() { fmt.Printf("read = %v\n", read) fmt.Printf("write = %v\n", write) fmt.Printf("r...
fbb4dffbb2ee38bcc3afe5863cc455ef6e427cf9
7769d9cae83030b9dde82f073c2ec0a5964aefb1
kedgeproject/kedgify
/vendor/github.com/openshift/origin/pkg/dockerregistry/server/metrics/metrics.go
Go
go
1,203
permissive
package metrics import ( "time" "github.com/prometheus/client_golang/prometheus" ) const ( registryNamespace = "openshift" registrySubsystem = "registry" ) var ( RegistryAPIRequests *prometheus.SummaryVec ) // Register the metrics. func Register() { RegistryAPIRequests = prometheus.NewSummaryVec( prometheu...
17e767286c5240aa7713b9b7aff4150c35ce2644
af24dbb20e761614eda0eee28ea6c1edaf1026e0
shuoranliu/chubaofs
/vendor/github.com/gammazero/workerpool/pacer/pacer.go
Go
go
3,192
permissive
/* Package pacer provides a utility to limit the rate at which concurrent goroutines begin execution. This addresses situations where running the concurrent goroutines is OK, as long as their execution does not start at the same time. The pacer package is independent of the workerpool package. Paced functions can be...
2d081199f4ed322d347c55278c74c1a7b5b80393
b781cbcec360c9fa1f0096b0fbdf1ffa4f13a65a
agugaillard/minesweeper
/service/game_service.go
Go
go
2,438
no_license
package service import ( "github.com/agugaillard/minesweeper/domain/model" "github.com/agugaillard/minesweeper/domain/repository" ) type GameService interface { New(cols int, rows int, mines int, username model.Username) (*model.Game, error) Get(id string) (*model.Game, error) ExploreCell(gameId string, position...
f246c5e26b2713fa326470d2c852de70838ed2a9
758eef31c11e9b4eada39c7e04123928cbfa0c9d
chrisbombria/markdown-bullet-journal
/mdbj-summary/summary_test.go
Go
go
1,584
permissive
package main import ( "testing" "os" "github.com/dballard/markdown-bullet-journal/process" "strings" "math" "bytes" ) const EXPECTED = ` 2018-05-07-TEST.md # Work Write tests / summary # Test Data nesting1 / nesting 2 / nesting 3 / nesting 4 / nesting 5 not nested # Nested Header ## With something don...
84d19dfe8dc6f4b22bbd185a6434cde37b5d632d
136e5fc0beb3b28d4cb9f7c1daf52d0cb1f56cf2
gezman7/tcpgodns
/server/server.go
Go
go
700
no_license
package main import ( "flag" "github.com/miekg/dns" "tcpgodns/tunnel" ) // The Server executable program. func main() { port, dnsPort, domainName := parseCommand() manager := tunnel.DnsServer(port, domainName) dns.HandleFunc(".", manager.HandleDNSResponse) dns.ListenAndServe(":"+dnsPort, "udp", nil) } func ...
0b4e25246582cce44a3197a024ddb420d2c2af5a
867ea00c5afbb180cd6251a56506f24823c689a9
ronenschafferibm/cilium
/pkg/idpool/idpool.go
Go
go
8,131
permissive
// Copyright 2018 Authors of Cilium // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed ...
e6fb1f545541ba55569eb7256f93cb4594f99b38
9f59f8cd2ef003a046d538cdcc1ffdf7a68d5927
philipwhen/movable-pledge
/fabric改/vendor/github.com/Shopify/sarama/config.go
Go
go
17,922
permissive
package sarama import ( "crypto/tls" "regexp" "time" // tls "github.com/peersafe/gm-crypto/gmtls" "github.com/rcrowley/go-metrics" ) const defaultClientID = "sarama" var validID = regexp.MustCompile(`\A[A-Za-z0-9._-]+\z`) // Config is used to pass multiple configuration options to Sarama's constructors. type...
4a88e728f6138248a8bd8f31759f131e48bd42c0
3f66765c7f1f51e9f9b064fe348fbbf2a29f3789
Akshith-Banda/IITIIMShaadi_backend
/ApiCall/apicall/main.go
Go
go
2,333
no_license
package main import ( "fmt" "io/ioutil" "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" ) // Response is of type APIGatewayProxyResponse since we're leveraging the // AWS Lambda Proxy Request functionality (default behavior) // // https://serverless.com/framework/docs/providers/aws/ev...
c8fedf720790089b6a30d4f92a6b9d797fc62691
a3c5ed3e181d8ac9670bdebbd99d185c6cc8b069
toudi/jpk_vat_7
/uploader/saft_uploader_finish_upload.go
Go
go
1,272
no_license
package uploader import ( "bytes" "encoding/json" "fmt" "net/http" ) type finishUploadType struct { ReferenceNumber string AzureBlobNameList []string } type finishUploadResponseType struct { Message string Errors []string } var finishUploadPayload finishUploadType var finishUploadResponse finishUploadRes...
c12f20984c04d68a47c9873ff62df71dde07db24
27d4727e68b74c624b14d60c25cce04898c29012
chainpunk/aergo
/p2p/subproto/addrs_test.go
Go
go
4,483
permissive
/** * @file * @copyright defined in aergo/LICENSE.txt */ package subproto import ( "fmt" "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/p2p/p2pmock" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "testing" "github.com/aergoio/aergo/p2p/p2pcommon" "github.com/aer...
a41f52a476f4b6308e0957ea503f68368dc3ddf1
cee98916056f92f4e61212c8207b69485328d370
winncle/google-cloud-go
/logging/logadmin/sinks_test.go
Go
go
6,411
permissive
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
3f4435b08dd20f84163b5233611b7a2fcb02b838
d784f5efe31ffe1bdefce33b76422d9d0e299ebc
edgarlanting/metrics-server
/scripts/tools.go
Go
go
945
permissive
// Copyright 2020 The Kubernetes Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ...
4ceae83e1cffd1a2b2170fd58acbad1cba3790af
bbaa2a77a039d1ef7e348c1ba83f47d37b2680ad
dohnuts/VictoriaMetrics
/app/vmbackup/main.go
Go
go
5,493
permissive
package main import ( "flag" "fmt" "os" "strings" "github.com/VictoriaMetrics/VictoriaMetrics/app/vmbackup/snapshot" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/actions" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fslocal" "...
880c1c9aec52acc7249be9dc2a86c586ca8422a3
2e0551c1d921b4a5abcaf9a8cfe9ff470dcf48ad
gmarcial/eCommerce
/platform/http/resources/checkout/routing.go
Go
go
313
no_license
package checkout import ( "github.com/go-chi/chi" "github.com/sarulabs/di" "gmarcial/eCommerce/platform/http/resources/checkout/handlers" ) //Routes define the routes of the checkout module func Routes(router *chi.Mux, container di.Container) { router.Post("/checkout", handlers.HandleMakeCart(container)) }
5d8c4cd0f2fa6f00a49f41dada967d23f3e6df23
6a3278c19f63f23ea6831fd240e754a31566ba5e
abrander/agento
/plugins/agents/netfilter/Netfilter.go
Go
go
1,753
no_license
package netfilter import ( "fmt" "os" "path/filepath" "strconv" "strings" "syscall" "github.com/abrander/agento/configuration" "github.com/abrander/agento/plugins" "github.com/abrander/agento/timeseries" ) func init() { plugins.Register("netfilter", newNetfilter) } func newNetfilter() interface{} { retur...
2bf392cc710fc5ff71a3b089e8436e654f232260
95423afdfce3d3a46bb8067700cf2d50e2c0e1da
mownier/duyog
/auth/rds/client.go
Go
go
5,608
permissive
// Package rds provides the authentication server // a redis database access on clients, tokens and users. package rds import ( "time" "github.com/mownier/duyog/auth/store" "github.com/mownier/duyog/generator" "github.com/mownier/duyog/progerr" "github.com/garyburd/redigo/redis" ) // clientRepo implements the ...
03ed750e2123504e913dd3d198b977f8fd1726a4
7819a61cedef6a670ce51c266039e49ec6b8f1fc
ZGeomantic/CodeShare
/tests/default_test.go
Go
go
949
no_license
package test import ( "net/http" "net/http/httptest" "testing" "runtime" "path/filepath" _ "CodeShare/routers" "github.com/astaxie/beego" . "github.com/smartystreets/goconvey/convey" ) func init() { _, file, _, _ := runtime.Caller(1) apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string...
48456553b6bb62d0504ba3daeb556efb7097dc84
3db1ed863cd7fb61a761c862256917e55b022f23
rroller/go-exif
/ifd_enumerate_test.go
Go
go
14,641
no_license
package exif import ( "bytes" "fmt" "path" "reflect" "testing" "encoding/binary" "io/ioutil" "github.com/dsoprea/go-logging" ) func TestIfdTagEntry_ValueBytes(t *testing.T) { byteOrder := binary.BigEndian ve := NewValueEncoder(byteOrder) original := []byte("original text") ed, err := ve.encodeBytes(or...
05fb58586a840c5b286aae6bf844bfd5c7fb39ec
64f42f8b6884819cad53a896b03d947bd8d28f68
joshua-sterner/scheduler
/internal/server/server.go
Go
go
588
permissive
package server import ( "context" "fmt" "net/http" ) type HTTPServer interface { Start(port int) error Stop() error } func NewHTTPServer() HTTPServer { return &httpServer{} } type httpServer struct { server *http.Server } func (server *httpServer) Start(port int) error { serveMux :...
9fbb0d7f1e9adfab33c96ff76adc2387329755f0
c945df10b3689e1109c8771b96344ee52b42bc61
josephsmartinez/go_programming
/AWS-SDK/ec2_list_instances_filtered.go
Go
go
926
permissive
package main import ( "fmt" "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" ) func main() { ec2svc := ec2.New(session.New()) params := &ec2.DescribeInstancesInput{ Filters: []*ec2.Filter{ { Name: aws.String("tag:Environment"), ...
0d186cccf32e588c820a8ec731461e2ebe09493f
e6d2be6a71ef48a4db742ecbb8ba22d3189dea73
gorilla001/docker
/vendor/github.com/containerd/containerd/rootfs/apply.go
Go
go
3,781
permissive
package rootfs import ( "crypto/rand" "encoding/base64" "fmt" "time" "github.com/containerd/containerd/diff" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" "github.com/containerd/containerd/snapshots" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-s...
aeae1b0f36809007b1715b0c6b56574bbacbf99d
680c7ea810dbced6c5fa10af23ff19f3aed5aa84
13211331331/xlsx
/src/excel/xmlChart.go
Go
go
22,558
no_license
package excel import "encoding/xml" // xlsxChartSpace directly maps the c:chartSpace element. The chart namespace in // DrawingML is for representing visualizations of numeric data with column // charts, pie charts, scatter charts, or other types of charts. type xlsxChartSpace struct { XMLName xml.Name ...
4c2025ef9a1f68c09d9063ba9932ef4fcb5fc71d
e411bdb8106fc2b4b9ef17dfb01ef8908f4e2540
xiyangxixian/soar-web
/vendor/github.com/ugorji/go/codec/encode.go
Go
go
39,952
permissive
// Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved. // Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( "encoding" "errors" "io" "reflect" "sort" "strconv" "time" ) // defEncByteBufSize is the default size of []byte used // for bufio buffer or []...
edc5d58e5f092be7f1661cbce3f1d84be8dd4487
bbf64ff39e904614075e235357ecaa14364cff7f
portworx/torpedo
/vendor/github.com/oracle/oci-go-sdk/v65/core/add_image_shape_compatibility_entry_request_response.go
Go
go
3,888
permissive
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...