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
1ca14ebcaf57763f4ae9886e564a07731e8094ae
ad965e1745df4e07bd456d6ac449e8b1a72c1533
bells17/kubebuilder
/testdata/project-v3/controllers/admiral_controller.go
Go
go
2,184
permissive
/* Copyright 2021 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, ...
a8a886a3b5569cd34e762543d5bbe1accd3ea4d5
a4683daedebad0535bd83440e5949096a3e2934b
isgasho/vitess-operator
/pkg/operator/vttablet/flags.go
Go
go
4,574
permissive
/* Copyright 2019 PlanetScale 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 writing, softwar...
dac6333f161a2a4bee8c314df31d289614cd8e18
7d5fb34eba55e28f7f91944b1c9d854066aa3d80
go-tee/di
/container/prop_scope.go
Go
go
237
no_license
package container const ( ScopePrototype = "prototype" ) type defScope string func (s defScope) isContainer() bool { return string(s) != ScopePrototype } func (s defScope) isPrototype() bool { return string(s) == ScopePrototype }
63bd03aa2b1bb8c6b09964ac75cef6ecb3be42a7
34539f274782087a8651d56982b6bd59da557661
libreoscar/crypto
/signer_test.go
Go
go
665
no_license
package crypto import ( "github.com/facebookgo/ensure" "testing" ) func TestSigner(t *testing.T) { signer := NewSigner() key1 := P256GenPrivKey() key2 := P256GenPrivKey() signer.AddKey(key1) signer.AddKey(key1) ensure.DeepEqual(t, signer.Size(), 1) pubkeys := signer.PublicKeys() ensure.DeepEqual(t, len(p...
4a181a7ef4db90bf5b2b3c777a1cda51f75f57c3
8c30ab39a888d1a3341ad805dc91932c3fb4f776
liyangdal/nsq
/nsqd/http_test.go
Go
go
19,036
permissive
package nsqd import ( "bytes" "crypto/tls" "fmt" "io/ioutil" "net" "net/http" "runtime" "strconv" "sync" "testing" "time" "github.com/bitly/go-nsq" ) func TestHTTPput(t *testing.T) { opts := NewNSQDOptions() opts.Logger = newTestLogger(t) _, httpAddr, nsqd := mustStartNSQD(opts) defer nsqd.Exit() t...
ca2223bd5f4fcdb8bdc32696168e1e5ec8a49b64
2a8def103fa3e725649c103da05af173106b69f3
amithk/indexing
/secondary/common/partition_container.go
Go
go
1,596
permissive
// Copyright (c) 2014 Couchbase, 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 writin...
f064ce65610f0960549a577e00fbcd075b4c86ee
9abe774b9e253469dd20501ea57b631978df579f
karolgorecki/todo
/task/task_test.go
Go
go
1,879
no_license
package task_test import ( "testing" "github.com/karolgorecki/todo/task" "github.com/karolgorecki/todo/testdb" ) func TestRegisterDB(t *testing.T) { // nothing to test here task.RegisterDB(&testdb.TestDB{}) } func TestNewID(t *testing.T) { id1 := task.NewID() id2 := task.NewID() if id1 == id2 { t.Error("T...
9af2e941351311fa45cb76f8c2a7f83f8ae9f692
f3deee64c0010f32e60f01b63b26405a7b11e775
lehrbaumm/AppliedCryptography
/UE5/aky5_ue8.go
Go
go
1,483
no_license
package main import ( "fmt" "crypto/elliptic" crand "crypto/rand" "crypto/ecdsa" "crypto/sha256" "math/big" ) type message struct { msg string r, s []byte } func main() { fmt.Println("Elliptic cuves") msg := "Franz jagt im komplett verwahrlosten Taxi quer durch Bayern." c := elliptic.P521() private, _ :=...
27952ee13258ec2b1afb2f35a49493b0dda39430
a3c45310662bf21360d31db37fbba95f1d2b6483
uber-go/mapdecode
/decode_example_test.go
Go
go
2,263
permissive
// Copyright (c) 2017 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
711ba2732e82ae1cae66ee1c7c350dd5dff24a29
384b5b2614ba3f77d727751bdd3c0aa0b45673fb
heyuanree/Venom
/node/global.go
Go
go
632
permissive
package node import "github.com/Dliv3/Venom/utils" // CurrentNode 当前节点 var CurrentNode = Node{ IsAdmin: 0, HashID: utils.NewUUID(), // Conn: nil, // 当前节点无需使用Conn // ConnReadLock: nil, // ConnWriteLock: nil, // Socks5SessionIDLock: nil, } var GNetworkTopology = NetworkTopology{ RouteTable: make(map[...
636714c6ff50a23f4715615d05c19a147bdac062
c3ac0d572b1a2455ea9d75900c3e97795490917b
godzie44/go-xls
/xls/row_test.go
Go
go
3,675
permissive
package xls import ( "github.com/stretchr/testify/suite" "os" "strings" "testing" ) type rowTS struct { suite.Suite openFn func(fName string, charset string) (*WorkBook, error) } func (suite *rowTS) TestRowsExtract() { testCases := []struct { fName string SheetNumber int RowCount int }{ {sma...
89a5970a1a99d05bc691cfcf6dbd54c1dda6bc1d
69667e6a3d86ab7aa6d8ccd9f0a091535e84b978
Shopify/argo-cd
/test/e2e/fixture/fixture.go
Go
go
25,870
permissive
package fixture import ( "bufio" "context" goerrors "errors" "fmt" "io/ioutil" "os" "path" "path/filepath" "strconv" "strings" "testing" "time" "github.com/argoproj/pkg/errors" jsonpatch "github.com/evanphx/json-patch" "github.com/ghodss/yaml" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/...
f9e188f6b8d1f49e556a16a43c8176554c9c9bcb
d6af47ca4530ac1fde73998779a9d94283944f7a
julianchr/magma
/symphony/graph/cmd/entscript/main.go
Go
go
5,163
permissive
// Copyright (c) 2004-present Facebook 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 ( "context" "github.com/facebookincubator/ent/dialect/sql" "github.com/facebookincubator/symphony/graph/event" "github.com/facebo...
583157e79cb62c1ab2d0512428880c740fa7d3c8
48069f453176859c1983b6e0327408943967afcc
adnrs96/auth
/gh/oauth.go
Go
go
470
permissive
package gh import ( "context" "fmt" "golang.org/x/oauth2" ) type OAuthClient struct { Config *oauth2.Config } func (c OAuthClient) GetConsentURL(state string) string { return c.Config.AuthCodeURL(state) } func (c OAuthClient) GetAccessToken(authCode string) (string, error) { token, err := c.Config.Exchange(c...
271db091114f6f42a6ff6810a2e6f5c1e42bfeb4
5fead42409e3c6756be25b5228001cf48e83e116
PengliuIBM/cloud-suitability-analyzer
/go/model/Run.go
Go
go
7,900
permissive
/******************************************************************************* * Copyright (c) 2018 - Present VMware, Inc. All Rights Reserved. * SPDX-License-Identifier: BSD-2 ******************************************************************************/ package model import ( "fmt" "os" "os/user" "path/fi...
825ad75e37ed399ba07c1e2cb14d081a509d5c66
55f85d52927a12fd439b367f8f6aa89b76b3e107
ademuanthony/smarthead
/internal/signup/signup.go
Go
go
5,460
permissive
package signup import ( "context" "errors" "time" "remoteschool/smarthead/internal/account" "remoteschool/smarthead/internal/platform/auth" "remoteschool/smarthead/internal/platform/web/webcontext" "remoteschool/smarthead/internal/platform/web/weberror" "remoteschool/smarthead/internal/postgres/models" "remo...
cff4a063118f53370e4708db11f529ece1d5dc61
7cfbf931bc4d0cee9f41a1549589034d762f42ff
leeprince/CronSellerOrderStatus
/src/admin/db/InitWriteMysql.go
Go
go
1,352
no_license
package db import ( "CronSellerOrderStatus/src/admin/helper" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/go-xorm/xorm" //"github.com/go-xorm/core" "xorm.io/core" "os" ) var WriterEngine *xorm.Engine var errWriterEngine error // 初始化读库 func InitWriterMysql() { mysqlConfig := helper.GetwriterDbUser()+...
97f77e1f45f3ed8a06c93675f95900b4e790d79e
21beea6136321a182933cfb71fb786d34340df88
athilaelhuno/aws-app-mesh-controller-for-k8s
/pkg/metrics/recorder.go
Go
go
3,238
permissive
package metrics import ( "github.com/prometheus/client_golang/prometheus" "time" ) // Subsystem represents the Prometheus metrics prefix const Subsystem = "appmesh" // Recorder exports mesh stats as Prometheus metrics type Recorder struct { meshState *prometheus.GaugeVec virtualNodeState *prometheus...
6984edd299e80d1951a84cccc9554d787310be7d
e8cc2ed3e8785669ea57cab2be3d6e8837bf2144
davidlcarrascal/go-admin
/plugins/admin/controller/detail.go
Go
go
4,068
permissive
package controller import ( "fmt" template2 "html/template" "net/http" "github.com/davidlcarrascal/go-admin/context" "github.com/davidlcarrascal/go-admin/modules/auth" "github.com/davidlcarrascal/go-admin/modules/language" "github.com/davidlcarrascal/go-admin/modules/menu" "github.com/davidlcarrascal/go-admin...
baa25bf99de469ac950dbba034050c8ad2ce1bb6
a08d8e3610f077110565b221307d616989126ee4
bourneAc/stake
/main.go
Go
go
3,005
no_license
package main import ( "encoding/hex" "encoding/json" "fmt" "github.com/sero-cash/stake/rpc" "log" "math/big" "os" "path/filepath" "time" ) type Config struct { Host string PoolPK string Vote string Pool string Fee int64 PK string SoloVote string Period string } var ( basePrice = b...
e298321de2a6da9aca9ed0a2cdbf179502a6d196
ac962f556dc7822abe696d4a95cdfed8f1b12eee
1310238398/park-asset
/internal/app/model/impl/gorm/internal/entity/e_asset_group_detail.go
Go
go
1,791
permissive
package entity import ( "context" "gxt-park-assets/internal/app/schema" "gxt-park-assets/pkg/gormplus" ) // GetAssetGroupDetailDB 资产组明细管理 func GetAssetGroupDetailDB(ctx context.Context, defDB *gormplus.DB) *gormplus.DB { return getDBWithModelPlus(ctx, defDB, AssetGroupDetail{}) } // SchemaAssetGroupDetail 资产组明细管...
d92651239adce9f504022781b083bd2356d8cba7
2b28116aec9fdb524797419134ae407af6fbf06b
Chive/cost-model
/pkg/cloud/csvprovider.go
Go
go
8,583
permissive
package cloud import ( "encoding/csv" "fmt" "io" "os" "regexp" "strings" "sync" "time" "github.com/kubecost/cost-model/pkg/env" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/kubecost/cost-model/pkg/log" v1 "k8s.io/api/core/v1"...
5ba0acab3eab6f5f26e086cf04482272f6f536fc
f1cea48433785a2d45b1c29ac8699d3b13851221
JimBugwadia/keywhiz-fs
/fs/secret.go
Go
go
2,670
permissive
// Copyright 2015 Square 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 writ...
bdab84cbf59095de5cdfa58e3676e89b15b9abec
3f97ad0803fdb6d79340ac0b02f4159e9ac0151c
tyroyang/erda
/modules/cmp/component-protocol/components/cmp-dashboard-podDetail/containerTable/render.go
Go
go
7,131
permissive
// Copyright (c) 2021 Terminus, 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 agree...
3b72a9d44443991b4a378bb76606b10a2b6fac7d
4adfdad5a47a5a53704fd02b3bc5d08149537b69
vvicaretti/raingutter
/raingutter/socket_stats.go
Go
go
4,014
permissive
// Author: Sean Goedecke <sgoedecke@zendesk.com> package main import ( "errors" "io/ioutil" "strconv" "strings" log "github.com/sirupsen/logrus" ) type SocketStats struct { QueueSize float64 ActiveWorkers float64 } type Socket struct { LocalPort int64 ConnState string Inode string QueueSize floa...
aacd712953992b1021def4145745b302faff0ced
adae0ca6cd7abebcbada3afdd6d8511c3a78f293
miprotek/grafana-de
/pkg/services/quota/quota.go
Go
go
2,105
permissive
package quota import ( "github.com/miprotek/grafana-de/pkg/bus" m "github.com/miprotek/grafana-de/pkg/models" "github.com/miprotek/grafana-de/pkg/services/session" "github.com/miprotek/grafana-de/pkg/setting" ) func QuotaReached(c *m.ReqContext, target string) (bool, error) { if !setting.Quota.Enabled { return...
301974873ad1d2975f9b35c674716db8a56e2a70
e5de10bb9798d505d528161c9bc4814351d85705
microsoftgraph/msgraph-beta-sdk-go
/print/printer_shares_item_allowed_groups_request_builder.go
Go
go
7,906
permissive
package print import ( "context" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" i20a3050780ee0b0cde0a884a4f35429a20d60...
4f58430a2ce558072ae7d505238d9c7b6f056811
8c2d142d9adb842ce6a594c505726198b8bd9f6e
diazjf/ingress
/internal/ingress/annotations/log/main_test.go
Go
go
2,499
permissive
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
c421880f2fbdb9fe73978d471e4c67ba190f516d
4b48f8f5f68f909be92e12f22b95b3135223ac73
cxz/aistore
/xaction/bucket.go
Go
go
17,137
permissive
// Package xaction provides core functionality for the AIStore extended actions. /* * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. */ package xaction import ( "context" "fmt" "time" "github.com/NVIDIA/aistore/3rdparty/glog" "github.com/NVIDIA/aistore/api" "github.com/NVIDIA/aistore/bcklis...
42d6fcfbfd1e1b8a7848716733e60aed038af6f7
60da1ddada84969420b7ef211a3d0409c9eb7863
Windscribe/share
/lib/dsv/reader_test.go
Go
go
9,399
permissive
// Copyright 2015-2018, Shulhan <ms@kilabit.info>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package dsv import ( "fmt" "io" "strings" "testing" "github.com/shuLhan/share/lib/tabula" "github.com/shuLhan/share/lib/test" ) //noli...
38343e092ac7565645d0c9a85005b464726cae3d
79d5c26e3e95c7b0afef3bb3696a4eedf915b559
palcoin-project/palcd
/btcjson/jsonrpcerr.go
Go
go
6,168
permissive
// Copyright (c) 2014 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package btcjson // Standard JSON-RPC 2.0 errors. var ( ErrRPCInvalidRequest = &RPCError{ Code: -32600, Message: "Invalid request", } ErrRPCMethodNotFound = &RPCErr...
5f2f75083950bb66ac2c263b398412d277fcaa86
750f950d6887e4556a42a71b2245a71c1f56f1ec
marwan-at-work/vecty-router
/redirect.go
Go
go
227
permissive
package router import ( "syscall/js" ) // Redirect ... func Redirect(route string) { js.Global().Get("history").Call( "pushState", map[string]interface{}{"redirectRoute": route}, route, route, ) refreshRoutes() }
6b952d29b71efcf41df79db171c933a35b4b2a23
861e40b044178cebfd920539d51e47bb1b103dc0
jeradM/everyflavor-api
/internal/http/api/v1/recipe_test.go
Go
go
2,602
permissive
package v1 import ( "encoding/json" "everyflavor/internal/core" "everyflavor/internal/core/mocks" "everyflavor/internal/http/api/v1/view" "net/http" "net/http/httptest" "testing" "github.com/gin-gonic/gin" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "git...
8febb4caf54211cba2aadee0ed0e4605bc204b49
84722667295636be387cb42f50f649acd8741b3c
sukauto/sukauto
/integration/tg/consts.go
Go
go
531
no_license
package tg import "sukauto/controler" var eventEmoji = map[controler.Event]string{ controler.EventCreated: "\u2795", controler.EventRemoved: "🗑️", controler.EventStarted: "👌", controler.EventRestarted: "♻️", controler.EventStopped: "✋", controler.EventUpdated: "✔️", controler.EventEnabled: "☑️", ...
e435c3b48839e7ffd5d452fe888d102e50705c78
4ec26bd905bed33aad6a510e0021751d4a0fb506
blixenkrone/mediasftp
/internal/ssh/client.go
Go
go
1,784
no_license
package ssh import ( "bufio" "os" "path/filepath" "strings" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" ) var ( log = logrus.New() hostKey ssh.PublicKey ) type SSH struct { Client *ssh.Client Config *clientCfg } type clientCfg struct { host, port, user, password s...
e4d89d54ad9f93cc3ebec2882fd31834c1fbb4bf
acc92f372eda668d2c309e4fc178a7c72f1878c6
mudit-01/istio
/pilot/pkg/networking/core/v1alpha3/httproute.go
Go
go
26,394
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...
0c09175995ac5bbb95e0d4f897fda648dd089c44
fdea587940ed32827998e909fe6996b5a21ac7ff
kdeenanauth/router
/router.go
Go
go
11,538
permissive
// Copyright 2015 Alex Browne and Soroush Pour. // Allrights reserved. Use of this source code is // governed by the MIT license, which can be found // in the LICENSE file. package router import ( "log" "regexp" "strings" "github.com/go-humble/detect" "github.com/gopherjs/gopherjs/js" "honnef.co/go/js/dom" ) ...
fa65b47b83d9bac956c85f91f1a7a9a6c4f4d406
7dda1eb7ef8592bdbc7954bc193b1b3007a8867f
imrenagi/keptn
/cli/cmd/install.go
Go
go
24,273
permissive
// Copyright © 2019 NAME HERE <EMAIL ADDRESS> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law ...
3b03b7f6fb4a29e5618cdcf5503b650e67244e9c
a8d48102f04eb90d982e422cadd21e618917133a
roneetkumar/tasker-cli
/main.go
Go
go
413
no_license
package main import ( "fmt" "os" "path/filepath" homedir "github.com/mitchellh/go-homedir" "github.com/roneetkumar/tasker/cmd" "github.com/roneetkumar/tasker/db" ) func main() { home, _ := homedir.Dir() dbpath := filepath.Join(home, "tasks.db") err := db.Init(dbpath) must(err) must(cmd.RootCMD.Execut...
9674a7c0a2fc45980c398ed55db5794f1ae5424c
56e948962477b604421fb164cc7a0c6a7780e708
ShihaoJing/ShardedKeyValueService
/src/raft/util.go
Go
go
502
no_license
package raft import ( "log" ) // Debug Debugging level const Debug = 0 // DPrintf helper function to print logs func DPrintf(level int, format string, a ...interface{}) (n int, err error) { log.SetFlags(log.LstdFlags | log.Lmicroseconds) if Debug >= level { log.Printf(format, a...) } return } // Max integer ...
3d8ef11b21bdb21ab3312458ce303245dcff605f
e16897243fd46828cc1684756db282eb4d8b1aed
andrenguyener/info344-in-class
/zipsvr/main.go
Go
go
1,659
no_license
package main import ( "encoding/json" "fmt" "log" "net/http" "os" "runtime" "strings" "github.com/andrenguyener/info344-in-class/zipsvr/handlers" "github.com/andrenguyener/info344-in-class/zipsvr/models" ) const zipsPath = "/zips/" func helloHandler(w http.ResponseWriter, r *http.Request) { name := r.URL....
4909082b86ff5da70503103398a206a51d67bb6b
fa1fdab0f9443d429f4673f41850d3ece10939e0
dozn/CrackWatchDiscordBot
/main.go
Go
go
5,271
permissive
package main import ( "CrackWatchDiscordBot/crackwatch" "errors" "flag" "fmt" "log" "math" "os" "os/signal" "strconv" "strings" "sync" "syscall" "time" "unicode" "github.com/bwmarrin/discordgo" "golang.org/x/text/language" "golang.org/x/text/message" ) var ( discordBotToken = flag.String("token", "...
1ffb7e01944c8c2f73f4df528fddc7e70a0a6986
7cfb2870704327574ef951b4ca878d9cc97b3642
FlipsideCrypto/convox
/pkg/router/dns.go
Go
go
3,194
permissive
package router import ( "context" "fmt" "net" "os" "strings" "github.com/miekg/dns" ) type DNS struct { internal bool mux *dns.ServeMux router DNSRouter server *dns.Server upstream string } type DNSRouter interface { RouterIP(internal bool) string TargetList(host string) ([]string, error) Ups...
51e1ae3e8042163d91824cb7f6b5eba4c1ffc6e8
b9abc20f1151cc16504dc6fccbc70d3544b6b6f7
ville-vv/eth-chain-store
/src/common/go-eth/les/vflux/client/fillset.go
Go
go
3,157
no_license
// Copyright 2020 The go-eth Authors // This file is part of the go-eth library. // // The go-eth 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, or // (at you...
8d9a4bef467ef5366441ab7ccd7f6445debc92d3
7a2684c73ca9e4f690db06ec95683d8272ce1612
marcuscarr/todogo
/main.go
Go
go
552
permissive
package main import ( "log" "os" "github.com/marcuscarr/todogo/server" ) const ( port = 8080 dbhost = "localhost" dbport = 5432 dbuser = "postgres" password = "mysecretpassword" dbname = "marcus_demo" ) func main() { log.Print("Starting server...") useDBHost := os.Getenv("DB_HOST") if useDB...
613d982adf340bf21f0d05bb14dd31d7c2433ebe
0d52e1f6ad8c531aaec5dad3747c8da15b48948c
lawliet89/lego
/providers/dns/dnsimple/dnsimple_test.go
Go
go
3,284
permissive
package dnsimple import ( "os" "testing" "time" "github.com/go-acme/lego/v3/platform/tester" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const sandboxURL = "https://api.sandbox.fake.com" var envTest = tester.NewEnvTest( "DNSIMPLE_OAUTH_TOKEN", "DNSIMPLE_BASE_URL"). WithDoma...
69144feceadae209b34880033cb921b08f43d3a5
000d7177f74b95474b72ca557c9b4a9210591715
viggin543/jira
/cmd/transition.go
Go
go
3,198
permissive
/* Copyright © 2020 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
81d877fdd2ff0ffd1accb5e8547215e759ce2b31
0ce5715968121ae4608a86354fbf2c540438b6c7
nota-ja/cli
/src/cf/commands/auth_test.go
Go
go
3,307
permissive
package commands_test import ( . "cf/commands" "cf/configuration" "cf/models" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" testapi "testhelpers/api" testassert "testhelpers/assert" testcmd "testhelpers/commands" testconfig "testhelpers/configuration" testreq "testhelpers/requirements" testterm "tes...
314a02ca8eb887c3c4983955ea0227f29ee96aaf
a4c038cdd991d0f7c9c2bcababe9082b7cade0dd
owulveryck/onnx-go
/backend/testbackend/onnx/onnx_test_averagepool_2d_precomputed_strides_test.go
Go
go
763
permissive
package onnxtest import ( "testing" "github.com/gogo/protobuf/proto" "github.com/owulveryck/onnx-go/internal/onnx/ir" ) func TestNewTestAveragepool2dPrecomputedStrides(t *testing.T) { mytest := NewTestAveragepool2dPrecomputedStrides() var model ir.ModelProto err := proto.Unmarshal(mytest.ModelB, &model) if er...
0818c6528e13841d361fd5ff02e47f32c563a2fa
f3288d2fd7cea767178160a174bed53765d13e95
D-sense/cli-1
/internal/cmd/region/region.go
Go
go
1,568
permissive
package region import ( "encoding/json" "fmt" "github.com/planetscale/cli/internal/cmdutil" ps "github.com/planetscale/planetscale-go/planetscale" "github.com/spf13/cobra" ) // RegionCmd encapsulates the commands for interacting with regions func RegionCmd(ch *cmdutil.Helper) *cobra.Command { cmd := &cobra.Com...
3eb03c1258277cede3c9aa2ddaa1cfe8626d8c0e
c50496a734f58dc7caa621928d79b2fd512d8bfb
mpleso/elib
/loop/gentemplate_event_eventelogevent.go
Go
go
1,204
no_license
// autogenerated: do not edit! // generated from gentemplate [gentemplate -d Package=loop -id eventElogEvent -d Type=eventElogEvent github.com/platinasystems/elib/elog/event.tmpl] // Copyright 2016 Platina Systems, Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be f...
f13f614e8e2bba3f4287c7ce49f37c007bcb51be
f1d6371c9fe7f93c109d2eeaadca51bce0d96a81
windtalker/tidb
/executor/admin_telemetry.go
Go
go
1,845
permissive
// Copyright 2020 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...
03e35860afc8b97e61358483154938abedf377b5
cbdf35107a19cbe9ef5dc0abf17341f67625bf69
stpolar/extendingress-controller
/vendor/k8s.io/client-go/testing/fixture.go
Go
go
15,940
permissive
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
756ee1c7c67580212a89097d67701b721f34ca31
6677ab2ccf2c59befe8662c58c75f18a9c89f88b
m1zzx2/influxdb
/tenant/service_user_test.go
Go
go
6,570
permissive
package tenant_test import ( "context" "testing" "github.com/google/go-cmp/cmp" "github.com/influxdata/influxdb/v2" "github.com/influxdata/influxdb/v2/kit/platform" "github.com/influxdata/influxdb/v2/kv" "github.com/influxdata/influxdb/v2/tenant" influxdbtesting "github.com/influxdata/influxdb/v2/testing" ) ...
a51d72b0341a86904a05888c6a8e5c8c4c44ffbb
bce0e78b8307328a03c2f1950f82bc057f20608c
tylerstillwater/goweb
/responders/goweb_api_responder.go
Go
go
6,156
permissive
package responders import ( "github.com/tylerb/codecs" "github.com/tylerb/codecs/constants" codecsservices "github.com/tylerb/codecs/services" "github.com/tylerb/goweb/context" "net/http" ) const ( // DefaultStandardFieldDataKey is the default response object field for the data. DefaultStandardFieldDataKey str...
69627cf7ca5828ca644ee85fff676a206c9d268f
a70595389c54ef67f87a3a001c3828e7f5715bbe
hebin917/6.824-golabs
/src/shardmaster/common.go
Go
go
1,418
no_license
package shardmaster // // Master shard server: assigns shards to replication groups. // // RPC interface: // Join(servers) -- add a set of groups (gid -> server-list mapping). // Leave(gids) -- delete a set of groups. // Move(shard, gid) -- hand off one shard from current owner to gid. // Query(num) -> fetch Config # ...
1cb96e29fab9cdfff9d7caa585724b1f881c8ab5
2b0a956b41b3d85165713f6c5a3aabf9ca051be1
zhiyunliu/etcd
/tools/etcd-dump-db/backend.go
Go
go
4,354
permissive
// Copyright 2016 The etcd 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 t...
b6e5b58000deb493627f1191efc042c5de7c6aa0
0710adee95d54af1bf0b4de645a0a6ec122b6d9d
openapi-env-test/azure-sdk-for-go
/sdk/azidentity/live_test.go
Go
go
6,296
permissive
//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package azidentity import ( "context" "fmt" "net/http" "net/url" "os" "testing" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azc...
c356ae161ed2c5cadb834d00d9a73bf6c6d0a47e
49ef73dccb8ff97600a5a97e891f8bbaccecb1dd
forging2012/sso-jwt-auth
/controllers/loginController.go
Go
go
1,289
no_license
package controllers import ( "html/template" "github.com/asofdate/sso-jwt-auth/models" "github.com/asofdate/sso-jwt-auth/utils/hret" "github.com/asofdate/sso-jwt-auth/utils/i18n" "github.com/asofdate/sso-jwt-auth/utils/jwt" "github.com/asofdate/sso-jwt-auth/utils/logger" "github.com/astaxie/beego/context" ) v...
afdaee1eae8a2d75820b9a6b2dcff5120750176c
12f6ee049cf551aca5952f182121a8578b920e7d
simster7/argo
/pkg/apiclient/http1/workflow-template-service-client.go
Go
go
2,127
permissive
package http1 import ( "context" "google.golang.org/grpc" workflowtemplatepkg "github.com/simster7/argo/v2/pkg/apiclient/workflowtemplate" wfv1 "github.com/simster7/argo/v2/pkg/apis/workflow/v1alpha1" ) type WorkflowTemplateServiceClient = Facade func (h WorkflowTemplateServiceClient) CreateWorkflowTemplate(_ ...
5c26f62d4eedff10815278f97e91ba1d85e5b8bf
94b546cdf911d4abe9ce67ceb5f65be4a8e19846
AccelByte/accelbyte-go-sdk
/seasonpass-sdk/pkg/seasonpassclientmodels/reason_tags_result.go
Go
go
1,416
permissive
// Copyright (c) 2021 AccelByte Inc. All Rights Reserved. // This is licensed software from AccelByte Inc, for limitations // and restrictions contact your company contract manager. // Code generated; DO NOT EDIT. package seasonpassclientmodels import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt"...
5b774d805bbee681b54fa9e5c1ecc21616be46a7
0275d33f4b2581924b032d4f01b6d57506ad0726
PsymonLi/sw
/iota/svcs/common/generator.go
Go
go
775
no_license
package common import ( "encoding/binary" "fmt" "math" "math/rand" ) // GenMACAddresses generates the required number of pseudo random mac addresses func GenMACAddresses(count int) ([]string, error) { // Fixed seed to generate repeatable IP Addresses var macAddresses []string //numbers := make([]int64, count) ...
e6810e9ca2cc0d5a91f5691b7754972a544df2fc
d589cd5f6e20a3d9bed3f04d41c79c40e91db7f9
williamfeng323/dubbo-go-proxy
/pkg/config/config_load_test.go
Go
go
4,297
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
089962431b2b7754496043078f4df787b2437b85
5568414126122e923a08e868e04da42542c4d028
pierrre/imageserver
/source/http/http.go
Go
go
2,956
permissive
// Package http provides a imageserver.Server implementation that gets the Image from an HTTP URL. package http import ( "fmt" "io/ioutil" "net/http" "strings" "github.com/pierrre/imageserver" imageserver_source "github.com/pierrre/imageserver/source" ) // Server is a imageserver.Server implementation that get...
537904042c0caf85801e5e88ce23940f726893ba
142c9ea305de8631c83bbd276686afe4ca4ee0a2
cloud-barista/cb-spider
/cloud-control-manager/CloudDriverHandler_common.go
Go
go
5,422
permissive
// Cloud Driver Manager of CB-Spider. // The CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project. // The CB-Spider Mission is to connect all the clouds with a single interface. // // * Cloud-Barista: https://github.com/cloud-barista // // by CB-Spider Team, 2020.12. package clouddriverhandler i...
f9eaa99a34d798b43c233d36faf9757ff0104ccc
429f2adb63829f92fe58307a2ee7e818f8389383
hougangliu/kfserving
/pkg/reconciler/ksvc/reconciler_test.go
Go
go
4,646
permissive
/* Copyright 2019 kubeflow.org. 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...
1b500aebb19e3ccf83c7e608bf10539295967021
6c0ee761b000e13433fd7c92cca805027081ed53
papanito/logging-operator
/pkg/resources/nodeagent/nodeagent.go
Go
go
12,335
permissive
// Copyright © 2021 Banzai Cloud // // 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...
004cbd4ae8208e50cd29f529ddfaaafacc857022
5c8634bf36ab66b7dd144b003d1e819dc83cb56c
pulumi/pulumi
/pkg/cmd/pulumi/state_unprotect.go
Go
go
3,538
permissive
// Copyright 2016-2018, 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...
621f9b741975fefed3c2d57bf60ddad41e407ed1
1e1bf8f26f4118b89d0fcb63fcc9935a7a71377b
Teshel/pulumi-kubernetes
/sdk/go/kubernetes/scheduling/v1/priorityClassList.go
Go
go
13,627
permissive
// *** WARNING: this file was generated by pulumigen. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pkg/errors" metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" "github.com/pulumi/pulumi/sdk/v3/g...
4bd987d9d3bac3efc8769a39c443348456ba56a5
4e39031e2e6fb6c8126c6f0530aa26502b03f4b8
ieasydevops/grok_exporter
/tailer/fswatcher/fswatcher.go
Go
go
11,101
permissive
// Copyright 2018-2019 The grok_exporter 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 o...
9ff43525130fbe16619f41d5b5b36afcfd0a5de6
44c642fbe5689d8012ad0bd7a46251d138a276df
cybertmt/36_got_news
/pkg/storage/postgres/postgres_test.go
Go
go
2,299
no_license
package postgres import ( "github.com/jackc/pgx/v4/pgxpool" "got_news/pkg/storage" "reflect" "testing" ) func TestNew(t *testing.T) { type args struct { constr string } tests := []struct { name string args args want *Storage wantErr bool }{ // TODO: Add test cases. } for _, tt := range ...
f7c499833ffbe51c2eaf221db6e3dd59f0651c8e
c14fe6c44447996b18361a495542203dff4bff4d
thinktinker/lenslocked.com
/expdbmodels/main.go
Go
go
1,371
no_license
package main import ( "fmt" // using gorm instead to access Go's database/sql package // gorm is an Object Relation Mapper or a code library that automates // the transfer of data in a RDBMS _ "github.com/jinzhu/gorm/dialects/postgres" "lenslocked.com/models" ) const ( host = "localhost" port = 5432 ...
e9f11765c6201de9ce93f3c54f28e282de720376
d78083a28536015cd5bdb253dd1181d2c47cddd1
cardigann/cardigann
/vendor/golang.org/x/net/ipv4/sys_openbsd.go
Go
go
1,139
permissive
// Copyright 2014 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 ipv4 import ( "net" "syscall" ) var ( ctlOpts = [ctlMax]ctlOpt{ ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, ctlDst: {sysIP_RE...
749cf72f4bc23871d401efe6c8365fa929bc067a
7ac552e9eac43c4baad816d8a39c13ff44e34bea
payfazz/tango
/template/default/transport/container/client.go
Go
go
287
no_license
package container // ClientContainer handle all clients libraries / sdk used in project type ClientContainer struct { } // CreateClientContainer construct all clients libraries / sdk instance used in the app func CreateClientContainer() *ClientContainer { return &ClientContainer{} }
a27bd99c43c1dd913fd00a1f259c5350f61415dd
a44ead463739cf7e7d3f59e1f841d881846561eb
kjx98/gopenpgp
/crypto/key_test.go
Go
go
4,769
permissive
package crypto import ( "encoding/base64" "regexp" "strings" "testing" "github.com/stretchr/testify/assert" "golang.org/x/crypto/rsa" ) const name = "Richard M. Stallman" const domain = "rms@protonmail.ch" var passphrase = "I love GNU" var rsaKey, ecKey, rsaPublicKey, ecPublicKey string var ( rsaPrivateKey...
cbfffca18c6c68cb40f484d21f63f5d994e03a06
4ed669c7c2be513caf34719d8dcffce4e13a9738
hmoragrega/f3-payments
/cmd/api/handlers/response.go
Go
go
2,181
permissive
package handlers import ( "encoding/json" "net/http" "regexp" "github.com/hmoragrega/f3-payments/pkg/logging" "github.com/google/jsonapi" "github.com/labstack/echo" "github.com/pkg/errors" ) const jsonIndent = " " var ( // ErrInvalidJSONAPI error triggered when marshaling a struct to json:api has failed ...
c7829bfe023f76aac7a8c455f1f1f676ca690c16
4e6f49effbe567f5574c71bbe06fb9c1c5bab342
rolfl/gopisysfs
/pi.go
Go
go
7,462
permissive
package gopisysfs import ( "fmt" "io/ioutil" "log" "os" "path/filepath" "regexp" "sort" "strings" "sync" ) const ( sys_model = "sys/firmware/devicetree/base/model" sys_gpio = "sys/class/gpio" proc_cpuinfo = "proc/cpuinfo" ) //Pi contains information describing the Pi model we are running on type P...
3f0f170b257d70220087a3f1e17c8398a720b6d4
c805895219f482b8d0e1d80565d31926b4d527e1
wangyufeng0615/v2ray-core
/router.go
Go
go
1,788
permissive
package core import ( "context" "sync" "v2ray.com/core/common" "v2ray.com/core/common/net" "v2ray.com/core/common/vio" "v2ray.com/core/features/routing" ) type syncDispatcher struct { sync.RWMutex routing.Dispatcher } func (*syncDispatcher) Type() interface{} { return routing.DispatcherType() } func (d *s...
3c9449c758e870557b3ecff8f41208dda7d4745f
5529bee33b51686e3776f5ea7d1ecf4bd17530d5
peterrevel/agent
/agent/version.go
Go
go
463
permissive
package agent // You can overridden buildVersion at compile time by using: // // go run -ldflags "-X github.com/buildkite/agent/agent.buildVersion abc" *.go --version // // On CI, the binaries are always build with the buildVersion variable set. var baseVersion string = "3.5.4" var buildVersion string = "" func Ver...
6c8683d2e534a6cb44ecbdd8c3310a510961afcb
c568964e8468453437105efdee5c96004ebc9d48
gab-satchi/cluster-api-provider-azure
/api/v1alpha3/azuremachine_validation.go
Go
go
6,866
permissive
/* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
470faa194f72f319d98ab54c3eb3b5f63f3b4a20
8f5a8610d41c43efed96dad7c4c2ab8731b0b672
bpkgoud/pulumi-azure-native
/sdk/go/azure/storagesync/v20180701/registeredServer.go
Go
go
6,476
permissive
package v20180701 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type RegisteredServer struct { pulumi.CustomResourceState AgentVersion pulumi.StringPtrOutput `pulumi:"agentVersion"` ClusterId pulumi.StringPtrOutput `pulumi...
29f0517db572174d1f45315b6714b5eac7095c52
654b1e6bf41d00ad901693c1d8cd18b79f0c1dd6
guoyinchen/riscv-aosp-soong
/rust/builder.go
Go
go
10,214
no_license
// Copyright 2019 The Android Open Source Project // // 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 ...
cc1dc3e8fb19ac8690f1b335e75ee6ddf50ccf7c
afcbb50ba4393f09fa57a075a91b9452ac344411
coroo/enigma-school
/usecases/pelajaranUsecase.go
Go
go
1,361
no_license
package usecases import ( "github/coroo/enigma-school/models" "github/coroo/enigma-school/repositories" ) type IPelajaranUseCase interface { GetPelajaranAllService() ([]*models.Pelajaran, error) GetPelajaranByIdService(id string) (*models.Pelajaran, error) DeletePelajaranByIdService(id string) (*models.Pelajaran...
e8cdcc6f039e7381bb3d19d346b1d3f3370d4962
f3b8c4ded5309fbcad4b45135b246075e159da2e
abarbanell/loki
/clients/pkg/logentry/stages/drop.go
Go
go
8,106
permissive
package stages import ( "fmt" "reflect" "regexp" "strings" "time" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/grafana/loki/pkg/util/flagext" ) const ( ErrDropStageEmptyConfi...
6aaf39d03e1ef2c252ecb9d8f3fda5a77806896d
cb3438ae1701c4fe23f91d0fa2ad1b99b0b07724
xala3pa/my-way-to-algorithms
/sort/mergeSort/go/mergeSort.go
Go
go
624
permissive
package main import "fmt" func merge(a []int, b []int) []int { var r = make([]int, len(a)+len(b)) var i = 0 var j = 0 for i < len(a) && j < len(b) { if a[i] <= b[j] { r[i+j] = a[i] i++ } else { r[i+j] = b[j] j++ } } for i < len(a) { r[i+j] = a[i] i++ } for j < len(b) { r[i+j] = b[j] ...
5b8919dc2fe01f7bbd5b609931759f5c97afcec3
e16facc8fdce4cbba70c2584b402785a7586b1bc
sound-of-destiny/qlsc-zhxf
/pkg/services/alerting/eval_context.go
Go
go
3,387
no_license
package alerting import ( "context" "fmt" "time" "github.com/sound-of-destiny/qlsc_zhxf/pkg/bus" "github.com/sound-of-destiny/qlsc_zhxf/pkg/log" m "github.com/sound-of-destiny/qlsc_zhxf/pkg/models" "github.com/sound-of-destiny/qlsc_zhxf/pkg/setting" ) type EvalContext struct { Firing bool IsTestRun ...
48a33dce422a3dde8816eb53afc67a62f53fe263
5915e9a090e4df46f5e76f0eb074a6a02fe241de
gop9/bitbox-wallet-app
/backend/devices/bitbox02bootloader/firmware.go
Go
go
1,828
permissive
// Copyright 2018 Shift Devices AG // // 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 ...
0940fcb8d62c4f1ede2f2e8d9535a7b62da04cf1
2c060db4592c0875f8eda9c1d559795e9e27c5fb
fonero-project/fonero-golang
/services/internal/bridge-compliance-shared/protocols/asset.go
Go
go
1,098
permissive
package protocols import ( "fmt" "github.com/fonero-project/fonero-golang/build" shared "github.com/fonero-project/fonero-golang/services/internal/bridge-compliance-shared" "github.com/fonero-project/fonero-golang/support/errors" ) // ToBaseAsset transforms Asset to github.com/fonero-project/fonero-golang-fonero...
f2d788096870cb71dbcd531ef516c9db25a23716
8e37634fc3fc96426dc47dae43ac1b525a83dec7
andyYuanFZM/plugin
/plugin/consensus/qbft/peer_set.go
Go
go
43,541
permissive
// Copyright Fuzamei Corp. 2018 All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package qbft import ( "bufio" "bytes" "encoding/binary" "encoding/json" "fmt" "io" "net" "reflect" "sync" "sync/atomic" "time" "github.com/33cn/chai...
d11b68d5e2b8789d0e3f9c720612aca81c715604
5c291e683895bf09e87bd1cff47a025582d59eda
prestonTao/engine
/package.go
Go
go
3,294
no_license
package engine import ( "bytes" "crypto/rc4" "encoding/binary" "errors" "net" // "fmt" ) // var defaultGetPacket GetPacket = RecvPackage type GetPacket func(cache *[]byte, index *uint32) (packet *Packet, e error) type GetPacketBytes func(msgID, opt, errcode uint32, cryKey []byte, data *[]byte) *[]byte type Pa...
f41581c95912b6d2e388c7991f17993b65bcaf20
f0bd813833982298a07085f85094b7c698d90bec
sangianpatrick/go-graphql-demo
/entity/article.go
Go
go
308
no_license
package entity import ( "time" ) // Article is an entity. type Article struct { ID int64 `json:"id"` Title string `json:"title"` Subtitle string `json:"subtitle"` Content string `json:"content"` CreatedAt time.Time `json:"createdAt"` UserID int64 `json:"userId"` }
01a9dc47d6c4eb9825503f49284ed6780ab2ff0e
452221d87fa04397d663a86ae19c6cf50a107b56
zpz/stats.go
/floats.go
Go
go
4,623
no_license
package stats // out can be x, or a prepared output slice, or nil, // in which case an output slice is created. func FloatShift(x []float64, amnt float64, out []float64) []float64 { out = use_float_slice(out, len(x)) for i, val := range x { out[i] = val + amnt } return out } // out can be x, or a prepared outpu...
7f44e943a8e4bea9d6b006849179d73b6bbbe766
bde28c921eda12fbd00952c17a9887f3082a8258
devopsutils/pipeline
/cmd/pipeline/config.go
Go
go
6,102
permissive
// Copyright © 2019 Banzai Cloud // // 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 ...
7b0d2b4561d94525b0525ada0ec42a9c57a661e5
867bea7da45a9b5e3b4cf4d0a234f8ad3e30153c
martintopholm/junos_exporter
/nat/collector.go
Go
go
92,097
permissive
package nat import ( "github.com/czerwonk/junos_exporter/collector" "github.com/czerwonk/junos_exporter/rpc" "github.com/prometheus/client_golang/prometheus" ) const prefix string = "junos_nat_statistics_" var ( nat64DfbitSetDesc *prometheus.Desc nat64ErrMapDstDesc ...
45721ca87c15ba5e5bbdd65b97c25f58a30e90fc
083e4cf08743bda953dc835f268d20225fc06558
ayushman-singh-gehlot/TicTacToe
/tic_tac_toe_app/components/cell_test.go
Go
go
1,003
no_license
package components import ( "errors" "testing" ) func TestNewCell(t *testing.T) { test := NewCell() expected := NoMark if test.Mark != expected { t.Error(test.Mark, expected) } } func TestSetMark(t *testing.T) { tests := []struct { input1 *Cell input2 string expected error }{ {&Cell{Mark: NoMar...
ea5a381eeafa7dafb9660b2f69fe46216fb008a9
13d1a2dafb097f1af54680fbe79d23b0a0f5cc6d
genius52/leetcode
/src/golang/number/1686. Stone Game VI.go
Go
go
576
no_license
package number import "sort" func StoneGameVI(aliceValues []int, bobValues []int) int { var l int = len(aliceValues) var record [][]int = make([][]int,l) for i := 0;i < l;i++{ record[i] = []int{aliceValues[i],bobValues[i]} } sort.Slice(record, func(i, j int) bool { return (record[i][0] + record[i][1]) > (rec...
ef3e2029cfd474e914e55f2d0e414a412beab8c3
24b3f821e529c04e008c309f63756d1db802f31d
TrafalgarZZZ/arena
/pkg/apis/config/arenaconfig.go
Go
go
5,715
permissive
package config import ( "context" "fmt" "sync" "os" "github.com/kubeflow/arena/pkg/apis/types" config "github.com/kubeflow/arena/pkg/util/config" homedir "github.com/mitchellh/go-homedir" log "github.com/sirupsen/logrus" extclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" metav1 "k...
d67b21bb69df4a8824ce59e51c8bdcb0345a3337
7d45b08519727210dee46093cc7e86462b5e6771
microsoftgraph/msgraph-beta-sdk-go
/mobilitymanagementpolicies/item_included_groups_item_ref_request_builder.go
Go
go
4,789
permissive
package mobilitymanagementpolicies import ( "context" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" ) // Ite...
4034179b19d4e41ffcbada2e99b49f175263631a
7b1036fa857d24ed61f2614a3e7db792919b2862
openark/cockroach
/pkg/sql/logic_not_gc_test.go
Go
go
767
permissive
// Copyright 2016 The Cockroach 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...
3253b4defe0ce0274a9a61e07a66a11fc1fa2481
1c2a7fca61aa2d0a3ad34f6a43e6fd99c147c8f5
Jimmy-Xu/pi
/pkg/pi/cmd/config/delete_context.go
Go
go
2,377
no_license
/* Copyright 2016 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, ...