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
d4c024ee843e20293d32e46e6a8c92c19e02d74a
ddc0322fe3fcf3fc02b7341a64bcaca168737355
honst/bee-gorm-graphql
/controllers/main.go
Go
go
252
permissive
package controllers import ( "github.com/astaxie/beego" ) type MainController struct { beego.Controller } func (c *MainController) Prepare() { c.Layout = "layout/application.tpl" } func (c *MainController) Home() { c.TplName = "main/home.tpl" }
a50fc155dc0c599b4489cf195aff35a2aeea7041
37501cbeee5102c868e1e0e7ac8796976eb693e8
jingyu323/gostudy
/test/test_net_pro/test_net_demo.go
Go
go
866
no_license
package main import ( "bytes" "fmt" _ "io/ioutil" "math/rand" _ "net/http" "sync" "time" ) const Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" func main() { var wg sync.WaitGroup wg.Add(2) go func() { defer wg.Done() for { doHTTPRequest(fmt.Sprintf("http://localhost:8080/fib/%d", ...
6e9ea6c3af68a944f594df500c9b962ba627eeef
90c8dffb7363dc304d1b3c7ddf34824548d9a240
ONSdigital/dp-observation-api
/service/initialise.go
Go
go
3,313
permissive
package service import ( "context" "net/http" "time" "github.com/ONSdigital/dp-api-clients-go/v2/cantabular" "github.com/ONSdigital/dp-graph/v2/graph" "github.com/ONSdigital/dp-healthcheck/healthcheck" dpHTTP "github.com/ONSdigital/dp-net/http" "github.com/ONSdigital/dp-observation-api/api" "github.com/ONSdi...
d8a862aa61ad1c6510fead11e32fc69aeb918edb
283f2851ef0bb1679833d96ddcfaee5f03d2e9a8
liveactionsteve/jack
/JackC/parser/output.go
Go
go
7,539
no_license
package parser import ( "bytes" "fmt" "html" "io" "jack/JackC/symbols" ) var writer io.WriteCloser var spacesToIndent int = 0 func indent() { var buf bytes.Buffer for i := 0; i < spacesToIndent; i++ { buf.WriteString(" ") } writer.Write(buf.Bytes()) } func write(format string, a ...interface{}) { outStr...
1bba60f6bc291ea4d74009afe26b373421373784
08ef5a0b86728bc3646228ac86fea2cca131d4f0
zenreach/go-swagger
/strfmt/default.go
Go
go
20,224
permissive
// Copyright 2015 go-swagger maintainers // // 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...
eb6133ce8a0c45551bb388c0b6b652f466279c84
9076271af3906b206a306368d829829c0bc836df
chain-gang/fabric-chaincode-evm
/fab3/netservice_test.go
Go
go
564
permissive
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package fab3_test import ( "net/http" "github.com/hyperledger/fabric-chaincode-evm/fab3" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("NetService", func() { Describe("Version", func() { It("returns...
f09bdd1dfef86ccfb1e04211726ca38d6007003e
b438901d3bdbfab36217ce2bcbcd6667d8853a54
neilgierman/domain-checker
/cmd/domain-checker/main_test.go
Go
go
4,810
no_license
package main import ( "context" "encoding/json" "log" "net/http" "net/http/httptest" "os" "testing" "time" "go.mongodb.org/mongo-driver/bson" ) var a App func TestMain(m *testing.M) { a.loadConfig() err := a.Initialize(a.appCfg.Database.Host,a.appCfg.Database.Port,a.appCfg.Database.Database + "-test") i...
3f86bdfcf54c8aa12840c2b4359ed71bce9da5b2
d73bb52df780487517ae483b7e815a10ef2cf024
marcgurney/stitch-cli
/commands/cloud_test.go
Go
go
3,820
permissive
package commands import ( "fmt" "os/exec" "strings" "testing" "github.com/10gen/stitch-cli/api/mdbcloud" u "github.com/10gen/stitch-cli/utils/test" gc "github.com/smartystreets/goconvey/convey" ) func TestCloudCommands(t *testing.T) { u.SkipUnlessMongoDBCloudRunning(t) cloudEnv := u.ENV() // test login l...
46eebc29504110ff3f31d09c3a63943d97f0aba1
c4a0feca9e08d696b569dcdc8a5a7f0ecdaa2581
allada/gdd
/protocol/animation/sharedTypes.go
Go
go
2,526
permissive
package animation import ( "github.com/allada/gdd/protocol/dom" ) type AnimationTypeEnum string const ( AnimationTypeCSSTransition AnimationTypeEnum = "CSSTransition" AnimationTypeCSSAnimation AnimationTypeEnum = "CSSAnimation" AnimationTypeWebAnimation AnimationTypeEnum = "WebAnimation" ) type Animat...
5755e022140114b953d0dfbf4620618c3eac661e
748709d031ac7b24ddb9a7d80173e408760a6160
digitalbitbox/bitbox-base
/tools/bbbfancontrol/bbbfancontrol.go
Go
go
4,330
permissive
// Copyright 2019 Shift Cryptosecurity AG, Switzerland. // // 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 appl...
a9fc8ad17f24fff389f198c884a6504c2ec28453
4e24cac9eec1943227202859222a9909e1ff9fc3
wbean1/go-eulerproj
/p011.go
Go
go
2,060
no_license
// https://projecteuler.net/problem=11 // notes: // not terribly elegant, but solves the problem // completed in <1hr package main import ( "bufio" "encoding/csv" "fmt" "log" "os" "strconv" ) func main() { matrixStr := parseFile() // lets use integers instead of strings... m := make([][]int, 20) for y...
4bc8fdd7a238ef78e029115ad397ab897e591856
ad98b00ea100920b4496b8c6122e276ce8df5c74
u2takey/pouch
/daemon/containerio/options.go
Go
go
2,990
permissive
package containerio import ( "bytes" "net/http" "os" "github.com/alibaba/pouch/cri/stream/remotecommand" ) // Option is used to pass some data into ContainerIO. type Option struct { id string rootDir string stdin bool backends map[string]struct{} hijack http.Hijacker hi...
4d966b26833b83a20767a2734fcdaa6d20e17909
4fc0bc1834ea9fb51d08d976ee96ed9649f5b013
C8E/rest-layer
/rest/request_test.go
Go
go
1,181
permissive
package rest import ( "bytes" "io/ioutil" "net/http" "testing" "github.com/stretchr/testify/assert" ) func TestRequestDecodePayload(t *testing.T) { r := request{ req: &http.Request{ Body: ioutil.NopCloser(bytes.NewBufferString("{\"foo\":\"bar\"}")), }, } var p map[string]interface{} err := r.decodePa...
d36af7183775540f1fcf1422fdd555f2e7697f82
ea3be58907787b388785f7a0d6547822904ed4a7
themihai/form
/decoder.go
Go
go
14,808
permissive
package form import ( "fmt" "log" "net/url" "reflect" "strconv" "time" ) const ( errArraySize = "Array size of '%d' is larger than the maximum currently set on the decoder of '%d'. To increase this limit please see, SetMaxArraySize(size uint)" errMissingStartBracket = "Invalid formatting for key '%s...
e476781896cf37ee7c2d6122b1d8879b04e19e9b
9bc7346d7fd14c723269d13b0141025a4070dad6
stefan06ro/awscnfm
/cmd/action/update/cluster/version/flag.go
Go
go
830
permissive
package version import ( "github.com/giantswarm/microerror" "github.com/spf13/cobra" "github.com/giantswarm/awscnfm/v15/pkg/env" ) type flag struct { TenantCluster string ReleaseVersion string } func (f *flag) Init(cmd *cobra.Command) { cmd.Flags().StringVarP(&f.TenantCluster, "tenant-cluster", "c", env.Tena...
7daeddf2b8cd18694c88b39aef0da6bfa0feee3f
adf71f2a176261967e4befdbe4a5366c414cb1e8
muhammadmuhlas/g3nd
/other_sprite_anim.go
Go
go
2,580
permissive
package main import ( "github.com/g3n/engine/graphic" "github.com/g3n/engine/material" "github.com/g3n/engine/math32" "github.com/g3n/engine/texture" "time" ) type SpriteAnim struct { anims []*texture.Animator } func init() { TestMap["other.sprite_anim"] = &SpriteAnim{} } func (t *SpriteAnim) Initialize(ctx ...
74e90cbb597fd2a490a1b0454836f366c30d5cee
35fb4c148199d4e07672935baa1aa375a2f07578
jayco/buildkite-auth
/client_test.go
Go
go
4,377
permissive
package auth import ( "context" "encoding/json" "net/http" "net/http/httptest" "reflect" "testing" "golang.org/x/oauth2" ) type expected struct { ValidToken TokenResponse InvalidToken TokenResponse } func apiMock() (*httptest.Server, *expected) { validToken := TokenResponse{ UUID: "12345678-1qas-1wer-...
d90ca9cbed6fd18d95b09216b13cebd4840a54d1
0867e606e00678aa3e8cb2abd5230c350a50f752
svangordon/pulumi-kubernetes
/provider/pkg/provider/invoke_helm_template.go
Go
go
6,960
permissive
// Copyright 2016-2020, Pulumi 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...
12f7a3936ae36d9fdd0cb5b0fce8cd117571cb0e
6a13e26047bd0060ce085b3c849bcdbf9bcb4e6b
vdemeester/yak
/cmd/yak/minikube/main.go
Go
go
376
permissive
package minikube import "github.com/spf13/cobra" func Cmd() *cobra.Command { cmd := &cobra.Command{ Use: "minikube", Aliases: []string{"mk", "m"}, Short: "Manage minikube instance(s)", RunE: func(cmd *cobra.Command, args []string) error { return nil }, } cmd.AddCommand(stopCmd()) cmd.AddCommand...
2dcb189ca148b6856cc0ed91873d1df21faefeff
9b39b618756770d1c14795750d9f66cc734787e4
dadrian/downgrade-check
/ztools/x509/json.go
Go
go
5,299
permissive
package x509 import ( "crypto/dsa" "crypto/ecdsa" "crypto/rsa" "encoding/json" "fmt" "time" "github.com/dadrian/downgrade-check/ztools/x509/pkix" ) func (k KeyUsage) MarshalJSON() ([]byte, error) { enc := make(map[string]interface{}) enc["value"] = int(k) if k&KeyUsageDigitalSignature > 0 { enc["digital_...
c1ec9f7095ec4c7ce8100c727e277bf36cf5f065
fd9eed92ef30b4c18e412626d69a653c82a25130
zhangchuhu/goframework
/src/bilin/searchserver/handler/SearchServantObj.go
Go
go
16,620
no_license
package handler import ( bc "bilin/bcserver/domain/service" "bilin/clientcenter" "bilin/protocol" "bilin/protocol/userinfocenter" "bilin/searchserver/config" e "bilin/searchserver/entity" u "bilin/searchserver/updater" "context" "encoding/json" "io/ioutil" "net" "net/http" "strconv" "strings" "time" l...
592f60385a1ef720f005b2c4a17c78450bfe557d
354cc952af3434d2e13c7233517d154087becc7a
GoogleCloudPlatform/k8s-config-connector
/pkg/cli/cmd/apply/yamlresource/yaml_to_unstructured_resource_test.go
Go
go
2,341
permissive
// Copyright 2022 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 ...
78dfac63e27b0087f8a04f7dee1c1a8b1d28348a
9d0bfcd5626a1e91ea5d1832311ae9fa9f29a8b1
BizShuk/code_algo
/ds/operations/powOfN_test.go
Go
go
2,118
permissive
package op import ( "fmt" "testing" ) func TestPowOfTwo(t *testing.T) { cases := 0 a := PowOfTwo(cases) fmt.Println("case:", cases, "result:", a) cases = 1 a = PowOfTwo(cases) fmt.Println("case:", cases, "result:", a) cases = 2 a = PowOfTwo(cases) fmt.Println("case:", cases, "result:", a) cases = 10 a = ...
b2c1b7dcc872bc5b183fa1c11b00aae2600d18fc
2202205cbb451ae7d783cd1454d468a5d1b04003
jia-jerry/gardener
/pkg/registry/core/backupbucket/strategy.go
Go
go
6,361
permissive
// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lice...
636e215340d81ba86b1f273c070e80359a270442
18b35563141b5dda220255be34ec80630ed7ddaa
rubycut/dataplaneapi
/handlers/stick_table.go
Go
go
5,030
permissive
// Copyright 2019 HAProxy Technologies // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
aa1da610d46bb6d72ad60b0188aad8f05e6945ac
dcd684d645916822619a5762a6ba6815daba88c7
sarvex/docker
/builder/parser/parser_test.go
Go
go
1,576
permissive
package parser import ( "fmt" "io/ioutil" "os" "path/filepath" "testing" ) const testDir = "testfiles" const negativeTestDir = "testfiles-negative" func getDirs(t *testing.T, dir string) []string { f, err := os.Open(dir) if err != nil { t.Fatal(err) } defer f.Close() dirs, err := f.Readdirnames(0) if ...
4729a5ab0636495e10a52b2bf651a2996b837f56
9e35796b7ecd434343bef1ee1f2490815deafdbf
kulla/go-ipfs
/core/commands/dht.go
Go
go
18,902
permissive
package commands import ( "bytes" "errors" "fmt" "io" "time" cmds "github.com/ipfs/go-ipfs/commands" dag "github.com/ipfs/go-ipfs/merkledag" notif "github.com/ipfs/go-ipfs/notifications" path "github.com/ipfs/go-ipfs/path" routing "github.com/ipfs/go-ipfs/routing" ipdht "github.com/ipfs/go-ipfs/routing/dht...
244f3fe151dfeddedfaf3461b64397eea08eb8f2
ad425a9c987493f4507c57b219b5bd24ae8dc7e7
Ablegang/goweb
/app/cron/jobs/notice_daily_income_notice.go
Go
go
1,600
no_license
package jobs import ( "fmt" "github.com/chenhg5/collection" "github.com/sirupsen/logrus" show2 "goweb/app/handlers/show" "goweb/app/models" "goweb/app/models/show" "goweb/pkg/dingrobot" "goweb/pkg/quotes" ) type QuoteDailyIncomeNotice struct { } func (job *QuoteDailyIncomeNotice) GetName() string { return "...
4dd979b0d16203b80d4026e3dab1e670fc172038
738ca92b7ee583d2828cbf61b2d49b362a2ce314
peter-c-larsson/istio
/tests/integration/security/rbac/v2/group/group_test.go
Go
go
5,434
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...
20efc464ffe2a988b67b61ad8b6c71a50d73d41d
5c3a94f7262c7614ccb0bdfd60b6ecc34453e177
ShowPenZ/GoArea
/pkg/mod/github.com/godoctor/godoctor@v0.0.0-20181123222458-69df17f3a6f6/analysis/dataflow/live.go
Go
go
5,070
permissive
// Copyright 2015-2018 Auburn University and others. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package dataflow import ( "go/ast" "go/types" "github.com/godoctor/godoctor/analysis/cfg" "github.com/willf/bitset" "golang.org/x/tool...
3c153fff34c0a57c4fede9e5d898b6d9a9a76081
cb52186a8e1ff7b871938d5de7a4bb56d4417a42
jim-y-bti/seamless-op
/models/initSetting.go
Go
go
776
no_license
package models import ( "database/sql" "fmt" "github.com/gin-gonic/gin" _ "github.com/lib/pq" ) const ( host = "arjuna.db.elephantsql.com" port = 5432 user = "ydhobhyt" password = "FckQIjb9THM3s8rLbxhzNhAyV765Yj2-" dbname = "ydhobhyt" ) var ( DB *sql.DB ) func ConnectToDB() gin.HandlerFunc ...
02442c915727e9bd2e0a4b8394128e92d8154dc0
08059a593fe0f5d0f72fd5f3ab9fbb9ac9574938
Zstro/yig
/test/go/specialcharacter_test.go
Go
go
1,486
permissive
package _go import ( . "github.com/journeymidnight/yig/test/go/lib" "net/http" "testing" ) func Test_SpecialCharaterObject(t *testing.T) { sc := NewS3() err := sc.MakeBucket(TEST_BUCKET) if err != nil { t.Fatal("MakeBucket err:", err) panic(err) } err = sc.PutObject(TEST_BUCKET, TEST_KEY_SPECIAL, TEST_VAL...
c5b8f5d6390d31cc12367edc3e82a226955efd25
c23f7828e10c1d31885f1758a82a5e8248ac8c5e
maxadd/import-ldap
/src/ldap.go
Go
go
1,921
no_license
package main import ( "crypto/tls" "fmt" "os" "strconv" "strings" ldap "gopkg.in/ldap.v3" ) type ldapOps struct { conn *ldap.Conn } func (p *ldapOps) getLdapTLSConn() { tlsConfig := &tls.Config{InsecureSkipVerify: ldapConf.TLS.InsecureSkipVerify} address := ldapConf.IP + ":" + strconv.Itoa(ldapConf.Port) ...
9117993a43ff7041163e051100dd955b1ea46efe
2d7f5f78ee1d2e285ac19752f142c20f288bd13d
jeffh/nbt
/parser.go
Go
go
8,067
no_license
package nbt import ( "encoding/binary" "fmt" "io" "reflect" "unicode/utf8" ) func createTag(t TagType, v interface{}, name string) Tag { return Tag{ Name: name, Type: t, Value: v, } } ////////////////////////////////////////////////////////////////// type reader struct { reader io.Reader byteOrd...
4fbe7ddb8d95d64fb06bfc8574c8c0b2f8985755
db8831535a8e8d6b5d5da629ecce6f5162adf5e5
acornies/faas-nomad-x
/vendor/github.com/hashicorp/vault/sdk/logical/logical.go
Go
go
5,084
permissive
package logical import ( "context" log "github.com/hashicorp/go-hclog" ) // BackendType is the type of backend that is being implemented type BackendType uint32 // The these are the types of backends that can be derived from // logical.Backend const ( TypeUnknown BackendType = 0 // This is also the zero-value...
b486582aabc96fdd04533cc01d1cddb385d6d688
8c26860bfa2a5f900dbcc9cbb4b7c490a2789ea6
ai0by/UnitApiTest
/module/login.go
Go
go
1,434
no_license
package module import ( "GoTest/common" "encoding/json" _ "errors" "fmt" "github.com/jinzhu/gorm" "strings" ) func LoginTest(requestUrl string,db *gorm.DB) []common.LoginReturnData { var login = []common.Login{} apiAddress := "/api/Token/login" // 设置 api接口的地址 result := common.ReadJson("./json/lo...
0a11518e59603e157314ad24c5f1fc9336854730
39bd828eeb1029def73db3c2080664e09e90cecd
MisinformedDNA/pulumi-azure-nextgen
/sdk/go/azure/storage/v20190401/blobContainer.go
Go
go
10,401
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 v20190401 import ( "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) // Properties of the blob container, including Id, ...
f27eeba5aea4dcf8aece94b9f2e4ac8a07800e87
7aa5fe0da5dd0d20ba0a3034d5f2650b2fb0ea7e
soteria-dag/soterd
/config_test.go
Go
go
1,967
permissive
// Copyright (c) 2013-2017 The btcsuite developers // Copyright (c) 2018-2019 The Soteria DAG developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package main import ( "io/ioutil" "os" "path/filepath" "regexp" "runtime" "testing" ) var ( rpcuserRegexp ...
5261b0739614f2ac2627c1c6edf10c83b121b5fe
f61c5c7796fd1804287a741bdbb0e5ec119e4a0e
Mattlk13/oci-go-sdk
/datasafe/get_security_assessment_comparison_request_response.go
Go
go
3,415
permissive
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
2bca3c04adc051036f9eadef13dfd3c786ca9c23
ea21ff95471d2dd04e5d345c804f917455798f1b
PaaS-TA/Monitoring
/releases/paasta-garden-runc-3.0/src/github.com/cloudfoundry/dropsonde/metrics/metrics_test.go
Go
go
4,101
permissive
package metrics_test import ( "time" "github.com/cloudfoundry/dropsonde/metric_sender/fake" "github.com/cloudfoundry/dropsonde/metricbatcher" "github.com/cloudfoundry/dropsonde/metrics" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Metrics", func() { var fakeMetricSender *fake.Fake...
db949061438b07d51717371a23af90d417ca6237
89fc25adc9532b9863a0c479a260297f72f89661
75912001/goz
/login/main.go
Go
go
7,987
no_license
package main import ( "bytes" "encoding/binary" "fmt" "github.com/golang/protobuf/proto" "math/rand" "runtime" "strconv" "time" "github.com/75912001/goz/zhttp" "github.com/75912001/goz/ztcp" "github.com/75912001/goz/zudp" "github.com/75912001/goz/zutility" ) var gLog *zutility.Log var gServer *ztcp.Se...
8b087e12441449da04f5b36809c3b95f279e639a
8502925e26910398f38bf0932b98e4d3ceac0660
libbox/go-graph
/repo/feed_item.go
Go
go
380
no_license
package repo import ( "context" "graph/ent" ) type FeedItem struct { Db *ent.Client } func NewFeedItemRepo(client *ent.Client) *FeedItem { return &FeedItem{ Db: client, } } func (f *FeedItem) Create(owner *ent.User, content string) (err error) { _, err = f.Db.FeedItem.Create(). SetUserOwner(owner). SetC...
354132558277d8af769535341b647debf8540f6f
29d24d00dcda31aaa4eead6c769ab82fc4868983
vmware/alb-sdk
/go/models/hdr_match.go
Go
go
1,270
permissive
// Copyright 2021 VMware, Inc. // SPDX-License-Identifier: Apache License 2.0 package models // This file is auto-generated. // HdrMatch hdr match // swagger:model HdrMatch type HdrMatch struct { // Name of the HTTP header whose value is to be matched. Allowed in Enterprise edition with any value, Essentials, Basic...
64471ea51777263b4b0c8ce6e930a2ba7756dd87
1ce651777629f41a8858bee7028e622248c3350e
rooklift/dubnium
/misc/halite3_extreme_seeds.go
Go
go
3,727
no_license
package main // This program is irrelevant for Dubnium itself, but uses // Dubnium's mapgen to find extreme seeds. import ( "bufio" "encoding/json" "fmt" "io/ioutil" "os" "sort" "time" "../sim" ) type Result struct { Key string Seed uint32 Size int Players int Score int } func (self Result) Stri...
e7db0b39178a5620241ccd1921061c0c9a5152e8
6691ef3d63cb5914f4c2168488cdf866cbe60779
solaegis/cig
/Godeps/_workspace/src/github.com/mitchellh/go-homedir/homedir.go
Go
go
2,202
permissive
package homedir import ( "bytes" "errors" "os" "os/exec" "path/filepath" "runtime" "strings" ) // Dir returns the home directory for the executing user. // // This uses an OS-specific method for discovering the home directory. // An error is returned if a home d...
631d755f8e91cf3beab99438ede38c118bef89a4
bc61556c2bf211a3915520d68463eaa74f114329
roshanirathi/libcalico-go
/lib/validator/v3/validator.go
Go
go
42,944
permissive
// Copyright (c) 2016-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
d30e1b74a4090abd25c00d32597fe87d38b65b59
3afca163001fcb66cf3bad6c85a456121dce6c2a
kubernetes/kubernetes
/staging/src/k8s.io/cloud-provider/controllers/service/config/types.go
Go
go
931
permissive
/* Copyright 2019 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, ...
798e1b9790a717cc476fedd60ae0d7b9b0ce7c19
03b9ffb9e87b68d1e998fe08b7c91c2269c038de
openharmony/third_party_flutter
/skia/third_party/externals/wuffs/lib/rac/rac.go
Go
go
2,014
permissive
// Copyright 2019 The Wuffs 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
e8231a91905acaf0d1490ba04c0566ad4201e37b
c24d48de56065ea4b34e03c8d6097d7174b1848b
sudhakar-mnsr/netauto2
/newmarch/tlsunsafeclient.go
Go
go
1,996
no_license
/* TLSUnsafeClientGet Go presently bails out when it encounters certificate errors However we are configuring to ignore certificate errors Transport configuration flag InsecureSkipVerify is set (NOT A GOOD PRACTISE) With self-signed certificates go will generate error of below x509: certificate signed...
f6abd71ad2207cc751708d5923e4ed3ff64e1aed
6f91dacdc83d4081b86dadd0262489fdacc2d9dc
liyuan462/bsvd
/rpcserverhelp.go
Go
go
49,588
permissive
// Copyright (c) 2015-2017 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 main import ( "errors" "sort" "strings" "sync" "github.com/bitcoinsv/bsvd/btcjson" ) // helpDescsEnUS de...
cb03198b8d55163c0a620961f6ffd494cbf685a4
2fa90590d6a26eb3bf15cee367f08cf2c845385f
tsalright/adoscanner_go
/ado/scanProjects.go
Go
go
4,798
no_license
package ado import ( "bufio" "fmt" "github.com/microsoft/azure-devops-go-api/azuredevops/core" "github.com/microsoft/azure-devops-go-api/azuredevops/git" "io" "regexp" "strings" "sync" ) // ScanProjects uses the Service interface to interact with Azure DevOps and does all the heavy lifting to find data type S...
c44c38e8ccdd632a4210e2b6ef8901b58a323436
0d48a408ea796bff69365ea72da38515024071cc
aceeric/nbodygo
/internal/g3n/experimental/physics/solver/solver.go
Go
go
1,611
permissive
// Copyright 2016 The G3N 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 physics implements a basic physics engine. package solver import ( "nbodygo/internal/g3n/experimental/physics/equation" "nbodygo/internal/g3n/mat...
5c6ac02363a49bda2f7ba7bb926707e639709b10
68b2dcacafb7bfaf75fdd807a41c7fdaacf22da1
TuftsBCB/tools
/util/resources.go
Go
go
9,036
permissive
package util import ( "compress/gzip" "encoding/gob" "fmt" "io" "os" path "path/filepath" "strconv" "strings" "github.com/TuftsBCB/fragbag" "github.com/TuftsBCB/fragbag/bow" "github.com/TuftsBCB/fragbag/bowdb" "github.com/TuftsBCB/hhfrag" "github.com/TuftsBCB/io/msa" "github.com/TuftsBCB/io/pdb" "githu...
29aa52dc82eb5722fddc0fc7af30540798f7f9cd
b0dfa76b268065472963e299ba2a96475069763e
bancek/youtube-to-koofr
/vendor/github.com/revel/revel/template.go
Go
go
15,623
permissive
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. // Revel Framework source code and usage is governed by a MIT style // license that can be found in the LICENSE file. package revel import ( "bufio" "bytes" "fmt" "io" "io/ioutil" "os" "path/filepath" "regexp" "strconv" "strings" ...
47bb0e050db131094f362a28ffb0ea66e9797d8e
31386c511fcbf74754009dad5ae6e80d38405ac6
NutriSafe-DLT/nutrisafe
/fabric-version2x/chaincode/nutrisafecc/main.go
Go
go
433
permissive
package main import ( "github.com/hyperledger/fabric-contract-api-go/contractapi" ) func main() { tntsc := new(TNTSC) tntsc.TransactionContextHandler = new(CustomTransactionContext) tntsc.BeforeTransaction = GetWorldState tntsc.UnknownTransaction = UnknownTransactionHandler cc, err := contractapi.NewChaincode...
fd4cb43cac80939c4bfce4425f5cb7603fc692da
62872486702e34a138a48358760828fb7a9aaa32
lxq2537664558/GoGameServer
/src/core/global.go
Go
go
485
no_license
package core import ( "core/libs/grpc/ipc" "core/libs/mysql" "core/libs/redis" "core/libs/rpc" ) type IService interface { Env() string Name() string ID() int Identify() string GetIpcClient(serviceName string) *ipc.Client GetRpcClient(serviceName string) *rpc.Client GetRedisClient(redisAliasName string) *r...
de604619d6b60dc7252c9e3d4f00f341cdf4342e
4f45266c5d58258ede2fde201d2cd9592e3e0ba1
ianprogrammer/sagas-pattern
/orchestration/payment/src/router/router.go
Go
go
262
permissive
package router import ( "github.com/gin-gonic/gin" v1 "github.com/sofyan48/payment/src/app/v1/routes" ) // LoadRouter params // @routers: gin.Engine func LoadRouter(routers *gin.Engine) { version1 := v1.V1RouterLoaderHandler() version1.V1Routes(routers) }
a3ba7ced650285aab631788067502260d37dd066
a72acf7ee763ea93765378eb3c5bdeca88970868
SaiVishwas/aws-sdk-go
/aws/credentials/ec2rolecreds/ec2_role_provider.go
Go
go
5,786
permissive
package ec2rolecreds import ( "bufio" "encoding/json" "fmt" "strings" "time" "github.com/SaiVishwas/aws-sdk-go/aws/awserr" "github.com/SaiVishwas/aws-sdk-go/aws/client" "github.com/SaiVishwas/aws-sdk-go/aws/credentials" "github.com/SaiVishwas/aws-sdk-go/aws/ec2metadata" "github.com/SaiVishwas/aws-sdk-go/aws...
af8f1b20a99e3d811a216b5be259da7f22ebc160
cfa629414bfa8ec26a8e8fd3ade112d9088dd162
johnbirdau/pulumi-azure-native
/sdk/go/azure/network/v20170801/virtualNetworkGateway.go
Go
go
19,549
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 v20170801 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // A common class for general resource i...
809daba88dd11625d3add77e8d2f0deb8c8ab943
3ab987095c08e2d05f6cf0691054bde115a7acb9
ericflo/mediasummon
/userconfig/userconfig.go
Go
go
5,960
permissive
package userconfig import ( "encoding/json" "errors" "fmt" "io/ioutil" "log" "os" "path/filepath" "strings" "time" "golang.org/x/crypto/bcrypt" "maxint.co/mediasummon/constants" ) // ErrNeedSecrets is the error returned when we can't find secret var ErrNeedSecrets = errors.New("Could not find secret") //...
d0779603d7698b0884f7e434f1f8e5042b0d7c4c
207ec01e76d7a618ee713a1b92fea105f1be84af
Rheinwerk/yq
/pkg/yqlib/decoder_yaml.go
Go
go
3,068
permissive
package yqlib import ( "bufio" "errors" "io" "regexp" "strings" yaml "gopkg.in/yaml.v3" ) type yamlDecoder struct { decoder yaml.Decoder // work around of various parsing issues by yaml.v3 with document headers prefs YamlPreferences leadingContent string readAnything bool firstFile bool }...
85a4f9d3f8dfd4dd6ebe6ab60ec9ea7aede91e25
5f474cc089c4e6482aeee17318a49e3e640f73a5
Luzkan/GoConcurrency
/MathBusinessMachines/main.go
Go
go
2,650
no_license
package main /* Current work flow: -> Boss creates a task -> Task goes to MagazineTodo -> Worker grabs a task and tries to put it into a machine -> Either awaits in que or runs around looking for free one -> Machine solves task -> Worker takes the task and stores it in MagazineReady -> Customer buys the product */ ...
8707c19acaf9af9141bd111a2c3a9c2c4a6f0850
c2685ff8dc1da8b4af3792aa53f17c3db7dd2384
NjinN/RML-view
/nativelib/json.go
Go
go
7,190
no_license
package nativelib import ( "strconv" "strings" "bytes" "sync" // "fmt" "unicode" . "github.com/NjinN/RML/go/core" ) func Jjson(es *EvalStack, ctx *BindMap) (*Token, error) { var args = es.Line[es.LastStartPos() : es.LastEndPos()] return &Token{STRING, ToJsonStr(args[1])}, nil } func Dejson(es *EvalStack, c...
5e8e2ef151c7708fa02a60ec190dfe06c0a46588
6a44d5d1e9bf8f207d7af0a53b2044a6c0172e04
1and1/soma
/lib/proto/cluster.go
Go
go
1,850
permissive
/*- * Copyright (c) 2016, 1&1 Internet SE * Copyright (c) 2016, Jörg Pernfuß <joerg.pernfuss@1und1.de> * All rights reserved * * Use of this source code is governed by a 2-clause BSD license * that can be found in the LICENSE file. */ package proto type Cluster struct { Id string `json:"id,omite...
816346f6e24d6e99d2d85ddb1e6ebbd4ea90bb63
59ebb2eda27b15956138330187542d66d7690a85
chriscross0/go-restcountries
/httputils_test.go
Go
go
1,578
permissive
package restcountries import ( "errors" "net/http" "net/http/httptest" "testing" "time" ) type ClientMock struct { DoFunc func(*http.Request) (*http.Response, error) } func (c *ClientMock) Do(req *http.Request) (*http.Response, error) { return c.DoFunc(req) } func TestGetUrlContentErrorEOF(t *testing.T) { ...
476e4327e6e6c50b442fc2acb2d36f82e695d223
addf72b0581b001f245f0bea33825b3cce5abbc3
julz/eventing-kafka
/pkg/channel/health/health.go
Go
go
1,854
permissive
package health import ( "knative.dev/eventing-kafka/pkg/common/health" "sync" ) // Start The HTTP Server Listening For Requests type Server struct { health.Server // Additional Synchronization Mutexes producerMutex sync.Mutex // Synchronizes access to the producerReady flag channelMutex sync.Mutex // Synchro...
24507357341e249109a7d191f678824493a956f5
2b1922e050cfc6ef3fcd81f9b170cbbf10ea43e1
radanalyticsio/oshinko-cli
/vendor/github.com/openshift/origin/pkg/authorization/rulevalidation/policy_comparator.go
Go
go
5,515
permissive
package rulevalidation import ( "strings" "k8s.io/apimachinery/pkg/util/sets" authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization" ) // Covers determines whether or not the ownerRules cover the servantRules in terms of allowed actions. // It returns whether or not the ownerRules co...
5ae3b2bce296844892eb0775d0366e55717c36e9
f5a04185ff3b893b4b40d9a77be23bc053eef319
ygyg123456/tidb
/tidb-server/main.go
Go
go
23,960
permissive
// Copyright 2015 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...
a7280de629e11e8814f10ac491ff72774e79249f
007f6b36bf5d55ed1eea7c5e2e28bda9ac72c617
FirmDiary/comic
/api/controllers/invite_controller.go
Go
go
1,211
no_license
package controllers import ( "comic/api/middleware" "comic/common" "comic/datamodels" "comic/repositories" "comic/services" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/mvc" "net/http" "strconv" ) type InviteController struct { Ctx iris.Context } func (c *InviteController) BeforeActivation(b ...
4e93354c98a223c0e293d16681f9ba78e2c365cd
6e23dd52f051be13a0ed25c2a4763a33f1a71705
119Vik/magma-1
/feg/cloud/go/services/feg_relay/test_init/test_service_init.go
Go
go
990
permissive
/* Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ package test_init import ( "testing" "magma/feg/cloud/go/feg" "magma/feg/cloud/go/protos" "magma/feg/cloud/go/...
ef70b9e4ff89a9e4fd2305ac34a3054c137d72e1
183e6da85f1df97036d0551d37c0e5227c42466c
jsteenb2/recursivepancake
/interface.go
Go
go
282
no_license
package main type Interface struct { pkg string } var _ Exporter = Interface{} func (Interface) Type() string { return "interface" } func (i Interface) Package() string { return i.pkg } func (Interface) Compare(Exporter) (Differences, bool) { return Differences{}, false }
ed32f42f323eacead4d54c3448648055d9633477
c80a905616c7b8b8395e37fea2011b7ff99a607a
sunlidong/go-cloud
/internal/docstore/docstore.go
Go
go
16,737
permissive
// Copyright 2019 The Go Cloud Development Kit 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
4335ee6c3e9a140fcd05b2926eaa011d1bb51cdc
56099695a6cbcafa960b324abc990d001eded323
openshift/kubernetes-metrics-server
/vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/dispatcher.go
Go
go
10,472
permissive
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
7c76a48c9acae7d98048a4520a0945383e73a9af
f3319708024b69f424312d98fa1cfbabef317b12
tmechen/mqttbeat
/vendor/github.com/docker/docker/pkg/devicemapper/devmapper.go
Go
go
23,888
permissive
// +build linux,cgo package devicemapper import ( "errors" "fmt" "os" "runtime" "unsafe" "github.com/Sirupsen/logrus" "golang.org/x/sys/unix" ) const ( deviceCreate TaskType = iota deviceReload deviceRemove deviceRemoveAll deviceSuspend deviceResume deviceInfo deviceDeps deviceRename deviceVersion ...
f9e10deaae42875458d3b68ab71e54140cfd6f31
384289a5e4bc55770e2c2704b542571513b27d1d
yourenyouyu/gocodesite
/gocodecc/model.go
Go
go
972
no_license
package gocodecc import ( "database/sql" "strings" "github.com/astaxie/beego/orm" //_ "github.com/go-sql-driver/mysql" _ "github.com/mattn/go-sqlite3" ) var ( dbDriverName = "sqlite3" dbDriverType = orm.DRSqlite ) func snakeString(s string) string { data := make([]byte, 0, len(s)*2) j := false num := len(...
3bcd24beeb66821b40dac7de416fed43afbf253a
9f06dc903043b867b51494d026f9a77a9a144f4e
ShaneLee/gowaves
/pkg/grpc/server/tx_filter_test.go
Go
go
3,176
permissive
package server import ( "testing" "github.com/stretchr/testify/assert" "github.com/wavesplatform/gowaves/pkg/crypto" g "github.com/wavesplatform/gowaves/pkg/grpc/generated" "github.com/wavesplatform/gowaves/pkg/proto" ) const ( idStr = "B2u2TBpTYHWCuMuKLnbQfLvdLJ3zjgPiy3iMS2TSYugZ" idStr2 = "B1u2TBpTYHWCuMuK...
10958581027c8b2ae32d8f1b1299f8e2e02baf60
6edd46dba70f5ec114d768fc4421e7a4dcbcf71e
hico-horiuchi/uitable
/example/main.go
Go
go
1,045
permissive
package main import ( "fmt" "github.com/hico-horiuchi/uitable" ) type hacker struct { Name, Birthday, Bio string } var hackers = []hacker{ {"Ada Lovelace", "December 10, 1815", "Ada was a British mathematician and writer, chiefly known for her work on Charles Babbage's early mechanical general-purpose computer,...
5e571f7e1a7cbc345b37b37d6cf9df2afe16ef72
0b8fda9690a0c84602c73bb4ecc5d8b58c6e690f
chay22/tuya-cloud-sdk-go
/api/pairing/get_pairing_devices.go
Go
go
1,617
permissive
package pairing import ( "fmt" "github.com/tuya/tuya-cloud-sdk-go/api/common" ) type GetPairingDevicesReq struct { Token string } func (t *GetPairingDevicesReq) Method() string { return common.RequestGet } func (t *GetPairingDevicesReq) API() string { return fmt.Sprintf("/v1.0/device/paring/tokens/%s", t.Toke...
8c396d3a515dc9031dbf1c79f89bca469f508ca4
b0630426dc4aed5fdf89112f91c11861c9a4cc17
BlockchainBase/AppChain1.0
/ethdb/database.go
Go
go
10,876
no_license
// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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...
e60763c6b073ee0346261950947f6e268ae5b566
59995b5613d93d3b94f7982371a59500460f4af2
herojan/skipper
/filters/log/log.go
Go
go
6,002
permissive
/* Package log provides a request logging filter, usable also for audit logging. Audit logging is showing who did a request in case of OAuth2 provider returns a "uid" key and value. */ package log import ( "bytes" "encoding/json" "io" "os" "regexp" "strings" log "github.com/sirupsen/logrus" "github.com/zalan...
30d697bed39ccf3fac6f970079c20539ee29f34d
1f6fb6a34bf4d689e3db453824e62b83d850a811
cli/cli
/pkg/cmd/release/view/view.go
Go
go
5,514
permissive
package view import ( "context" "fmt" "io" "net/http" "strings" "time" "github.com/MakeNowJust/heredoc" "github.com/cli/cli/v2/internal/ghrepo" "github.com/cli/cli/v2/internal/text" "github.com/cli/cli/v2/pkg/cmd/release/shared" "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/iostreams" "g...
a03175df2ccced64431e4373f2218d1d917eec80
5d3b1a631732004db29d11fca037ceb138741314
kozuelam/oneledger
/action/transfer/send_test.go
Go
go
8,515
permissive
package transfer import ( "errors" "github.com/Oneledger/protocol/data/fees" "os" "testing" "github.com/tendermint/tendermint/libs/db" "github.com/Oneledger/protocol/log" "github.com/Oneledger/protocol/storage" "github.com/Oneledger/protocol/data/balance" "github.com/Oneledger/protocol/data/chain" "github...
5e354209cbcce72629ac08eea49971d61dd5f9e1
0fafa812a60babb2c5dadf29ca0d4decf1cc7573
hyperhq/kubernetes
/staging/src/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go
Go
go
1,801
permissive
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
4697458be483114000db96b04343a5df49b42ffb
7785cf4a76bb6894105d3a5ab26578c763a5e51a
bububa/opentaobao
/api/alihealthoutflow/AlibabaAlihealthDoctorLeshuiApplyNotify.go
Go
go
693
permissive
package alihealthoutflow import ( "github.com/bububa/opentaobao/core" "github.com/bububa/opentaobao/model/alihealthoutflow" ) // AlibabaAlihealthDoctorLeshuiApplyNotify 申请单审核结果通知 // alibaba.alihealth.doctor.leshui.apply.notify // // 申请单审核结果通知 func AlibabaAlihealthDoctorLeshuiApplyNotify(clt *core.SDKClient, req *al...
dd21c36989971d5b2762af7a0853467da8382d91
66081427627462bb685d94db57e9fe6f1c3c54b1
srcclr/hugo
/hugolib/site_output_test.go
Go
go
3,951
permissive
// Copyright 2017-present The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by app...
762eedd511215ae0c4fb8d8cb86f70ab106e1917
55bd18cb0c16bfdd6ebd2e2cf658299071c15d3a
Zergity/ethereal
/cmd/ensaddressget.go
Go
go
1,469
permissive
// Copyright © 2017 Weald Technology Trading // 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 a...
cd6465574a8f80044f9bec38c22f586f37de775a
0a23eb99f947ca8f3b9ef1b1f008d99fc126367b
evandbrown/kf
/pkg/kf/commands/routes/unmap_route_test.go
Go
go
5,627
permissive
// Copyright 2019 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
3e63880de1d3e08ccf70235bc332a35e280de5ae
edc4c04b026f8087b9f403faf8eda52ed4d3155a
rishavcn/knative-controller
/test10/cmd/manager/main.go
Go
go
2,408
no_license
/* Copyright 2019 Rishav Kumar. 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...
ee7b35bb9ee45dbb4002459f4af7c35aa3eef481
bfd5cbb43e558153f2949d202636ea8b59502290
dcnl1980/go-next-base
/inter/dag/tdag/events_test.go
Go
go
817
permissive
package tdag import ( "math/rand" "testing" "github.com/Fantom-foundation/lachesis-base/hash" "github.com/Fantom-foundation/lachesis-base/inter/dag" ) func TestEventsByParents(t *testing.T) { nodes := GenNodes(5) events := GenRandEvents(nodes, 10, 3, nil) var ee dag.Events for _, e := range events { ee = a...
a89432147378aa22d708d77afd4842033558d92c
b7ae90a707b6cc138ca2c3a10e7642707c057af5
munnerz/cert-manager
/pkg/webhook/handlers/testdata/apis/testgroup/v1/types.go
Go
go
1,234
permissive
/* Copyright 2019 The Jetstack cert-manager contributors. 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...
cc8edf9d70b68b854324950fcdf529957eb3ea0d
86f28282a7e6f9161529e30d53aac93500cdc787
nofun97/arrai
/rel/match_test.go
Go
go
2,542
permissive
package rel import ( "testing" "github.com/stretchr/testify/assert" ) func TestBindMatchNumber(t *testing.T) { t.Parallel() val := NewNumber(1) m := Bind(&val) assert.Equal(t, true, m.Match(NewNumber(2))) } func TestBindMatchString(t *testing.T) { t.Parallel() val := NewString([]rune("foo")) target := ...
a992c172b9227bc0d3a3e35290cc6899a7a06b5f
385f81c447df8b32544f3c78fd8cde9ebc58e462
fundon/fiber
/middleware/recover_test.go
Go
go
741
permissive
package middleware import ( "io/ioutil" "net/http/httptest" "testing" "github.com/gofiber/fiber" "github.com/gofiber/utils" ) // go test -run Test_Middleware_Recover func Test_Middleware_Recover(t *testing.T) { app := fiber.New() app.Use(Recover()) app.Get("/panic", func(ctx *fiber.Ctx) { ctx.Set("dummy"...
9cf1920ec10e67b3f4934cbb25eebb24e7dba23e
823da52feb15366a6abb8793305ebab6620f50ec
eveybcd/aBitcoinDiamond
/vendor/github.com/btcsuite/btcutil/gcs/gcs.go
Go
go
15,488
permissive
// Copyright (c) 2016-2017 The btcsuite developers // Copyright (c) 2016-2017 The Lightning Network Developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package gcs import ( "bytes" "fmt" "io" "sort" "github.com/aead/siphash" "github.com/aBitcoinDiamond/...
c1d54b86e29a1e9f52e68e3b52208ad70d5eec2f
e2026f350038ccaec8bb288518e768e15f83a466
dustintownsend/origin
/pkg/sdn/registry/netnamespace/strategy.go
Go
go
2,091
permissive
package netnamespace import ( "fmt" kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic" "github.com/GoogleCloudPlatform/kubernetes/p...
23a3cfd8b62e2e9065b9e90342bc957c66f7c2f9
5cb93f597d26d2131a306456cb4008220a421ffa
zvejnmlz/hdpass
/src/reader.go
Go
go
1,164
no_license
package hdpass import ( crand "crypto/rand" "crypto/sha256" "hash/crc64" "math/big" "math/rand" ) type reader struct { init string position int vector []byte nextVector []byte } func NewReader(vector string) *reader { h := sha256.Sum256([]byte(vector + "InitSalt")) nh := sha256.Sum256(h[:]) ...
7be29e55efba88ea55a09ba52a02cfc4e227904f
4c650a986e8f35b6e30dbcc36b70d8a636f819de
swaggo/swag
/formatter_test.go
Go
go
7,595
permissive
package swag import ( "testing" "github.com/stretchr/testify/assert" ) const ( SearchDir = "./testdata/format_test" Excludes = "./testdata/format_test/web" MainFile = "main.go" ) func testFormat(t *testing.T, filename, contents, want string) { got, err := NewFormatter().Format(filename, []byte(contents)) a...
4729a74fb218b6dd74bdc2b4c5a5c9ad6342fcd3
ed0dca9806aca1591b476b02a63ebbb825c6995f
colinjfw/sqlkit
/db/where.go
Go
go
1,552
permissive
// Copyright (C) 2018 Colin Walker // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. package db import "reflect" type where struct { sql SQL // Bare where clause. } func (q where) where(op operator, where interface{}, values ...interface{}...
e69ecf30b59022b072103a4dc2371b947f8484c7
d287fe94c2324d229635d9e0f87ad684b09c0eec
luoyelaiwanfan/log
/test/19_timeAfter/timeafter.go
Go
go
442
no_license
package main import ( "fmt" "time" ) func main() { timeNow := time.Now().Unix() timeAfter := timeNow + 5 fmt.Println(time.Unix(timeNow, 0)) fmt.Println(time.Unix(timeAfter, 0)) go func() { <-time.After(time.Duration(timeAfter-time.Now().Unix()) * time.Second) // 代码段3 fmt.Println("5s timeout。。。。") retur...
42a516c45057cad8dbbe859e4fa951bdd2399f8f
d1032a41ca10c66f746c29c4331a16a175be3af3
AnomiNet/anomi
/model/user.go
Go
go
1,748
permissive
package model import ( "crypto/rand" "errors" "math/big" "time" ) type User struct { Id int64 `json:"id"` LastActive int64 `json:"last_active_at"` Handle string `json:"handle"` Token string `json:"token"` PostIds []int64 `json:"post_ids"` VotePostIds []int64 `json:"vote_post_i...
9da1355ff24bb84945fa2304161b7a80c49329d8
2a233257a5211534aa2d16472e35a100456a5369
observatorium/thanos-replicate
/vendor/github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing/client_interceptors.go
Go
go
4,773
permissive
// Copyright 2017 Michal Witkowski. All Rights Reserved. // See LICENSE for licensing terms. package grpc_opentracing import ( "context" "io" "sync" "github.com/grpc-ecosystem/go-grpc-middleware/util/metautils" opentracing "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "gi...