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
e22ddef038cdb7647b2d774e6fef20e98c19ad90
41d1e57af9d26b9a6a5a1d56cc5e9dbfaf2d8eab
ptpkueqf/Sava
/vertices/pagerankvertex.go
Go
go
1,608
no_license
package vertices import ( "Sava/util" ) //PageRankVertex ... type PageRankVertex struct { BaseVertex NumVertices int } const vertValue = 0.15 const edgeWeight = 0.85 // Compute ... func (prv *PageRankVertex) Compute(Step int, MsgCHan chan util.WorkerMessage) { //log.Println("-------Vertex" + strconv.Itoa(prv.ID...
8d2159f0d4ec190e9fa2b2eb174074160b952683
b9f703f7e46735c548fe165a4bf9d2e6feecb15a
conradludgate/chain
/compress/gzip.go
Go
go
628
permissive
package compress import ( "compress/gzip" "io" ) type GZIPConfig struct { Header gzip.Header level int } func (c *GZIPConfig) WithLevel(level int) *GZIPConfig { // Annoyingly, 'gzip.DefaultCompression` is the contant -1... not 0 // Go ints default to 0 so adding 1 makes them inline c.level = level + 1 retur...
17af6cc7a3fb2c3a7981c0b2a47808621f2fc3a7
23063590d4f83a1a03371bba9a84efa3d7b0cb3a
hongzhen-ma/kube-ovn
/cmd/pinger/pinger.go
Go
go
1,024
permissive
package pinger import ( "fmt" "net/http" _ "net/http/pprof" // #nosec "time" "github.com/prometheus/client_golang/prometheus/promhttp" "k8s.io/klog/v2" "github.com/kubeovn/kube-ovn/pkg/pinger" "github.com/kubeovn/kube-ovn/pkg/util" "github.com/kubeovn/kube-ovn/versions" ) func CmdMain() { defer klog.Flush...
b2c6e0faa2825cf59700e1c6b93f0a8731a2afd0
4adff35388d62087daf0d2a534c1e362fffab309
morrell/pulumi-azure-native
/sdk/go/azure/storage/v20181101/init.go
Go
go
1,395
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 v20181101 import ( "fmt" "github.com/blang/semver" "github.com/pulumi/pulumi-azure-native/sdk/go/azure" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) ...
8883a3896c424bf8fa49311e57b167834eb0de22
5340948bb06cb56cefd31b69d5fceb864afef280
awrznc/scribble
/grpc/src/sample/golang/server.go
Go
go
414
no_license
package main import ( "log" "net" protobuf "./sample" "./service" "google.golang.org/grpc" ) func main() { listenPort, err := net.Listen("tcp", ":19003") if err != nil { log.Fatalf("failed to listen: %v", err) } server := grpc.NewServer() sampleService := &service.SampleServ...
2153c78aca106cb7038c05406010298328f9459d
8badfdad874faecaf7e744463b75002d800dd370
bison/istio
/pilot/pkg/xds/debug.go
Go
go
29,052
permissive
// Copyright Istio 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 wri...
2b8f697783e7cd59d1ee0f6b3b580c69bc41723e
6dd615f61fa528e4552a3a5e2e13d74b92849416
pilgrim2go/empire
/scheduler/scheduler.go
Go
go
4,010
permissive
// Package scheduler provides the core interface that Empire uses when // interacting with a cluster of machines to run tasks. package scheduler import ( "io" "time" "github.com/remind101/empire/pkg/image" "golang.org/x/net/context" ) type App struct { // The id of the app. ID string // An identifier that re...
61e1da4e6472804e019804976a6fe3619f87cbf5
504a2c6abbfac229aced2b9cad66e9ef3cac0d90
oldmantaiter/aerospike-client-go
/node_validator.go
Go
go
3,742
permissive
// Copyright 2013-2015 Aerospike, 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 t...
9d7de32355597df88e0df6ded64631ffadbc3025
64a2f28ece1967d70ac32e3932edef70eb4805bf
silenceper/wechat
/work/externalcontact/msg.go
Go
go
14,786
permissive
package externalcontact import ( "fmt" "github.com/silenceper/wechat/v2/util" ) const ( // addMsgTemplateURL 创建企业群发 addMsgTemplateURL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_msg_template?access_token=%s" // getGroupMsgListV2URL 获取群发记录列表 getGroupMsgListV2URL = "https://qyapi.weixin.qq.com/cgi...
7952bc9aaae2bf8263f542a5c8e28f0190168040
9ceedda40c57ac433fe75b9a5f59f0284c20ac7d
trusch/http-echo
/main.go
Go
go
533
no_license
package main import ( "encoding/json" "io/ioutil" "log" "net/http" ) type Response struct { URL string Header http.Header Body string } func handler(w http.ResponseWriter, r *http.Request) { body, _ := ioutil.ReadAll(r.Body) resp := &Response{ URL: r.URL.String(), Header: r.Header, Body: str...
d6694df2ea0359c062b859663c241ae83d6cb37f
a9cdd730bd4f1898b1b42d617cc59e37e599fb08
sp98/local-storage-operator
/diskmaker/controllers/lvset/reconcile.go
Go
go
18,309
permissive
package lvset import ( "context" "fmt" "os" "path/filepath" "time" "github.com/go-logr/logr" localv1 "github.com/openshift/local-storage-operator/api/v1" localv1alpha1 "github.com/openshift/local-storage-operator/api/v1alpha1" "github.com/openshift/local-storage-operator/common" "github.com/openshift/local-...
f71ad77e8b456e1eeb6c9f8a5ab81e9c6e89d83b
e3f63bfd655ed40d964397dabda7a8aa54631097
thomaspoignant/yamllint-checkstyle
/extractor/extractor.go
Go
go
865
permissive
package extractor import ( "fmt" "regexp" "strconv" "github.com/thomaspoignant/yamllint-checkstyle/checkstyle" ) var ExtractRegex = regexp.MustCompile(`^([^:]*):([0-9]*):([0-9]*): \[(.*)\] (.*) \((.*)\)$`) func YamlLintExtractor(inputLine string) (string, checkstyle.Error, error){ extractedRegex := ExtractRegex....
6749dec1c4b18608ce6626378d8644251f778c27
c5f7f008b105835be08a3a1166aa85c4620f1758
ihsanhusaeri/pragmatic-review
/main.go
Go
go
816
no_license
package main import ( "fmt" "net/http" "github.com/ihsan/pragmatic-review/controller" router "github.com/ihsan/pragmatic-review/http" "github.com/ihsan/pragmatic-review/repository" "github.com/ihsan/pragmatic-review/service" ) var ( postRepo repository.PostRepository = repository.NewFirestoreRepository(...
79b8587ab3fb1c276dc46e143fef004a461c74e5
4d0bd7891640885b86aac643ee9594cb95945e2b
zzz0906/LeetCode
/2022_Jun/6.go
Go
go
344
permissive
/** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func getIntersectionNode(headA, headB *ListNode) *ListNode { a := headA b := headB for a != b { if a == nil { a = headB } else { a = a.Next } if b == nil { b = headA } else { b = b...
cc453f26085b57f19e90412f8c03fc1d141d9577
a0d44d8a917ecda21e6ecfac18cef0ce379300d8
bpkgoud/pulumi-azure-native
/sdk/go/azure/datamigration/getTask.go
Go
go
840
permissive
package datamigration import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func LookupTask(ctx *pulumi.Context, args *LookupTaskArgs, opts ...pulumi.InvokeOption) (*LookupTaskResult, error) { var rv LookupTaskResult err := ctx.Invoke("azure-native:datamigration:getTask", args, &rv, opts...) if err != nil { ...
64c436f83f3bad84558c42d951a170376ce9350d
7030c701e1690f1435f139e24b64fec79e89af7d
tenchlee/roader
/gate_listener/gate_listener.go
Go
go
462
no_license
package gate_listener import ( "github.com/tenchlee/roader/endpoint" "strconv" ) type IGateListener interface { Listen(port int) error Close() } type GateListener struct { port int ip string ep_map map[string] *endpoint.IEndpoint } func (gl *GateListener)init() { } func (gl *GateListener)getEndpoint(id stri...
7168d23d1a23086bee619c9bdc8c255438816ae8
ea41b7239aa7bc75b36376050aeb900d76f632e9
adeleporte/go-vmware-velocloud
/model_security_vnf_service.go
Go
go
1,380
no_license
/* * VeloCloud Orchestrator API * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * API version: 3.3.2 * Contact: support@velocloud.net * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ package openapi import ( "time" ) type S...
d6d3ef8cd103a171cc35d0141bc62ff30b47782b
509fe097f1d8dbacdad7c3ec73f07b3680f39031
owulveryck/onnx-go
/backend/testbackend/onnx/onnx_test_cast_FLOAT_to_DOUBLE_test.go
Go
go
735
permissive
package onnxtest import ( "testing" "github.com/gogo/protobuf/proto" "github.com/owulveryck/onnx-go/internal/onnx/ir" ) func TestNewTestCastFLOATToDOUBLE(t *testing.T) { mytest := NewTestCastFLOATToDOUBLE() var model ir.ModelProto err := proto.Unmarshal(mytest.ModelB, &model) if err != nil { t.Fatal(err) }...
c817b5a6f1f46126569becdc185a80be95281b6f
b10fa84c42433ccc2be490ac0e42978e981789f7
sammy22/opentelemetry-collector-contrib
/processor/k8sprocessor/processor_test.go
Go
go
23,700
permissive
// Copyright 2020 OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
43a320de8d8db0c369ab1c34bd0083397c4c1604
a63c26212a83cf062bee48d972886270fe4dc8f4
nalakawula/rook
/tests/framework/installer/ceph_installer.go
Go
go
21,711
permissive
/* Copyright 2016 The Rook 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 agreed to ...
a9c980e8591530ed132d134044a725b38af3f4d5
84b567fa5e24f8036c8db145e4976a8fe7c7b5a8
intel/pmem-csi
/test/e2e/storage/wait.go
Go
go
2,958
permissive
/* Copyright 2014 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, sof...
0c1dd2c5cef98fe9e6af6f9be3a6eac329cf179a
f3e47e6518ef768913b4ce0ef809b33a9b798d3c
InVisionApp/go-swagger
/examples/stream-server/cmd/countdown-server/main.go
Go
go
1,292
permissive
package main import ( "log" "os" loads "github.com/go-openapi/loads" flags "github.com/jessevdk/go-flags" "github.com/go-swagger/go-swagger/examples/stream-server/restapi" "github.com/go-swagger/go-swagger/examples/stream-server/restapi/operations" ) // This file was generated by the swagger tool. // Make sur...
2d6bef31a5a28f21ffcccd9e55b2a815f2a5852f
a07786283b954a0d5d90e652435c1db8e26c6633
qq524967747/LetsDiagram
/let-diagram-api/src/core/connection/pingpong/ping.go
Go
go
1,597
permissive
package pingpong import ( `lets_diagram/src/core/access` ) type PingType int const ( PingTypeVersionControl PingType = iota + 1 // 版本控制信息 PingTypeHeartbeat // 心跳包 PingTypePermissionControl // 权限控制信息 ) type PingPermissionControlType int const ( ...
148970da018d8cad0cd63d81b1b2dbfeaeb8f9c4
422bb9ae94c119893f5da7f536888d18cf145a0c
Himujjal/lf
/misc.go
Go
go
4,857
permissive
package main import ( "fmt" "path/filepath" "regexp" "strconv" "strings" "unicode" "github.com/mattn/go-runewidth" ) func isRoot(name string) bool { return filepath.Dir(name) == name } func replaceTilde(s string) string { if strings.HasPrefix(s, "~") { s = strings.Replace(s, "~", gUser.HomeDir, 1) } ret...
cf0953555731b9fc3f676bc012c089a38acb6595
e59ee80e51caa9cca8a70aec7081d5056aa62349
HuanLiu-hotstar/demo-tracing
/zipkin/demo/gateway/util.go
Go
go
587
no_license
package main import ( "encoding/json" "io/ioutil" "net/http" ) type Req struct { ID string `json:"id"` } type Resp struct { Code int32 `json:"code"` Msg string `json:"msg"` } func getbody(r *http.Request) (*Req, error) { req := &Req{} body, err := ioutil.ReadAll(r.Body) if err != nil { return req, err ...
0ba80f5f3f4b26721da20efc3a73da690d8038b9
7d601d14dd33a75c907c1b43d4b3898850692d7d
TencentAd/marketing-api-go-sdk
/pkg/model/model_ad.go
Go
go
438
permissive
/* * Marketing API * * Marketing API * * API version: 1.3 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package model // 广告信息 type Ad struct { AdName *string `json:"ad_name,omitempty"` Adcreative *PreviewAdcreative `json:"adcr...
371ac5e34906042942dd82187c3432947b91c7ef
111733bb747ac8e80ddb265999355835d2b941ec
maliciouscereal/lazygit
/pkg/commands/git_commands/file.go
Go
go
1,760
permissive
package git_commands import ( "os" "strconv" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/utils" ) type FileCommands struct { *GitCommon } func NewFileCommands(gitCommon *GitCommon) *FileCommands { return &FileCommands{ GitCommon: gitCommon, } } // Cat obtains the content of a file ...
3d2b2ca17c94f2467cee881594477b8dcb2541c0
28fa20fbe5eef2b11792eca07c961fb0914b33f1
peterwillcn/Elastos.ELA
/servers/httpwebsocket/server.go
Go
go
7,810
permissive
// Copyright (c) 2017-2020 The Elastos Foundation // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. // package httpwebsocket import ( "context" "crypto/tls" "encoding/json" "net" "net/http" "strconv" "sync" "sync/atomic" "time" "github.com/elastos/Elastos.EL...
25754da51adf8a111774e6ee46f7b412c24a27b1
7c788ed83b899da8ec027565c69738bd8740eea0
aruaru0/golang_myatcoder
/yukicoder/000-999/034/main.go
Go
go
2,420
no_license
package main import ( "bufio" "fmt" "math" "os" "sort" "strconv" ) func out(x ...interface{}) { fmt.Println(x...) } var sc = bufio.NewScanner(os.Stdin) func getInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } func getInts(N int) []int...
daba591cdb4d8eaf2b8dac47693e025042ef708a
bfa4349b08ad94e28dc06c5137af853d8a3e6d67
GameLeLe/trade-addr-tx-service
/rpc_test.go
Go
go
3,086
no_license
package main import ( "strconv" "strings" "sync" "testing" "time" "git.apache.org/thrift.git/lib/go/thrift" hdwallet "github.com/GameLeLe/trade-addr-tx-service/hdwallet" addrtx "github.com/GameLeLe/trade-addr-tx-service/thrift/addrtx" "github.com/stretchr/testify/assert" ) func TestGetAddr(t *testing.T) { ...
30329e6d42a10e7ec09976957bb887c74dd7d271
7becf3468d0da10d2ba72482f5937f625039606d
shivanshsinghraghuvanshi/toll-collector
/graphql/main.go
Go
go
960
no_license
package main import ( "github.com/99designs/gqlgen/handler" "github.com/go-chi/chi" "github.com/kelseyhightower/envconfig" "github.com/rs/cors" "log" "net/http" ) type AppConfig struct { TollTaxServiceURL string `envconfig:"TOLLTAX_SERVICE_URL"` PaymentServiceURL string `envconfig:"PAYMENT_SERVICE_URL"` } fu...
8f56658c530cbd03f9dd1a256ccb18ec3ba29e09
05aac3480f35d3f6d1acf0ff5a83005a20bd001d
orangejulius/goreleaser
/internal/pipe/release/release_test.go
Go
go
14,030
permissive
package release import ( "os" "path/filepath" "strings" "testing" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" "github.com/goreleaser/goreleaser/internal/testlib" "github.com/goreleaser/goreleaser/pkg/config" "github.com/goreleaser/goreleaser/pkg/con...
5d65331d187fe8d14afaefba105aa5534dd5d844
0a0fa23281df1c037ffd3a75d415d6f06da76701
missxiaolin/go-gw
/web/model/category.go
Go
go
363
no_license
package model type Category struct { ID uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"` Name string `gorm:"type:varchar(50);unique_index;not null;" json:"name"` Pid uint `gorm:"type:tinyint;not null;" json:"pid"` Status uint `gorm:"type:tinyint;not null;" json:"status"` Timestamps } func (c *Categor...
1f64bd0b6f76c496e30a916e49c1ec7d2a553174
b9a1947d7b7c1123609e8531ae8fd30ff5e8d816
Innoviox/AaaarghBot
/cmd/taktician/parse.go
Go
go
370
permissive
package main import ( "regexp" "strings" ) var commandRE = regexp.MustCompile(`^([^ :]+):?\s*([^ :]+):?\s*(.*)$`) func parseCommand(msg string) (string, string) { gs := commandRE.FindStringSubmatch(msg) if gs == nil { return "", "" } if !strings.EqualFold(gs[1], *user) && !strings.EqualFold(gs[1]+"bot", *u...
5e818a1d7a463301cad10b8d4bf5bf5743bae72d
e5df141228f4affaa155123172292149985fd2ea
dynamicdeploy/komu.engineer
/blogs/log-without-losing-context/code/main.go
Go
go
1,511
no_license
package main import ( "errors" "io/ioutil" "math/rand" "os" "time" "github.com/sirupsen/logrus" ) /* run as: go run -race . */ func main() { // send logs to nowhere by default logrus.SetOutput(ioutil.Discard) logrus.SetFormatter(&logrus.JSONFormatter{}) // Use our custom hook that will append logs to a...
08c9ae8638b9e6856565cf7aeef6d4bf58322bf3
27e73d0be82743b1da45e73e4a475a25c52af072
chai2010/walk
/declarative/builder.go
Go
go
17,349
permissive
// Copyright 2012 The Walk Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build windows package declarative import ( "fmt" "log" "reflect" "regexp" "strings" "github.com/chai2010/walk" "gopkg.in/Knetic/govaluate.v3" ) ...
6af60b7914f768edd8cadd6f3a115170403054f3
bfadb917163af4d595644b42cd48fb75ef591b30
NYULibraries/dlts-finding-aids-zek-generated-code_archived
/sample-set-2-individual-ead-files/mss_271.go
Go
go
10,113
no_license
type Ead struct { XMLName xml.Name `xml:"ead"` Text string `xml:",chardata"` Xmlns string `xml:"xmlns,attr"` Xlink string `xml:"xlink,attr"` Xsi string `xml:"xsi,attr"` SchemaLocation string `xml:"schemaLocation,attr"` Eadheader struct { Text ...
f6d58e77ef8a12cc2b179fbb3fdcb960c2e5cce6
e5f452e812e943b38099978060f40de64a18e6f2
kalifun/build-web-application
/struct类型/go_struct3.go
Go
go
339
no_license
package main import ( "fmt" ) type Human struct{ name string age int phone string } type Employea struct{ Human speciality string phone string } func main() { Bob := Employea{Human{"Bob",34,"123-456"},"Designer","456-789"} fmt.Println("Bob's work phone is :",Bob.phone) fmt.Println("Bob's personal phone is :"...
605d24e960b64512c812d5fbde9f451aa073514b
d7618a7e9b6734ee7462fb4b4e228b6de093967c
dapr/dapr
/pkg/components/pluggable/discovery_test.go
Go
go
6,802
permissive
/* Copyright 2022 The Dapr 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, software d...
896198dea1fb884b62cf663dacc5649a25391c34
0b045bc30984dc606c0b3dd9cac668bb2558426d
brcoding/moddingtalespire
/Mods/SocketAPI/GUI/main.go
Go
go
731
permissive
package main import ( "fyne.io/fyne" "fyne.io/fyne/widget" "fyne.io/fyne/app" "fyne.io/fyne/layout" ) func main() { app := app.New() w := app.NewWindow("ModdingTales Socket API GUI") w.SetContent( fyne.NewContainerWithLayout(layout.NewGridLayout(2), widget.NewVBox( ...
726672b449a410c6cf82572334649492013e9136
347a8fbfaafe83307fee684a219c8edc35da66a8
wutonytt/Programming-with-Google-Go
/course notes/c2_w3.go
Go
go
577
no_license
package main import ( "fmt" "main/data" "math" ) // type type MyInt int func (mi MyInt) Double() int { // receiver type --> implicit argument return int(mi * 2) } // struct type Point struct { x float64 y float64 } func (p Point) DistToOrig() float64 { t := math.Pow(p.x, 2) + math.Pow(p.y, 2) return math.S...
58dd719a8f6fd49b60442fd7fe0d0a6a040ffd5f
1b2a9aec27ab429f470c78123628a383d876f770
mehmetkesik/scoin
/transaction.go
Go
go
3,394
permissive
package main import ( "bytes" "github.com/satori/go.uuid" "crypto/x509" "encoding/gob" "github.com/boltdb/bolt" "errors" ) type Transaction struct { ID []byte Sign []byte PubKey []byte Address []byte Amount int64 } func AddTransaction(transaction *Transaction) error { //Transactionı veritabanına...
5835e0c1e0c769286e74e95461b25eb859324d99
2b6b8e561efb582b47a6fd6d38edf2d614ad86a1
guerrerocarlos/atlantis
/server/events/vcs/gitlab_client.go
Go
go
9,153
permissive
// Copyright 2017 HootSuite Media 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 ...
19d894a2bb031fa2ad5c9c943587bc612a498da4
abacfa30dd06e34764c85c7a325196eb6ca0cda3
wjn0918/redisSky
/backend/vendor/github.com/kataras/iris/core/host/proxy.go
Go
go
2,072
permissive
package host import ( "crypto/tls" "net/http" "net/http/httputil" "net/url" "strings" "github.com/kataras/iris/core/netutil" ) func singleJoiningSlash(a, b string) string { aslash := strings.HasSuffix(a, "/") bslash := strings.HasPrefix(b, "/") switch { case aslash && bslash: return a + b[1:] case !asla...
4bc6529d9d44f4fbfabe69850bceacb7663d01dc
a2038791fd245299dbfa033a7517c7c7d7bd55a3
mzkaramat/go-filecoin
/internal/app/go-filecoin/plumbing/msg/waiter_test.go
Go
go
8,082
permissive
package msg import ( "context" "sync" "testing" "time" "github.com/filecoin-project/go-filecoin/internal/pkg/block" "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/filecoin-project/go-filecoin/internal/pkg/c...
0453a5a17a6181f4347a4a602fb27179638b9155
0c92988cf55b9c4aa948124b8d47d09fabf28131
kubernetes-sigs/cloud-provider-huaweicloud
/vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/model/model_create_pool_request_body.go
Go
go
432
permissive
package model import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" "strings" ) // This is a auto create Body Object type CreatePoolRequestBody struct { Pool *CreatePoolOption `json:"pool"` } func (o CreatePoolRequestBody) String() string { data, err := utils.Marshal(o) if err != nil { return "C...
b9ceca33a39a9622d5745c94436ba333548cd56f
11a078d514f9ece90128a811f23ab92294e03cb2
ilikehome/studb
/db/cache/cache_test.go
Go
go
283
no_license
package cache import ( "testing" ) func TestBase(t *testing.T) { c := CreateCache(10) c.Put([3]byte{1,2,3}, "i") v := c.Get([3]byte{1,2,3}) if v != "i" { t.Fatal("Get fail.") } c.Del([3]byte{1,2,3}) v = c.Get([3]byte{1,2,3}) if v != nil { t.Fatal("Del fail.") } }
82ce35109f4ce9c9e4d10633637da56c440b7714
d9a14ee1f96bb1039763f53e4de38123375266c1
DalavanCloud/llgo
/third_party/gotools/go/ssa/const.go
Go
go
4,280
permissive
// Copyright 2013 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 ssa // This file defines the Const SSA value type. import ( "fmt" "go/token" "strconv" "llvm.org/llgo/third_party/gotools/go/exact" "llvm.org/ll...
b08b67c2d09eed9f5bafd0157c30218805f5eab0
024fd55aa9f5d00ee0994fbc450f5ce59ce40dda
orderchef/server-go
/routes/categories/categories.go
Go
go
2,229
no_license
package categories import ( "github.com/gin-gonic/gin" "lab.castawaylabs.com/orderchef/models" "lab.castawaylabs.com/orderchef/util" ) func Router(r *gin.RouterGroup) { func (api *gin.RouterGroup) { // GET /categories -> Get all categories api.GET("", GetAll) api.POST("", Add) }(r.Group("/categories")) f...
1f1bb0c671f6ded01c4213d90e176f578c309d13
ca87a0d52ce81ee9e44ae7bfd979ad2a5e5df186
umair-gujjar/vender
/hardware/mega-client/protocol_test.go
Go
go
2,018
permissive
package mega import ( "encoding/hex" "math/rand" "strings" "testing" "time" ) func TestParseResponse(t *testing.T) { t.Parallel() type Case struct { name string input string expect string expectErr string } cases := []Case{ {"response-empty", "", "", "response empty not valid"}, {"res...
1812ebcf9d95a8515b8f0accb76d8950fb950509
2c05a89650e598c482e9fa209ad377d014ad30ae
jpsriram/awless
/acceptance/aws/stack_test.go
Go
go
7,629
permissive
package awsat import ( "io/ioutil" "os" "path/filepath" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" ) func TestStack(t *testing.T) { _, tplFilePath, tplClean := generateTmpFile("tpl body content") defer tplClean() _, polFilePath, polClean := generateTmpFile(...
9da01bcd7c61b60db95786ff2157b1a89e9cf636
4c8ee2d8964e25d15f31b0c86184068f2d5e859c
shutterbug2000/nex-protocols-go
/matchmaking.go
Go
go
2,276
no_license
package nexproto import ( "fmt" nex "github.com/PretendoNetwork/nex-go" ) const ( // MatchMakingProtocolID is the protocol ID for the Match Making protocol MatchMakingProtocolID = 0x15 // MatchMakingMethodGetSessionURLs is the method ID for the method GetSessionURLs MatchMakingMethodGetSessionURLs = 0x29 ) /...
71626a1d4e1337daa4ff72caa97996ad90b51611
ca57b3f366e9cb9b084ff9fc899c244e048bcc69
ghophp/skipper
/cmd/skipper/defaultfilterflags_test.go
Go
go
2,130
permissive
package main import ( "testing" "gopkg.in/yaml.v2" "github.com/zalando/skipper/eskip" ) func Test_defaultFiltersFlags_String(t *testing.T) { tests := []struct { name string filters []*eskip.Filter want string }{ { name: "test string", filters: []*eskip.Filter{}, want: "<default fil...
8684a76b504087f6c6a25940422d90fac5f0d8bb
e340117b082dcadcf27b64e27153129ec746505d
Rorical/pointers
/pointers/pubsub/fetch.go
Go
go
2,748
no_license
package pubsub import ( "context" "fmt" "time" protos "pointers/pointers/protocol" "google.golang.org/protobuf/proto" "github.com/Rorical/go-msgio/protoio" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" ) type Fetcher struct { ct...
25c9ee68ad1966e0fd7fb423bd4edfc0c7c9e124
aec0e5e736192a37de5fafc144175b0ea4dafcdf
temporalio/temporal
/tools/cassandra/handler_test.go
Go
go
3,218
permissive
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 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 Soft...
7b47a025254ad0b1188a2ca9c4dd759428307af8
3a9f148a7607b15db95ce1ab9d6fc6a74c806fb6
ardeshir/unixtools
/fileman-v2.go
Go
go
2,145
permissive
package main import ( // "fmt" "flag" "os" "log" u "github.com/ardeshir/version" ) var ( debug bool = false version string = "0.0.0" ) func main() { filename := flag.String("file", defaultFile(), "Name of file to play with") flag.Parse() createFile(*filename) // deleteFile(...
03c917d73d6db998935b1a83f2d3fd5e595acdc5
c2b50ce63d6a09f1ffe6170ee93f8aeda83f0cb5
shuang1990/golang-sample
/concurrency/demo18.go
Go
go
351
no_license
package main import "fmt" func main() { c := make(chan int) done := make(chan bool) go func() { for i := 0; i < 100000; i++ { c <- i } close(c) }() go func() { for n := range c { fmt.Println("A: ", n) } done <- true }() go func() { for n := range c { fmt.Println("B: ", n) } done <...
00b36860cd047d6e6855e3ce977779d7cc42174e
23e72833b57ae3c6562ada35d9f36cad4cbd966c
cookingcodewithme/notary
/cmd/notary/main_test.go
Go
go
23,419
permissive
package main import ( "bytes" "crypto/tls" "fmt" "io/ioutil" "net/http/httptest" "os" "path/filepath" "strconv" "strings" "testing" "time" "github.com/docker/go-connections/tlsconfig" "github.com/docker/notary" "github.com/docker/notary/passphrase" "github.com/docker/notary/server/storage" "github.com...
46bed345a25b329a9286f9094cc6993c7d201359
c9cd8ee300d48d04b890f4f4b89a5e7ca78c8cd3
wdospinal/mymove
/cmd/prime-api-client/main.go
Go
go
16,626
permissive
package main import ( "os" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/transcom/mymove/cmd/prime-api-client/prime" "github.com/transcom/mymove/cmd/prime-api-client/support" "github.com/transcom/mymove/cmd/prime-api-client/utils" "github.com/transcom/mymove/pkg/cli" ) // initRootFlags initia...
dec4cd06eaf2ce772609254678dd7d0a0863f514
462d9ecf52f51c5709a867c5a38f139d4e3818b4
BitgesellOfficial/bgld
/integration/rpctest/memwallet.go
Go
go
17,760
permissive
// Copyright (c) 2016-2017 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package rpctest import ( "bytes" "encoding/binary" "fmt" "sync" "github.com/bitgesellofficial/bgld/blockchain" "github.com/bitgesellofficial/bgld/btcec" "github...
1e53222a8d252a7a51bfaaf0decab68865b904ed
99f3313d50c493a9c436ce368264989aa42eab8e
alphagov/paas-bosh-cli
/crypto/digest_calculator_test.go
Go
go
2,719
permissive
package crypto_test import ( "errors" "path/filepath" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/cloudfoundry/bosh-cli/crypto" boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" ) var _ = Describe("Sha1Calculator", func()...
e73b7cad7427ea058f6675f8c4d0ed2c8e1a56be
72b84c40144a639ceeef751c1f1f741a4825bae1
mattermost/mattermost-marketplace
/cmd/generator/bundles.go
Go
go
4,809
permissive
package main import ( "encoding/base64" "fmt" "io" "net/http" "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" "github.com/mattermost/mattermost-marketplace/internal/model" ) // OSX-specific bundle URLs are stored in the plugin store as `osx` rather than `darwin` const OsxAmd64 ...
7ddd75d28e869a840d49a8a88ad0c94fe03fddb1
f4d8558a71ed64e08b59ddb2fed9ff9acc4a6996
amccarthy1/go-sdk
/stats/constants.go
Go
go
1,474
permissive
package stats import "github.com/blend/go-sdk/logger" // MetricNames are names we use when sending data to the collectors. const ( MetricNameHTTPRequest string = string(logger.HTTPRequest) MetricNameHTTPRequestElapsed string = MetricNameHTTPRequest + ".elapsed" MetricNameDBQuery string = string(l...
aec2be77753a18ffbb7e559355e88d52128a4612
aca2a97eb6f1eca13200663afaffc12ec9a20aed
wuhan005/Scrooge
/internal/db/invoices.go
Go
go
4,706
permissive
// Copyright 2021 E99p1ant. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package db import ( "context" "strings" "github.com/pkg/errors" "github.com/satori/go.uuid" "gorm.io/gorm" ) var _ InvoiceStore = (*invoices)(nil) // Invoice...
c1fcc5015cd30889f4d6dcbec274093ce477ba5d
9e5325c5a67d6a8844d6bacfa5ea1be524d38c9c
snehalkalke5/Hydra
/handlers/postagentticketcommon.go
Go
go
3,010
permissive
package handlers import ( "bytes" "encoding/json" "github.com/Unotechsoftware/Hydra/utils" "github.com/Unotechsoftware/Hydra/lerna" "github.com/antigloss/go/logger" "net/http" ) type AgentTicketCommon_Request struct{ UserLogin string `json:"UserLogin,omitempty"` Password string `json:"Password,omitempty"` T...
d59e683b28110ebe2499c311513627b77c679aa6
91ae15e68eef5c5abdadac4309058f14f3e965bd
sudeepgoyal75/terraform-provider-nuagenetworks
/5.3.2/nuagenetworks/resource_nuagenetworks_containerinterface.go
Go
go
12,373
no_license
package nuagenetworks import ( "github.com/hashicorp/terraform/helper/schema" vspk "github.com/tpretz/vspk-go/vspk/5.3.2" ) func resourceContainerInterface() *schema.Resource { return &schema.Resource{ Create: resourceContainerInterfaceCreate, Read: resourceContainerInterfaceRead, ...
1a378243f87173a9c9c34652a0a402ff571b5403
7a693cea79bb866f572a999db5fedcd54dfa50fb
ulil-am/collections
/models/db/mongo/genappid/genappid.go
Go
go
1,570
no_license
package genappid import ( "collections/helper/constant/tablename" db "collections/models/db/mongo" dbStruct "collections/structs/db" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" ) // Genappid - Logic Struct DB type Genappid struct{} func init() { var d Genappid d.Index() } // Index - Create ...
be14cb3b1d329f36f7a36d27d7d144737ac9d93b
3d0deee8f4f4007ff244e38877bfd43d8d21026b
dparrish/openinstrument
/tools/add/add.go
Go
go
2,348
permissive
package main import ( "bufio" "flag" "log" "os" "regexp" "strconv" "time" "golang.org/x/net/context" "github.com/dparrish/openinstrument" "github.com/dparrish/openinstrument/client" oproto "github.com/dparrish/openinstrument/proto" "github.com/dparrish/openinstrument/variable" ) var ( connectAddress = ...
8ac5a777a85aa2c90127781fb5dc89806e54fe54
55c9a39174c770d6af95360be027a75e82a3b883
vadmeste/go-cv
/memory.go
Go
go
1,104
no_license
package gocv // #cgo pkg-config: simd // #include "stdlib.h" // #include "Simd/SimdLib.h" // #cgo LDFLAGS: -lstdc++ import "C" import "unsafe" // Allocate allocates an aligned memory block. // The memory allocated by this function is must be deleted by function Free // [in] size - a size of memory block. // [in] alig...
9bedb3ed1bd0a8b0bf051c269169ec2b7b69f599
bb5e8faa6f066eb7f4a85bcec6859510adef208e
openshift/node_exporter
/vendor/github.com/prometheus/procfs/xfs/parse.go
Go
go
13,694
permissive
// Copyright 2017 The Prometheus 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...
af4d786552b68f91b3813a9350421d9407a2b5e5
7b1cd77a8e1c0214b9958730bbeea940a6a36643
gitter-badger/expreduce
/expreduce/evalstate.go
Go
go
13,999
permissive
package expreduce import ( "bytes" "fmt" "log" "sort" "strings" "time" ) type DefMap map[string]Def type EvalState struct { // Embedded type for logging CASLogger defined DefMap trace *Expression NoInit bool timeCounter TimeCounterGroup freeze bool thrown *Expression } func (this...
5c59faf80427e390110450bcc8da915a9aa44948
46fb956978e1fe59b16ad7ab89a82d05f5d517c8
tinygo-org/tinygo
/src/machine/board_grandcentral-m4.go
Go
go
9,606
permissive
//go:build grandcentral_m4 package machine // Digital pins const ( // = Pin Alt. Function SERCOM PWM Timer Interrupt // ------ -------------------- -------- ----------- ----------- D0 = PB25 // UART1 RX 0[1] EXTI9 D1 = PB24 // UART1 TX 0[0] ...
c30b5424b6c5abfc026b8c89a5f9c8e9f6141738
4d49777f57334495895a5b25111eb4bbbc88e8ce
wolfplus2048/mcbeam-plus
/session/session.go
Go
go
16,385
no_license
// Copyright (c) nano Author and wolfplus. All Rights Reserved. // // 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, c...
36979d00f9c27299412b7951e5c5a982143912b6
a8f7b5a1d4bfb941f3d7639ecf29f1b61aef1327
ngaut/tidb
/br/pkg/restore/split/split.go
Go
go
7,461
permissive
// Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0. package split import ( "bytes" "context" "encoding/hex" "time" "github.com/pingcap/errors" "github.com/pingcap/failpoint" "github.com/pingcap/log" berrors "github.com/pingcap/tidb/br/pkg/errors" "github.com/pingcap/tidb/br/pkg/logutil" "github.com/...
b2f117daeafb542caea0fcf7a01c0a2803dbc485
db149328e6ea74cbc4fbf7433978f079c97d1880
sgammon/terraform-provider-segment
/vendor/github.com/hashicorp/terraform/terraform/node_resource_plan.go
Go
go
8,681
permissive
package terraform import ( "log" "github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/dag" "github.com/hashicorp/terraform/states" "github.com/hashicorp/terraform/tfdiags" ) // nodeExpandPlannableResource handles the first layer of resource // expansion. We need this extra layer so DynamicExp...
0253eaea92296d82b6f0f4a9a903a53d0827380c
309d2dd8cc4cb4e0a463883a63e6dfea8f9b4c4b
sermilrod/wailingbot
/lib/configuration/configuration.go
Go
go
772
no_license
package config import ( "github.com/caarlos0/env" ) // Configuration struct stores the configuration of the bot type Configuration struct { Port string `env:"WW_PORT" envDefault:"3001"` SlackToken string `env:"WW_SLACK_TOKEN"` PgUser string `env:"WW_PG_USER" envDefault:"postgres"` PgDbName string `en...
dd53bbfe0670a1afa724382253bf11f9a854d568
f3208441cde5a7746d83abc56eadef3e86417d70
vatelzh/daos
/src/control/security/grpc_authorization_test.go
Go
go
4,683
permissive
// // (C) Copyright 2019 Intel Corporation. // // 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 ...
2437ba7b50556c43d0ead6ab16e3b26c85e7c9c2
a624603f2d47cae43d96bdefeb850c73287022ed
u-root/u-root
/vendor/src.elv.sh/pkg/cli/app_spec.go
Go
go
2,019
permissive
package cli import ( "src.elv.sh/pkg/cli/tk" "src.elv.sh/pkg/ui" ) // AppSpec specifies the configuration and initial state for an App. type AppSpec struct { TTY TTY MaxHeight func() int RPromptPersistent func() bool BeforeReadline []func() AfterReadline []func(string) Highlighte...
ec0809dfc2a840702e53e68d64bad0b6e2e8b987
3359bee7df19ed23e9ebc665ee0840982d9ed92f
sagnik3012/freshers-bootcamp
/day4/Models/Order.go
Go
go
1,031
no_license
package Models import ( "errors" "fmt" "freshers-bootcamp/day4/Config" ) func PlaceOrder(ord *Order) (err error) { var product Product Config.DB.Model(&Product{}).Where("id = ?", ord.ProductId).First(&product) if ord.Quantity > product.Quantity { fmt.Println("cancelled!!!!") ord.Status = "order cancelled!!"...
9d7dc7f74721233a62f708ef5c985dff319631a6
ea83b13bb570eedd7e6c4ee769ca7a22f8396582
Web3verse/bcdhub
/internal/contractparser/meta/entrypoints.go
Go
go
7,050
permissive
package meta import ( "fmt" "github.com/baking-bad/bcdhub/internal/contractparser/consts" "github.com/baking-bad/bcdhub/internal/contractparser/formatter" "github.com/baking-bad/bcdhub/internal/helpers" "github.com/pkg/errors" "github.com/tidwall/gjson" ) // Entrypoint - type Entrypoint struct { Name st...
946abad735eeeec7dec5722baaf3d574483d9ae4
3bd5512509b01b8fb508622f278d504c9b8fd4cc
sp0n-7/redis
/internal/pool/pool_test.go
Go
go
8,730
permissive
package pool_test import ( "sync" "testing" "time" "github.com/sp0n-7/redis/internal/pool" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("ConnPool", func() { var connPool *pool.ConnPool BeforeEach(func() { connPool = pool.NewConnPool(&pool.Options{ Dialer: dummyD...
767015835ed26c3f1d5dcd320ef333f60707fd25
18467a27ba6147f9599b7947371f58113d0a42e8
BCSM/coniks-go
/merkletree/pad_test.go
Go
go
10,353
no_license
package merkletree import ( "bytes" "testing" "crypto/rand" "errors" "fmt" "io" "github.com/coniks-sys/coniks-go/crypto/sign" ) var signKey sign.PrivateKey func init() { var err error signKey, err = sign.GenerateKey(nil) if err != nil { panic(err) } } type TestAd struct { data string } func (t Test...
2694b5933d906d7b224b58f42d9d438ea4e875ff
5f64fbbdfc7fe2569fb740bf27427cd8e1dfaf47
stardog-union/stardog-graviton
/vendor/github.com/hashicorp/terraform/vendor/gopkg.in/zorkian/go-datadog-api.v2/dashboards.go
Go
go
6,473
permissive
/* * Datadog API for Go * * Please see the included LICENSE file for licensing information. * * Copyright 2013 by authors and contributors. */ package datadog import ( "encoding/json" "fmt" ) // GraphDefinitionRequestStyle represents the graph style attributes type GraphDefinitionRequestStyle struct { Palet...
3f688ef748cd856464c510d4dcfa8578ba7edd39
6dd7a69c6eda321b349b36d69147962c1f80b5c7
chengc017/vitess
/go/cmd/vtworker/split_diff.go
Go
go
5,072
permissive
// Copyright 2013, Google Inc. 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 ( "flag" "fmt" "net/http" "strings" "sync" "github.com/youtube/vitess/go/vt/concurrency" "github.com/youtube/vitess/go/vt/servenv" "g...
cb43cf57d8f242a53700926c25bc9923cbfd5ade
f4ca8be8ae1ffda180bce802c28ed5051c83e2b0
ivansukach/protobuf
/proto/properties.go
Go
go
17,437
permissive
// Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/ivansukach/protobuf // // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // /...
ac6edb16af9734cf38e65a2b504d1d110c665891
870f492a4e022fd3bf7da89a55bdcfbcd22012f6
123252520/fabric-sdk-server
/docs/my_chaincode.go
Go
go
8,638
no_license
package main /* smart contract for myqkl */ import ( "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer" "time" log "github.com/hyperledger/fabric/common/flogging" "encoding/json" ) type Mycc struct { } type Pair struct { Key string `json:"key,omitempty"` ...
1a4820080a51e98b002b8c6ef650d58bc44cbd82
b45e2db34bd4df47fb1ee147a25ec29b3e1519b3
xsilmarx/temporal
/client/admin/metricClient.go
Go
go
12,303
permissive
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 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 Soft...
de5c87b71ef1f305848b03d59e814eeda97df2d6
9b4a7f7f0ada88feabbc18f6cd2947b7857195f6
childe/gohangout
/field_setter/mfields_field_setter.go
Go
go
903
permissive
package field_setter import "reflect" type MultiLevelFieldSetter struct { preFields []string lastField string } func NewMultiLevelFieldSetter(fields []string) *MultiLevelFieldSetter { fieldsLength := len(fields) preFields := make([]string, fieldsLength-1) for i := range preFields { preFields[i] = fields[i] }...
2dae924da87b27927f156f099bf1c972a1cd230d
958ca43f95a74d9e420c6aae172ac137ac76012b
dictav/go-lha
/header_reader.go
Go
go
5,014
permissive
package lha import ( "log" "os" "time" ) type headerReader func(r *Reader) (*Header, error) var headerReaders = map[byte]headerReader{ 0: readHeaderLv0, 1: readHeaderLv1, 2: readHeaderLv2, 3: readHeaderLv3, } func readHeaderLv0(r *Reader) (*Header, error) { if r.err != nil { return nil, r.err } h := new...
c0ed455e56f85cb02f392005ef4a9b09bd06e29f
b830e4e01b7f93c400d9637f428267d54f29e484
agarg2008/tools
/cmd/cue-gen/genoapi.go
Go
go
20,855
permissive
// Copyright 2019 Istio 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 i...
a2e87054743e1a0e9ede46628aa35bdaed8686a6
83543af9a3d99e92d3c42ffaff87c0f49ac6d17b
ammogcoder/dcrd
/dcrutil/tx.go
Go
go
6,111
permissive
// Copyright (c) 2013-2016 The btcsuite developers // Copyright (c) 2015-2017 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package dcrutil import ( "bytes" "fmt" "io" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/w...
5031d62f3756fe402be17ef26e34fe65eaa78022
958bc1f0f76c19af02663e6309144da194205aa2
victron/exleacar
/paginator/cookies.go
Go
go
454
no_license
package paginator // import "net/http" // func GenCookies(authC []*http.Cookie) ([]*http.Cookie, error) { // addCookies := []*http.Cookie{ // &http.Cookie{Name: "user_allow_cookies", Value: "1"}, // &http.Cookie{Name: "lang", Value: "en"}, // // &http.Cookie{Name: "exlc_cookie", Value: "3i83b2s9v3kdr03p7mpjv3u...
571246bfd46bb658bd21f1f36a9cdcfa12c3dfdb
6c4d6b1eb2f1e65b6e8c5c39f03ed95154b67053
xuanlongvts/golang
/gin-gonic/10_custom_log_file/main.go
Go
go
705
no_license
package main import ( "fmt" "github.com/gin-gonic/gin" "time" ) func main() { router := gin.New() // LoggerWithFormatter middleware will write the logs to gin.DefaultWriter // By default gin.DefaultWriter = os.Stdout router.Use(gin.LoggerWithFormatter(func(param gin.LogFormatterParams) string { return fmt....
cdf22f557988c82a18c406afc7642525a249e991
ee7c02f7de07f0f52ce833d30d1fccb74d07072d
maheshkalappattil/osm
/pkg/certificate/providers/tresor/types.go
Go
go
1,594
permissive
package tresor import ( "math/big" "sync" "time" "github.com/openservicemesh/osm/pkg/announcements" "github.com/openservicemesh/osm/pkg/certificate" "github.com/openservicemesh/osm/pkg/certificate/pem" "github.com/openservicemesh/osm/pkg/configurator" "github.com/openservicemesh/osm/pkg/logger" ) const ( //...
c5b3cfa9d707feca726a19f7e7015a23c0569884
bbea532f19d841e535b05498451f2dd4dae42cdf
mvpzhangkai/kubernetes
/pkg/apis/core/types.go
Go
go
188,413
permissive
/* Copyright 2014 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, ...
575d2a70737bad79656f6f09e93b114f5e051c53
5364ed57ce5a8c14f8154f29b53fab76481e6bee
welfare-sign/api
/internal/dao/help_checkin_message.go
Go
go
804
no_license
package dao import ( "context" "welfare-sign/internal/global" "welfare-sign/internal/model" ) // FindHelpCheckinMesage 查找补签消息 func (d *dao) FindHelpCheckinMesage(ctx context.Context, query interface{}, args ...interface{}) (*model.HelpCheckinMessage, error) { var helpCheckinMessage model.HelpCheckinMessage err ...
936c81b75517f09e31edeeb68072d80ee4054437
2b43bbbf677dcd0549ff40ba3415ad05e5b0a45d
Orpalis/passportpdfsdk-go
/model_signature_mode.go
Go
go
426
no_license
/* * PassportPDF API * * Another brick in the cloud * * API version: 1.0.1 * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ package openapi // SignatureMode Specifies the security handler of a signature. type SignatureMode string // List of SignatureMode const ( ADOBE_PPKMS SignatureMode ...
45ad731c58c7c0ebcd4c1cbd672d684cb87a1515
81248edef5177c885e120d3f3aabd2f22965e4e8
bfloch/tink
/go/aead/aead_factory_test.go
Go
go
5,577
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...
f3009518ca91673a5ba0bc78ddd31d2d3d9f42c3
6c5bac99e44542a27245294e4e4ce029b1d0d61e
maksmas/gorepogen
/internal/generator/repository_generator.go
Go
go
2,470
permissive
package generator import ( "fmt" "os" "path/filepath" "strings" rc "github.com/v0xpopuli/gorepogen/internal/repocomp" j "github.com/dave/jennifer/jen" ) // CreateNamesRegistry build full list of needed names // needed for auto generation func CreateNamesRegistry(entityInfo *entityInfo) NamesRegistry { entity...
0adc2dbe6cea6c76867d5ad4a8d0cc336db7cdfb
45829b607bcaa5d4bb2d0469a4b9882ac5c3b6e9
djekels-zz/etcd-ca
/depot/pkix.go
Go
go
5,857
permissive
package depot import ( "strings" "github.com/coreos/etcd-ca/pkix" ) const ( authPrefix = "ca" hostPadding = ".host" crtSuffix = ".crt" crtInfoSuffix = ".crt.info" csrSuffix = ".csr" pubKeySuffix = ".pub.key" privKeySuffix = ".priv.key" ) const ( rootPerm = 0400 branchPerm = 0440 leafPerm ...