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
0faaf7214cf85b4458d080955bfcaaca93e78ea7
10c84493c8d7770c7e386138e5b5a15a43168a77
m-masataka/alertmanager
/notify/opsgenie/opsgenie.go
Go
go
8,840
permissive
// Copyright 2019 Prometheus Team // 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...
345a90583e5a20084046b52a0f7fa45e186b8779
dabf361bda0a195d542bb61e8d7006f3a9cd39f0
jvazquez/recruiting-take-home
/challenge/pkg/converter_test.go
Go
go
2,465
no_license
package pkg import ( "testing" ) func TestConverterAsEnglishWillReturnEmtpyStringIfNumberIsLowerThanZero(t *testing.T) { result, ok := Converter(-1, AsEnglish) if ok == nil { t.Error("We expected an error since -1 is out of range") } if result != "" { t.Error("Return of function should be empty.") } } fu...
47db32903fb9b94da48df10a988091108b7a3820
324b0a66728c47799c4ab609a4eaa6f05cdf5638
Ludusamo/cool-lang-features
/frontend/server/routes_test.go
Go
go
5,552
permissive
package server import ( "bytes" "cool-lang-features/database" "encoding/json" "github.com/gorilla/mux" "net/http" "net/http/httptest" "testing" ) func TestHomeHandler(t *testing.T) { req, err := http.NewRequest("GET", "/", nil) if err != nil { t.Fatal(err) } rr := httptest.NewRecorder() server := Serve...
6a6f462613799b9896d64e211c75ced4d5584bde
223222dd4166e352b64a11ce83b29a8228b231c2
cloud66-samples/pilot
/main.go
Go
go
2,256
no_license
package main import ( "flag" "fmt" "log" "net" "net/http" "os" "os/signal" "syscall" "time" "github.com/ant0ine/go-json-rest/rest" ) type SysInfo struct { Hostname string Node string IP []string CallerIP string UpSince time.Time Version string Requests int Namespace string } var...
c31b2d680c9ad67a0b7927855a623fcaa77351e0
95b6cc1eb3bf8562c8a6b88add5aad1d937c0bf4
markRIT/bk-bcs
/bcs-mesos/bcs-container-executor/network/cni/cni.go
Go
go
8,258
permissive
/* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obta...
22591c05ca01385d8c2a1f12016ce38a5e26b11a
21eb4d4fa49a27dba23b95c47833c9de1d3c2b36
xiegangqingnian/nft_service
/app/model/pending.go
Go
go
411
no_license
/** @author: 铁柱 @date:2021/6/17 @note: **/ package model import "gorm.io/gorm" // 待售列表 type Pending struct { gorm.Model Price string `gorm:"column:price;comment:'当前待售价格'"` Item1 string `gorm:"column:item1;comment:'备用1'"` Item2 string `gorm:"column:item2;comment:'备用2'"` } func (u *Pending) TableName() string { r...
d21432a7b46540dddfe81d5a6f88171ddf426ea2
677a56189f8e2936ca6d76d1f13391729ac4675d
GowthamGirithar/employee-service
/fileUtils/fileUtils_test.go
Go
go
360
no_license
package fileUtils import "testing" var pathToFile = "" // pass the file path func TestReadFile(t *testing.T) { data, _ := ReadFile(pathToFile) println(data) } //demo to show examples in go doc func ExampleReadFile() { ReadFile(pathToFile) } //for benchmark func BenchmarkReadFile(b *testing.B) { for i := 0; i <...
d3c9125bef43c1f1d3f5a2e37db790f68e8ea984
e54e8aca6741847cf419513dec7ae00fb9a5abd2
pskenny/eliza-web-app
/eliza.go
Go
go
4,934
no_license
package main // IMPORTANT: I was unable to resolve error in adding responses to corresponding keys, making this non-functioning import ( "bufio" "fmt" "log" "math/rand" "net/http" "os" "regexp" "strings" ) type key struct { keyword string responses []string } // Clean up input text a bit func sanatiseIn...
f0a82fb86042130801783dedb7734cf67a1bca8c
4140f58548a984a9fd207adccde20ae3b4c23967
GeekMeUpScotty/minikube
/pkg/minikube/bootstrapper/bootstrapper.go
Go
go
1,905
permissive
/* Copyright 2016 The Kubernetes 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 law or ag...
88a02ad5019a4e9f2abdde91614f14f766a4f1c8
d532f22b6daee129739ba665b4dddf791de4e7bf
wade-welles/go-ringcentral
/office/v1/examples/event_parse/event_parse.go
Go
go
1,907
permissive
package main import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "github.com/grokify/gotilla/fmt/fmtutil" rc "github.com/grokify/go-ringcentral/office/v1/client" ru "github.com/grokify/go-ringcentral/office/v1/util" log "github.com/sirupsen/logrus" ) type Body struct { ID string Body interf...
7a07db2286f382cc7b2068073ed79cc9a4555fb8
a4ef7f96487f1aeb76aa61c6f72bfb03d109c280
MoisesTapia/terrascan
/pkg/writer/writer.go
Go
go
1,070
permissive
/* Copyright (C) 2020 Accurics, 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 wr...
fa10f8c814af9abac2e1637700149f1099fd9e64
64e650d1545c4071bae7932c2b954b1e62ca7ff9
hacash/service
/rpc/submitTransaction.go
Go
go
1,322
permissive
package rpc import ( "encoding/hex" "github.com/hacash/core/interfaces" "github.com/hacash/core/transactions" "net/http" ) // Submit a transaction func (api *RpcService) submitTransaction(r *http.Request, w http.ResponseWriter, bodybytes []byte) { isHexData := CheckParamBool(r, "hexbody", false) isOnlyTry := C...
6e8e3f7c6a150a42f5fc15dcae98909a6bfbfed3
7b385b1409c6625b261acef0f17c820757c58204
er1ce/line-bot-sdk-go
/examples/richmenu_helper/main.go
Go
go
3,957
permissive
// Copyright 2016 LINE Corporation // // LINE Corporation licenses this file to you 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 requi...
b6c5438fe867bb76855e4953fb61b7cbb5efe593
46fe47bcb76fa24a25e72ae73b51849b01c07f0b
xiaoxiao-asss/demos
/ch03/demo1.go
Go
go
2,455
no_license
package main import "fmt" func main() { //数组 //指定长度,初始化值 array:=[5]string{"1","2","3","ss","hello"} //设置长度,为指定索引位置设置值,没有设值的位置为该类型的默认值,int 0, bool false,不设置长度则为后面最大索引位置+1 arrs:=[4]int{1:1,3:4} //不设置长度,以元素个数为数组大小 arrays:=[...]int{1,2,3} for i,value:=range arrs{ fmt.Println(i,"\t",value) } fmt.Prin...
9aeaf45a0bd49f58845db9693ff8c48ff87b7e10
d1593e3b08127513fbd5c522bc931ec69a62391d
zerodois/go-css
/parser.go
Go
go
5,081
permissive
package css import ( "bytes" "container/list" "errors" "fmt" "io" "strings" "text/scanner" ) type tokenType int const ( tokenFirstToken tokenType = iota - 1 tokenBlockStart tokenBlockEnd tokenRuleName tokenValue tokenSelector tokenStyleSeparator tokenStatementEnd ) // Rule is a string type that repre...
a34eefeb3972fac6f9fe41d65dfed199c439812a
06a8a59ad86b078cbc3ddd55d6c894913ff1e913
nepp-an/leetcode-go
/leetcode_109.go
Go
go
1,178
permissive
package leetcode_go /* 有序链表转二叉搜索树 给定一个单链表,其中的元素按升序排序,将其转换为高度平衡的二叉搜索树。 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1。 示例: 给定的有序链表: [-10, -3, 0, 5, 9], 一个可能的答案是:[0, -3, 9, -10, null, 5], 它可以表示下面这个高度平衡二叉搜索树: 0 / \ -3 9 / / -10 5 */ type ListNode struct { Val int Next *ListNode } type TreeN...
2f3c200b8a89e4ac02c1af5ab9b3b569890f7b14
18afbfde6205d87cfb26e7bc58c663f2b91b9027
GodKra/GoShooter
/player.go
Go
go
520
no_license
package main import "github.com/nsf/termbox-go" type player struct { x int color termbox.Attribute char rune } func (p *player) moveLeft() { p.x-- if p.x < 1 { p.x = 1 } } func (p *player) moveRight() { p.x++ if p.x > arenaWidth-1 { p.x = arenaWidth - 1 } } func (p *player...
356d0ef777dceea47513b2c63f9af6cb36fb0440
0ca7c7fc19441bbfa5f4a945f9573cc61a97ea79
mattheath/go-zookeeper
/zk/conn.go
Go
go
20,681
permissive
package zk /* TODO: * make sure a ping response comes back in a reasonable time Possible watcher events: * Event{Type: EventNotWatching, State: StateDisconnected, Path: path, Err: err} */ import ( "crypto/rand" "encoding/binary" "errors" "fmt" "io" mathrand "math/rand" "net" "strconv" "strings" "sync" "sy...
5d4b4aa50b44b44da1cc6be48226b7bc5edb8de5
14a91e97e32300ac32f5038fc5f047f8ec04f6f6
tiagralee/arrai
/rel/value_set_str_test.go
Go
go
502
no_license
package rel import ( "testing" "github.com/stretchr/testify/assert" ) func TestIsStringTuple(t *testing.T) { s := "hello" for e := NewString([]rune(s)).Enumerator(); e.MoveNext(); { tuple, is := e.Current().(StringCharTuple) if assert.True(t, is) { assert.Equal(t, rune(s[tuple.at]), tuple.char) } } } ...
b107f68261b4e9fe1c37c8fabbcaa28fd943c8d3
206182320447f6d561568edb584942cdeb3d1f35
sparkstar/tuiwidget
/labeledentry/labeledentry.go
Go
go
980
no_license
package labeledentry import ( "github.com/marcusolsson/tui-go" ) const ( DefaultSizeTextLength = 20 ) type LabeledEntry struct { *tui.Box tag *tui.Label input *tui.Entry maxSizeText int } func New(label string, inputmode tui.EchoMode) *LabeledEntry { l := tui.NewLabel(label) p := tui.NewPadder...
a5d79a2e63dc1d79778e1af773b8b1601bbb5e69
aae0ae68d94aebd2834598b3ad599ab3c3e6fbab
Virendra319/testdemo
/partyparrot/partyparrot_test.go
Go
go
500
no_license
package partyparrot_test import ( "bytes" "testing" "time" "github.com/segmentio/testdemo/partyparrot" ) func TestParty(t *testing.T) { d := time.Date(1906, time.December, 9, 0, 0, 0, 0, time.UTC) *partyparrot.Now = func() time.Time { return d } t.Run("times are equal", func(t *testing.T) { b := bytes.Ne...
c160799432c943b208a8b0c6a145f8b0461e46a4
8944ad2648eb70dec48f385a6111f26808894675
edumar111/go-eth-demo
/expertise/deploy_contrac.go
Go
go
1,266
no_license
package main import ( "fmt" "log" //"encoding/hex" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" expertise "./contracts" // for demo ) func main() { client, err := ethclient.Dial("http://35.231.124.87:8545") if err != nil { log.Fatal(err) ...
ddc4f202ca8cf995217ecb38f151aaae253f82cc
1dab5429308256587b259ad15af08649a834efae
Kava-Labs/cosmos-sdk
/x/auth/migrations/legacytx/stdtx_test.go
Go
go
11,299
permissive
package legacytx import ( "fmt" "testing" "github.com/cometbft/cometbft/libs/log" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/cry...
5b11eb3c5c4c3b87c7ce894df05280c8c02db6fd
b8b3ffc818d8e7c9f2ae49585fe29a2ec3b88005
maveric-tellrv/openshift-preflight
/certification/internal/shell/has_prohibited_packages.go
Go
go
3,249
permissive
package shell import ( "bufio" "strings" "github.com/redhat-openshift-ecosystem/openshift-preflight/certification" "github.com/redhat-openshift-ecosystem/openshift-preflight/cli" log "github.com/sirupsen/logrus" ) type HasNoProhibitedPackagesCheck struct{} func (p *HasNoProhibitedPackagesCheck) Validate(image ...
460b7b61b08ba0ace0420d45ecae59a4276176af
c300f42ca752b8da3f14e01133256bb40078e011
DataDog/datadog-agent
/test/new-e2e/pkg/utils/e2e/client/up_result_deserializer.go
Go
go
1,583
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. package client import ( "testing" "github.com/DataDog/test-infra-defi...
dbf3f912e321921bbebb20d208cb3bc9cc2e89d2
8621234843b606482d3e21936505cf35af6b2718
wzzydezy/golearn
/src/11-reflect/test1_pair.go
Go
go
251
no_license
package main import "fmt" func main(){ var a string //pair<statictype:string, value:"aceld"> a = "aceld" //pair<type:string, value:"aceld"> var allType interface{} allType = a value, _ := allType.(string) fmt.Println(value) }
4ebca6f667a4c231f1a7beab16ac294aab4a8bca
ab883da6494119668efed36087a3a19748ab9392
bestests/goBoard001
/main.go
Go
go
1,102
no_license
package main import ( "github.com/goBoard001/board" "github.com/labstack/echo" "github.com/labstack/echo/middleware" ) func jsHandler(c echo.Context) error { fileNm := c.Param("fileNm") return c.File("js/" + fileNm) } func cssHandler(c echo.Context) error { fileNm := c.Param("fileNm") return c.File("css/" + f...
bbee00e2ada3fa8e127f2f1e0b00b2f19a9e90b7
4f7f9cff805bc145afd81ebde8cb19ea57345afc
trumanwong/leetcode
/algorithms/0046.Permutations/permute_test.go
Go
go
619
permissive
package main import ( "leetcode/algorithms/0046.Permutations/permute" "testing" ) func TestPermute(t *testing.T) { tests := []struct { nums []int output [][]int }{ {[]int{1, 2, 3}, [][]int{{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}}, } for _, test := range tests { ...
c25d13b271b6d74046eaa0535c2b748993b4608a
528af7a5705e702aabd83a5e7dbe857c780385a6
cncal/tidb
/bindinfo/session_handle_test.go
Go
go
27,412
permissive
// Copyright 2021 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...
7291996b3cf50862a868f8fc686b1cd0304fc39d
adb033f9bdeb5194209e1ae9dd46615671e72996
guntoroyk/learn-go-with-test
/4_array_slice/sum_test.go
Go
go
979
no_license
package arrayslice import ( "reflect" "testing" ) func TestSum(t *testing.T) { t.Run("colection of 5 numbers", func(t *testing.T) { numbers := []int{1, 2, 3, 4, 5} got := Sum(numbers) want := 15 if got != want { t.Errorf("got %d want %d given, %v", got, want, numbers) } }) } func TestSumAll(t *te...
f9f7df4769ae173d145b5e96e0242f6142a3bea0
a9db169d18c0dd00c3cb58c5dc654dab2f9d723a
lirenkai2000/ipscan-1
/ipscan.go
Go
go
5,377
permissive
// Scans specified IP range and returns list of active devices, rtt, and DNS names. // Started life based on mping (https://github.com/mhusmann/mping). // // Usage: ipscan [-quv] [-n value] [-t value] startIP endIP // -n, --count=value max number of pings per target // -q, --quiet only display host data // -...
109103529858a20344e1a23477cf59bcf8d89ef1
affc6c5e474487257f10c14c530d28249ed22ebd
giwayne/volantmq
/types/types.go
Go
go
3,432
permissive
package types import ( "sync" "sync/atomic" "go.uber.org/zap" ) // LogInterface inherited by internal packages to provide hierarchical logs type LogInterface struct { Prod *zap.Logger Dev *zap.Logger } // Default configs const ( DefaultKeepAlive = 60 // DefaultKeepAlive default keep DefaultConnectTim...
60cae14f2810dd7ab28e34a59adbae3874abcb60
f79db07fa5dd301800c53219a6fe5bb60c7661fe
arjit95/fuzer
/queue/priority_queue.go
Go
go
1,365
permissive
package queue import "container/heap" // An Item is something we manage in a priority queue. type Item struct { Value string // The value of the item; arbitrary. Priority int // The priority of the item in the queue. // The index is needed by update and is maintained by the heap.Interface methods. Index i...
9b733b6901b791126597aba13863313358344a91
e13223ee209f63e9055861016b893893e9cc9474
suqcnn/yang
/meta/builder.go
Go
go
17,382
permissive
package meta import ( "fmt" "strings" ) type Builder struct { LastErr error uid int //module *Module } func (b *Builder) setErr(err error) { if b.LastErr == nil { b.LastErr = err } } func (b *Builder) Module(ident string, fs FeatureSet) *Module { return &Module{ ident: ident, ver: ...
f85d60bbf0d90e95e16494361c8f01b1474ff420
92636c87a2708af62f11d37fae4c2e0275f868f4
harikrishna43/Docker.DotNet
/tools/specgen/vendor/github.com/docker/docker/pkg/term/windows/console.go
Go
go
815
permissive
// +build windows package windows import ( "os" "github.com/Azure/go-ansiterm/winterm" ) // GetHandleInfo returns file descriptor and bool indicating whether the file is a console. func GetHandleInfo(in interface{}) (uintptr, bool) { switch t := in.(type) { case *ansiReader: return t.Fd(), true ...
ceeea66f4b7e3ecf2260cdb836fbb11133ce2ad4
80ed90d083a00cecff9c83840c94f54685368f59
shixufei/publication
/column/imooc/go-50tips/sources/stubtest1/weather_cli_test.go
Go
go
1,202
permissive
package weather import ( "encoding/json" "net/http" "net/http/httptest" "testing" ) var weatherResp = []Weather{ { City: "nanning", TemP: "26~33", Weather: "rain", Date: "05-04", }, { City: "guiyang", TemP: "25~29", Weather: "sunny", Date: "05-04", }, { City: "tianjin",...
de2263e5fb4ce3ffd697da86960a1dc0a431b960
1501fe7eac701e8cffb66590e024dc80fa58619f
metal-stack/metal-networker
/pkg/netconf/knowledgebase_test.go
Go
go
9,223
permissive
package netconf import ( "fmt" "testing" "github.com/metal-stack/metal-go/api/models" "github.com/metal-stack/metal-hammer/pkg/api" mn "github.com/metal-stack/metal-lib/pkg/net" "github.com/stretchr/testify/assert" "go.uber.org/zap/zaptest" ) func mustNewKnowledgeBase(t *testing.T) config { log := zaptest.Ne...
addfdd3ff4f5a7349606a78ae1a5824bc83bfaf0
6e77ac3cf19956d2e4705ef468792c7930c6f735
jageros/hawos_bak
/transport/rpc/server.go
Go
go
1,313
permissive
/** * @Author: jager * @Email: lhj168os@gmail.com * @File: rpc * @Date: 2021/6/8 3:59 下午 * @package: rpc * @Version: v1.0.0 * * @Description: * */ package rpc import ( "context" "fmt" "github.com/jageros/hawos/registry" "github.com/jageros/hawos/transport" "google.golang.org/grpc" "net" ) ty...
183be793467bf1a274d585a6242bb7fe0ef2caca
757c13f2ab86aa7eb8cd6aaea70f11f0bf1552ea
bellsovery/cosmos-sdk
/x/auth/client/cli/tx_multisign.go
Go
go
5,036
permissive
package cli import ( "bufio" "fmt" "io/ioutil" "os" "strings" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" ...
f8a6b0253c0d9637fc2e4b41040a9c24f1bd09d2
416cf56368f0a22c376ee538c838549d9a08bb85
ivopetiz/influxdb
/tsdb/index/tsi1/index_file.go
Go
go
14,791
permissive
package tsi1 import ( "bytes" "encoding/binary" "errors" "fmt" "io" "sync" "unsafe" "github.com/ivopetiz/influxdb/models" "github.com/ivopetiz/influxdb/pkg/estimator" "github.com/ivopetiz/influxdb/pkg/estimator/hll" "github.com/ivopetiz/influxdb/pkg/mmap" "github.com/ivopetiz/influxdb/tsdb" ) // IndexFil...
438b942b6523a088de26f53baadf0ee6090b4951
52373684eb5dbd82979e8f269b1366058e7e4e23
00mjk/go-mysql-server
/sql/analyzer/indexes.go
Go
go
28,963
permissive
// Copyright 2020-2021 Dolthub, 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...
a46448add8805719a1c9a92cdc3cfeaff8c19b6e
fc7dfad085cedf4d63e65d51227e9e01c4746d7a
stevanstev/fun-bloggers-backend
/library/error_code.go
Go
go
734
no_license
package library import ( "fmt" "net/http" ) /*ResponseByCode ... @desc API Response based on http status code @param errorCode int, error code , 200, 500, .. @param w http.ResponseWriter, the response writer @param errorMessage string, error messages to send back to user */ func ResponseByCode(errorCode int, w http...
2a0b69c5718710b33e0a6932ffa39105906b5434
d751ee40b1a3fc8eb15bf8b1cd56a85aeb45a40b
tkmtldn/http-rest-api
/internal/app/model/user_test.go
Go
go
1,493
no_license
package model_test import ( "github.com/stretchr/testify/assert" "http-rest-api/internal/app/model" "testing" ) func TestUser_Validate(t *testing.T) { testCases := []struct { name string u func() *model.User isValid bool }{ { name: "valid", u: func() *model.User { return model.TestUser...
649a08b63a56e4e22196f8b382fbadbfc47c8645
7d7bc23f15f58d7576dcedfdf67f066347652317
FeynmanZhou/kubesphere
/pkg/models/iam/im/im.go
Go
go
5,501
permissive
/* Copyright 2020 The KubeSphere 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, ...
5e615b0b3cc3e71546b37ad3594ead66a02882e8
991a1c304ee78c99f93b9618be5b01df75cfd441
jgulick48/hc
/accessory/thermostat.go
Go
go
865
permissive
package accessory import ( "github.com/jgulick48/hc/service" ) type Thermostat struct { *Accessory Thermostat *service.Thermostat } // NewThermostat returns a Thermostat which implements model.Thermostat. func NewThermostat(info Info, temp, min, max, steps float64) *Thermostat { acc := Thermostat{} acc.Accesso...
309f9dbdc133b80d7ec00ca1bdea7720cc141ea3
5f0d9bd016ab1bc6b4ac189a5dcef9054d89ae71
isabella232/fs-repo-migrations
/ipfs-10-to-11/_vendor/github.com/libp2p/go-libp2p-core/routing/query.go
Go
go
2,901
permissive
package routing import ( "context" "sync" "github.com/ipfs/fs-repo-migrations/ipfs-10-to-11/_vendor/github.com/libp2p/go-libp2p-core/peer" ) // QueryEventType indicates the query event's type. type QueryEventType int // Number of events to buffer. var QueryEventBufferSize = 16 const ( // Sending a query to a p...
2403e105e39d2ac57d1eed3693a890374ff3e6b0
7b1c12611200df4e67dd77cebcd0d4525798c0eb
aliyun/aliyun-oss-go-sdk
/sample/select_object.go
Go
go
4,925
permissive
package sample import ( "fmt" "io/ioutil" "github.com/aliyun/aliyun-oss-go-sdk/oss" ) // SelectObjectSample shows how to get data from csv/json object by sql func SelectObjectSample() { // Create a bucket bucket, err := GetTestBucket(bucketName) if err != nil { HandleError(err) } // // Create a Csv obje...
ce71db04e4956049873db46467c6ae961e70b93f
033f6636fffbd401d381efc86e772dfe2ccf3eda
initlove/ocihub
/session/session.go
Go
go
3,410
permissive
package session import ( "errors" "fmt" "sync" "github.com/astaxie/beego/context" "github.com/astaxie/beego/logs" "github.com/initlove/ocihub/config" ) // Driver provides the session interfaces type Driver interface { // Init setups a driver Init(paras map[string]interface{}) error // New creates a new ses...
3ea01ae377454a65097f54d151e51f38ff7130de
bca40f1d94ed75d6acd7b5de2f59333250ae7faa
Sennue/gogochat
/auth.go
Go
go
2,367
permissive
// TODO: Append device package main import ( "database/sql" "encoding/json" "fmt" "io" "io/ioutil" "net/http" gogoapi "github.com/Sennue/gogoapi" ) const ( READ_BUFFER_SIZE = 1024 * 1024 // 1 meg ) type AuthCredentials struct { DeviceId string `json:"device_id"` Password string `json:"password"` } type A...
bf936163358dc1a01c104cd0c32955c9717a6c6c
3f9f32e2de4d4bd43f33d49b740ec03a5b20a68d
JinheLin/tidb
/util/ranger/detacher.go
Go
go
50,870
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...
6e31c371e9a5f3a6475d907fc132f859e3c7a1e2
b174c01a83df9dfa731eaa317287884b5983b3ea
mikesaidani/go-koans-solution
/about_common_interfaces.go
Go
go
494
no_license
package go_koans import "bytes" func aboutCommonInterfaces() { { in := new(bytes.Buffer) in.WriteString("hello world") out := new(bytes.Buffer) out.ReadFrom(in) assert(out.String() == "hello world") // get data from the io.Reader to the io.Writer } { in := new(bytes.Buffer) in.Wr...
20cd3d1c2c22b0f6e9ce7d09db331c38ac016ddb
ac6377097cd6c2e74161f879734011192dea10ed
StudioSol/graphql
/gqlerrors/error.go
Go
go
1,625
permissive
package gqlerrors import ( "fmt" "reflect" "github.com/StudioSol/graphql/language/ast" "github.com/StudioSol/graphql/language/location" "github.com/StudioSol/graphql/language/source" ) type ErrorWithType interface { Error() string Type() string } type Error struct { Message string Stack strin...
f0d766937b20c21f57f05f283c10356031b81d15
8c52bcd535e7b32402fc7748d3893e7c884538e4
lukw00heck/spire
/cmd/spire-agent/cli/cli.go
Go
go
577
permissive
package cli import ( "log" "github.com/mitchellh/cli" "github.com/spiffe/spire/cmd/spire-agent/cli/api" "github.com/spiffe/spire/cmd/spire-agent/cli/run" ) func Run(args []string) int { c := cli.NewCLI("spire-agent", "0.0.1") //TODO expose version configuration c.Args = args c.Commands = map[string]cli.Comma...
5ff141df20d32f575ea86fdec8de619804075066
8c7d288d96db56e1bffba3801170ced76001e0e1
isabella232/exposure-notifications-verification-server
/pkg/controller/admin/email_test.go
Go
go
3,304
permissive
// Copyright 2020 Google LLC // // 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 ...
869b919f04dae61fad81d9fb21d737d8caf77354
3223d2734d27e7da70e49837dd16234b23589cbb
siovanus/chainlink
/core/store/prometheus.go
Go
go
1,104
permissive
package store import ( "chainlink/core/assets" "chainlink/core/eth" "chainlink/core/logger" "errors" "fmt" "math" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var promETHBalance = promauto.Ne...
5f13eb97273584be34dccfaab1fa01483d9e033b
d6314155509908cd87ef77d0d7bd19cbb9ddb66b
huaweicloud/huaweicloud-sdk-go-v3
/services/bss/v2/model/model_update_sub_enterprise_amount_response.go
Go
go
489
permissive
package model import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" "strings" ) // UpdateSubEnterpriseAmountResponse Response Object type UpdateSubEnterpriseAmountResponse struct { HttpStatusCode int `json:"-"` } func (o UpdateSubEnterpriseAmountResponse) String() string { data, err := utils.Marsha...
e5bfd6b40f9eb79ccb5c36ee3cc919281409471b
3d7bac13692161187bd897487fe37dec4ac1899c
YAWAL/GoTraining
/database/redis/main/stringManipulation.go
Go
go
527
no_license
package main import ( "fmt" "github.com/8tomat8/SSU-Golang-252-Chat/loger" "github.com/YAWAL/GoTraining/database/redis" ) func main() { conn, err := redis.GetRedisConn() if err != nil { loger.Log.Error(err) } conn.Cmd("INCR", "arg1") s, err := conn.Cmd("GET", "arg1").Str() fmt.Println("arg1:", s) s, er...
e47e6dbeb40dd80a423703cee87b777ef6825e8d
4b066d3d6c9d13e13afcfc702119b8f03d4776b5
gijs/elastic_guardian
/authorization/authorization_test.go
Go
go
3,763
permissive
package authorization import ( "strings" "testing" ) func loadAuthorizations() { LoadAuthorizations(AuthorizationStore{ "foo": AuthorizationRules{Allow, []string{"GET /_cluster/health"}}, "baz": AuthorizationRules{Deny, []string{"GET /_cluster/health"}}, }) } func TestLoadAuthorizations(t *testing.T) { auth...
40ccb6fbc686b152f78f10d86ce75907a58f67cf
8f5c6e81e121136b55e0914bd78163b542c04bd1
andyhuang123/goblog
/tags/productList.go
Go
go
3,903
permissive
package tags import ( "fmt" "github.com/iris-contrib/pongo2" "github.com/kataras/iris/v12/context" "irisweb/config" "irisweb/model" "irisweb/provider" "strconv" ) type tagProductListNode struct { name string args map[string]pongo2.IEvaluator wrapper *pongo2.NodeWrapper } func (node *tagProductListNod...
3d178038fa012451955a8e7dd02ad4f306e21646
3686174d16d7c19d896083f19d6b536fedeeaf8f
andrecronje/go-lachesis
/src/peers/peers.go
Go
go
3,213
permissive
package peers import ( "sort" "sync" ) type PubKeyPeers map[string]*Peer type IdPeers map[int64]*Peer type Listener func(*Peer) type Peers struct { sync.RWMutex Sorted []*Peer ByPubKey PubKeyPeers ById IdPeers Listeners []Listener } /* Constructors */ func NewPeers() *Peers { return &Peers{ ByPu...
0466a621a6e45b749970fc9407f00e6ad58334bd
4e164825605ba95b88ed92df9486253be708dae4
m0xsec/poussin-archive
/emu/cpu/mem.go
Go
go
3,836
permissive
package cpu // Fetch reads a byte from mapped memory func (c *CPU) Fetch(addr uint16) byte { var v byte switch AddrToMemType(addr) { case ROM0: v = c.FetchROM0(addr) case ROMX: v = c.FetchROMX(addr) case VRAM: v = c.PPU.Fetch(addr) case IO: v = c.FetchIO(addr) case IERegister: v = c.FetchIE() default...
b17a02158989e44685d2ef080e8f77b96476c5d7
c6d39ddfbcf35aa2211f63006ebb20233ce2e06c
shan8851/lets-go
/01_HelloWorld/main.go
Go
go
666
no_license
/* Problem #1: Hello World Author: Asam Shan Date Created: 21/05/2019 */ /* ***************** HELLO WORLD ***************** Write a program that prints out the message "Hello World" */ /* Every Go program must inclucde a package and a function named main. */ package main /* Any packages required must be imported us...
3e284b3a03247a43f971d6a0f372cca2ed6e949b
2ed5dfbdf3fb7748e787c20fdc9d5f4167782247
tvallois/cds
/engine/api/workflow/dao_run.go
Go
go
10,344
permissive
package workflow import ( "database/sql" "encoding/json" "sort" "strings" "time" "github.com/go-gorp/gorp" "github.com/ovh/cds/sdk" "github.com/ovh/cds/sdk/log" ) // insertWorkflowRun inserts in table "workflow_run"" func insertWorkflowRun(db gorp.SqlExecutor, w *sdk.WorkflowRun) error { runDB := Run(*w) ...
6350c56198cfc941613c4c7c7459146d0aaa6ab5
83a77b9cb46f9eaeb4cb329254f08beddff64103
YoshitsuguFujii/file_exchange
/server/udp_server.go
Go
go
853
no_license
package server import ( "../lib" "fmt" "net" ) const UdpPort = ":8889" func RunUdpServ() { fmt.Println("### Server(Udp) Start on" + UdpPort + " ###") addr, err := net.ResolveUDPAddr("udp", UdpPort) if err != nil { fmt.Println(err) } conn, err := net.ListenUDP("udp", addr) if err != nil { fmt.Println(e...
7b6535839d92fc2c054e9fe77a08248e936c140a
81f84ee478c4e5bb7eaaff4eda325cb2b44f15d9
jjmin321/mypackage
/library/verificationCode.go
Go
go
493
no_license
package lib import ( "crypto/rand" "io" ) // VerificationCode - x자리 숫자를 반환해 주는 함수 Ex) VerificationCode(6) - 6자리 숫자를 랜덤으로 생성해서 반환 func VerificationCode(max int) string { var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'} b := make([]byte, max) n, err := io.ReadAtLeast(rand.Reader, b, max) if...
8259769e748fb8efd8b13aa0f7a70cb2f5f49374
f31d0a12b5913b24461cab2019fa5a0786e0313e
Theo730/postcode
/postcode/initMysql.go
Go
go
3,480
permissive
package postcode import ( "fmt" ylog "github.com/postcode/lib/ylog" ) // InitMysql - создание структуры таблиц Mysql func InitMysql() error { var err error _, err = Db.Exec("DROP TABLE IF EXISTS citys ") if err != nil { ylog.YLog(3, fmt.Sprintf("%s",err), err.Error()) return err } _, er...
0e9ffed1d8c8496f550c6f803ee5761d9e6c74cd
eb2a0dc9f11f9545b70a7261e7753f9152f56bdc
synccat/golang-study
/goStudy/13_字符串类型.go
Go
go
314
no_license
package main import "fmt" func main() { var str1 string //声明变量 str1 = "abc" fmt.Println("str1 = ", str1) //自动推导类型 str2 := "def" fmt.Printf("str2 类型是 %T\n", str2) //内建函数,len()可以测定字符串的长度,有多少个字符 fmt.Println("len(str2)= ", len(str2)) }
14c7a739b4cb2539b5fecbcced55de8a6225e16d
9e5e76a773c98f5e906f2f96fb3716d59b700bb3
Eric-GreenComb/spvwallet
/datastore_test.go
Go
go
9,227
permissive
package spvwallet import ( "bytes" "encoding/hex" "errors" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" "sort" "strconv" "testing" "time" ) type MockDatastore struct { keys Keys utxos Utxos stxos Stxos txns ...
36973c522580a5f3c542b7aa28171da8e666a4ec
7611380e611e253aee4ec4e07d7b697df83108d5
Kapil22c/go_crash_course
/13_interfaces/main.go
Go
go
599
no_license
package main import ( "fmt" "math" ) // Define interface type Shape interface { area() float64 } type Circle struct { x, y, radius float64 } type Rectangle struct { width, height float64 } func (c Circle) area() float64 { return math.Pi * c.radius * c.radius } func (r Rectangle) area() float64 { return r.w...
6cf069bd618c77a452e06dc59d46788ca9c30568
7f47e48881b52d32d8e00ee69bd1f297ce889c89
vitaminwater/chronic-o-timelapse
/upload.go
Go
go
813
no_license
package main import ( "fmt" "os" "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox" "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/files" "github.com/sirupsen/logrus" ) func fu(e error) { if e != nil { logrus.Fatal(e) } } func MustGetenv(name string) string { v := os.Getenv(name) if v == "" { ...
e5923c634dcd42a63165d990e69915e382f48018
e822b2d9acf9843dc6ebebb2e439c23d0f29206b
GeekyVenkat/Go-Apps
/structs-functions/Anonymous/Anonymous.go
Go
go
247
no_license
package main import "fmt" func main() { p1 := struct { firstName string lastName string age int }{ firstName: "James", lastName: "Bond", age: 32, } fmt.Println(p1.lastName, p1.firstName, p1.age) }
930d19f55fc160cdf6addb693668f5c4533b66ab
707b2e9629d4b2af598c1f632d3d6689bfd2c0af
tamarakaufler/grpc-char-vs-rune
/internal/lib-service-run/grpc/client/interceptor.go
Go
go
1,092
no_license
package client import ( "context" "google.golang.org/grpc" ) // UnaryChain chains unary interceptors processing them right-to-left // for left-to-right execution. func UnaryChain( interceptors ...grpc.UnaryClientInterceptor, ) grpc.UnaryClientInterceptor { return func( ctx context.Context, method string, r...
1933f261e280fe1617bca3f4aa6e68134611e1d1
d1328b0b5a326c85de04d114e808d05f9d130008
DinoInc/fhir
/models/measure.go
Go
go
76,268
permissive
// Copyright (c) 2011-2017, HL7, Inc & The MITRE Corporation // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, ...
2ca9a6b023ba2ff3c122994f0d091c433cd4a317
dd1f575195cc69b9c85adf48df9a06dc11a42c71
inteI-cloud/portainer
/api/http/handler/users/user_update.go
Go
go
3,595
permissive
package users import ( "errors" "net/http" "github.com/asaskevich/govalidator" httperror "github.com/portainer/libhttp/error" "github.com/portainer/libhttp/request" "github.com/portainer/libhttp/response" "github.com/portainer/portainer/api" bolterrors "github.com/portainer/portainer/api/bolt/errors" httperr...
fbca223950e950860668e5b925e95971025c7a8b
d0bc340d746b8eace188c9f974dd25c0c41d8727
Uarealoser/pocket
/xlog/formatter.go
Go
go
343
no_license
package xlog import ( "bytes" "sync" ) var ( bufferPool *sync.Pool ) func init() { bufferPool = &sync.Pool{ New: func() interface{} { return new(bytes.Buffer) }, } } func newFormatter(conf FormatterConfig) Formatter { return NewDefaultFormatter(conf) } // formatter type Formatter interface { Format(en...
581427d9f5b131436bb7d50131e28c3490e8840d
08ff6b90277e9acd2f11df927878d1e462a4d8e6
kpiyush04/cloud-run-events
/vendor/knative.dev/pkg/webhook/webhook.go
Go
go
21,794
permissive
/* Copyright 2017 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...
bdcbcf5c2554d40acaa348938c1c690f064a0dd1
e55b56765166c5b63f84d8b5ad6773713e4ce5f7
gonum/gonum
/dsp/fourier/fourier_example_test.go
Go
go
6,607
permissive
// Copyright ©2018 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 fourier_test import ( "fmt" "math" "math/cmplx" "gonum.org/v1/gonum/dsp/fourier" "gonum.org/v1/gonum/floats/scalar" "gonum.org/v1/gonum/mat"...
1391b0b8b1bef86136b881b6f32e55262548751f
9caff13bba67daa2ab4d9a35afa7c6a2b4081e6f
catweisun/iac-terraform
/modules/cosmosdb/test/unit_test.go
Go
go
1,863
permissive
package test import ( "encoding/json" "testing" "github.com/gruntwork-io/terratest/modules/random" "github.com/gruntwork-io/terratest/modules/terraform" "github.com/microsoft/cobalt/test-harness/infratests" ) var name = "cosmosdb-" var location = "eastus" var count = 10 var tfOptions = &terraform.Options{ Ter...
06588be7192c9b284cc741ce8c29f5cdc4d58480
f74105f45927c9e33dde6cb29110e0ed3af20df1
beevik/siv-go
/aes_gcm_generic.go
Go
go
5,440
permissive
// Copyright (c) 2018 Andreas Auernhammer. All rights reserved. // Use of this source code is governed by a license that can be // found in the LICENSE file. package siv import ( "crypto/aes" "crypto/cipher" "crypto/subtle" "encoding/binary" ) func newGCMGeneric(key []byte) aead { block, _ := aes.NewCipher(key)...
b215c2c1d8a406178c9d50590a167f56f7f513f8
5ce3766b5aa3da496c8f2b3dffb06c7fcba712fb
P79N6A/ie310go
/forks/github.com/siddontang/ledisdb/store/stat.go
Go
go
1,018
permissive
package store import ( "github.com/ie310mu/ie310go/forks/github.com/siddontang/go/sync2" ) type Stat struct { GetNum sync2.AtomicInt64 GetMissingNum sync2.AtomicInt64 GetTotalTime sync2.AtomicDuration PutNum sync2.AtomicInt64 DeleteNum sync2.AtomicInt64 Ite...
b5621e9dd92162ae2d34e7a087483751a614ed6d
efd21529e1f57e8a9a7bda11accf545b67f3b0e7
casperdcl/cli
/pkg/cmd/workflow/shared/shared.go
Go
go
6,131
permissive
package shared import ( "encoding/base64" "errors" "fmt" "net/url" "path" "strconv" "strings" "github.com/AlecAivazis/survey/v2" "github.com/cli/cli/v2/api" "github.com/cli/cli/v2/internal/ghrepo" "github.com/cli/cli/v2/pkg/iostreams" "github.com/cli/cli/v2/pkg/prompt" ) const ( Active Workf...
29d2c61633dc0a22b84b73de8c96fd7c651441ef
1f84e76fa44d88f606b998d22e948ed23636ee32
tomlister/ebiten
/examples/drag/main.go
Go
go
7,227
permissive
// Copyright 2018 The Ebiten 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...
dd35e52dccea236deecddfa62143d686aae2ac68
6d39a281348c96192c683ddca339a8b604c2bf29
luckylsx/kratos
/transport/grpc/server.go
Go
go
4,923
permissive
package grpc import ( "context" "net" "net/url" "sync" "time" apimd "github.com/go-kratos/kratos/v2/api/metadata" ic "github.com/go-kratos/kratos/v2/internal/context" "github.com/go-kratos/kratos/v2/internal/host" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware" "github.com/...
82123ec927ce0f383daa084b3848186d5b4f7c79
509429a14304ad4502896624da9faf9ad2bf4996
kedixa/gopl-exercises
/ch05/01/main.go
Go
go
739
no_license
package main import ( "fmt" "os" "golang.org/x/net/html" ) func main() { doc, err := html.Parse(os.Stdin) if err != nil { fmt.Fprintf(os.Stderr, "main: %v\n", err) os.Exit(1) } for _, link := range visit(nil, doc) { fmt.Println(link) } } // visit appends to links each link found in n and returns the r...
fed362ea6f0840b099303515d94c0afee980b870
feb07a879de51a5bb7d8ff094bc3c8ff823129d4
rafaelsouzak2b/Curso-Go-Lang
/testes/matematica/matematica.go
Go
go
360
no_license
package matematica import ( "fmt" "strconv" ) //Media é responsável por calcular o que você já sabe... :) func Media(numeros ...float64) float64 { total := 0.0 for _, num := range numeros { total += num } media := total / float64(len(numeros)) mediaArredondada, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", med...
5387ecbbdcf806b855f3849ea8ff8a6e0712f367
7b61359826d2fce0d0b301c52d0ca7deadb3239f
lkatalin/cosign
/pkg/cosign/tlog.go
Go
go
7,616
permissive
// Copyright 2021 The Sigstore 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...
acadf986f6fa56214c983291576820efe515626b
9cab3c6b62b3cf97acefdb3fe06eb79c78f1b0e4
FleekHQ/minio
/cmd/metacache-set.go
Go
go
23,105
permissive
// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (...
c25602191287f322d23129cb1069eb9921620218
2d414058c6a0da1f4b98a416e869283b03408636
Maheswari-87/goPrograms
/pkg/mod/github.com/!jeffail/gabs@v1.4.0/gabs_test.go
Go
go
34,065
permissive
package gabs import ( "bytes" "encoding/json" "fmt" "strings" "testing" ) func TestBasic(t *testing.T) { sample := []byte(`{"test":{"value":10},"test2":20}`) val, err := ParseJSON(sample) if err != nil { t.Errorf("Failed to parse: %v", err) return } if result, ok := val.Search([]string{"test", "value"...
61c263208b88bfdbaf24402d18313038f8acb245
061a2cd59348fcd247ec41af1657c7e0a3862fbe
xinleiw/go_learing
/src/ch3/type_test/type_test.go
Go
go
455
no_license
package type_test import "testing" type MyInt int32 func TestImpliccitConvert(t *testing.T){ var a int32 = 1 var b int64 var c MyInt // b = a b = int64(a) c = MyInt(a) // c = a t.Log(b, a, c) } func TestPoint(t *testing.T){ a:=1 aPtr := &a // aPtr = aPtr + 1 t.Log(a, aPtr) t.Logf("%T %T", a, aPtr) } ...
add1a1d960e609df9d80c66113f0086c1ba5eb8e
31aa4179444c04d67b6e15d9c78303569f4f3942
dnaproject2/DNA
/p2pserver/message/types/disconnected.go
Go
go
1,184
permissive
/* * Copyright (C) 2018 The DNA Authors * This file is part of The DNA library. * * The DNA is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) ...
ef3ce623f900f7e74d87f06a7646667bc59c56b9
823aeae2ceb418a50ea9c90dd91937d472f2ed78
dongdaoguang/xcache
/codis/pkg/topom/topom.go
Go
go
12,812
permissive
// Copyright 2016 CodisLabs. All Rights Reserved. // Licensed under the MIT (MIT-LICENSE.txt) license. package topom import ( "container/list" "net" "net/http" "os" "os/exec" "strconv" "strings" "sync" "sync/atomic" "time" "github.com/CodisLabs/codis/pkg/models" "github.com/CodisLabs/codis/pkg/utils" "g...
e5826e4772e8e4f53ddb78b9c2ea234de651f57e
0031f23efc32fcb5f7e04d67f8f280974585df73
radanalyticsio/kubespark-operator
/vendor/github.com/openshift/origin/pkg/auth/authenticator/password/keystonepassword/keystonepassword.go
Go
go
2,958
permissive
package keystonepassword import ( "fmt" "net/http" "runtime/debug" "github.com/golang/glog" "github.com/rackspace/gophercloud" "github.com/rackspace/gophercloud/openstack" authapi "github.com/openshift/origin/pkg/auth/api" "github.com/openshift/origin/pkg/auth/authenticator" "k8s.io/kubernetes/pkg/auth/user...
684ff4836b5a25343690fc9778db1bece534ef17
3b69a60423703d916ca94b47b1860bfcc5c030a3
daominah/hello_go
/regex_try/regex_test.go
Go
go
503
no_license
package main import ( "log" "regexp" "testing" ) func TestRegexpMatch(t *testing.T) { pattern0, err := regexp.Compile(`^[a-zA-Z0-9._, -]*$`) if err != nil { log.Fatalf("error regexp Compile: %v", err) } for _, c := range []struct { s string m bool }{ {`key0_val0_1.23, Reg-Exp is not for human`, true}...
905f57569d70766afc42ddd68ab37e207d3c106a
ff6696af469d4532f3649236689440e1cbdd1d3f
crazy-me/os_tel
/service/tel.go
Go
go
1,422
no_license
package service import ( "fmt" "github.com/crazy-me/os_tel/entity" "github.com/crazy-me/os_tel/utils" "github.com/tarm/serial" "log" "os" "strconv" "strings" ) var l log.Logger func init() { _ = utils.CreateDir("logs") logFile, _ := os.OpenFile("logs/tel_error.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 064...
917c1bc440219d1cc281966e82cbf6a8705908b5
c62919d9217072f1d85c4165854949ff1446ee50
dangyanglim/go-LeetCode
/isAnagram/main.go
Go
go
646
no_license
package main func isAnagram(s string, t string) bool { var temp byte=0; var des []byte; var tar []byte; for l:=0;l<len(s);l++{ des=append(des,s[l]) } for l:=0;l<len(t);l++{ tar=append(tar,t[l]) } for i:=0;i<len(des);i++ { for j:=i+1;j<len(des);j++ { if des[j]>des[i] { temp=des[i] des[i]=des[j]...
01cca7aacfe4b069e0e6b5ed18567d2186e1dfeb
7d191c52b8999d703a1889d4c0a24db21cec31ab
trisberg/cli
/pkg/riff/commands/completion_test.go
Go
go
2,597
permissive
/* * Copyright 2019 The original author or 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 applicabl...
a17bce83c4e15b99ec7fba4fafa4c709c29349af
e9373101beed4d03c0240357f8f904278493d6bb
chaos-mesh/chaos-mesh
/pkg/webhook/validate_auth.go
Go
go
5,402
permissive
// Copyright 2021 Chaos Mesh 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...
64df007d43a0173f8ee685e1c421638c07630946
07dfaa08f9ac50e8146210e7f2c3bafc7de193e7
luis-silva/drone-terraform
/plugin.go
Go
go
9,813
permissive
package main import ( "fmt" "io/ioutil" "os" "os/exec" "os/user" "path/filepath" "regexp" "strings" "time" "github.com/Sirupsen/logrus" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/serv...
0cd1fa1d6b6312f6ee0a7bf0402d9475e67c733e
3071fb468078069bffcdbb1b44580e8904bf33a0
pandeaarkin/antrea
/pkg/controller/networkpolicy/clustergroup_test.go
Go
go
20,126
permissive
// Copyright 2021 Antrea 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 ...
2769764d553d94077f012558901b179f2cd130d5
1ae81c3e32d07c9694b1ffabc2aa169155e54925
tanbinh123/JvmGo
/instruction/extended/wide.go
Go
go
1,932
no_license
package extended import "jvmgo/instruction/base" import "jvmgo/instruction/loads" import "jvmgo/instruction/math" import "jvmgo/instruction/stores" import "jvmgo/rtdata" //扩展指令,用额外一个byte,扩展加载指令和存储指令,扩展成2字节,增加了局部变量表的索引宽度 type WIDE struct { modifiedInstruction base.Instruction //被改变的指令 } func (self *WIDE) FetchOperan...