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
17e1129eb8c874902d653b7653b1f7840678d141
0ba33ad9991c6be37582a310826cead5b3586b4b
kubenext/lissio
/internal/printer/service.go
Go
go
12,864
permissive
/* Copyright (c) 2019 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package printer import ( "context" "fmt" "strings" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" "github.com/kubenext/lissio/pkg/store" ...
ff1bf2f67517a148805734929fc8779594d5e204
6cb278dd59f796113d13898ec7dbcbf846445eee
stillzhl/eventing-rabbitmq
/test/e2e/smoke_test.go
Go
go
2,544
permissive
/* Copyright 2020 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
1bef1bfc193cd0adbbf7c1f5178d2ac1a257a774
4594a95b14cd05f72b00fce8833b89bf042525ea
ashwinsajiv/sysl
/pkg/exporter/swagger_exporter_test.go
Go
go
1,748
permissive
package exporter import ( "flag" "io/ioutil" "os" "strings" "testing" "github.com/anz-bank/sysl/pkg/parse" "github.com/anz-bank/sysl/pkg/syslutil" "github.com/sirupsen/logrus" "github.com/spf13/afero" "github.com/stretchr/testify/require" ) var ( update = flag.Bool("update", false, "Update golden test fil...
bc3ca24b5a1606780fc740b3092c42ee008f529c
58f449591c46adb452b64f90917c5544422bdcbd
quashima/golang-postgres
/infrastructure/db-connection.go
Go
go
773
no_license
package dbconnection import ( "database/sql" "log" "gopkg.in/ini.v1" _ "github.com/lib/pq" ) type ConfigList struct { Driver string User string DbName string SslMode string } var Config ConfigList func init() { cfg, _ := ini.Load("../config.ini") Config = ConfigList{ Driver: cfg.Section("db").Ke...
f417c9440acc06bc576b6d18471f9b58fceb75ff
920dadf582fe3c03596525ced38de51b4a049cb7
alibaba/terraform-provider
/vendor/github.com/google/uuid/uuid.go
Go
go
5,031
permissive
// Copyright 2016 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "bytes" "crypto/rand" "encoding/hex" "errors" "fmt" "io" "strings" ) // A UUID is a 128 bit (16 byte) Universal Unique IDentifier as...
2452f860ccd4bdb19ca435e22c5675be98179821
d05b25997f2738dd01a3617b7b9b4cf47e4d3e15
boldhawk/pulumi-aws
/sdk/go/aws/cognito/userPoolClient.go
Go
go
10,092
permissive
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package cognito import ( "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/go/pulumi" ) // Provides a Cognito User Pool Client resource. // ...
92f775667634bb937e72d167f7ef57255c4a2fa1
fefc9297e394f80651c50fedfddda23f95b304ad
rhd-gitops-example/odo
/vendor/github.com/h2non/gock/mock_test.go
Go
go
2,994
permissive
package gock import ( "net/http" "testing" "github.com/nbio/st" ) func TestNewMock(t *testing.T) { defer after() req := NewRequest() res := NewResponse() mock := NewMock(req, res) st.Expect(t, mock.disabled, false) st.Expect(t, len(mock.matcher.Get()), len(DefaultMatcher.Get())) st.Expect(t, mock.Request...
9f44046d8154043e8d3d3d7980a76f74f5ee4ac5
3bc3985b44efb837b4e83497a1993eb2e345a1c7
uuappli/go-websocket
/main.go
Go
go
1,475
permissive
package main import ( "fmt" "go-websocket/define" "go-websocket/pkg/redis" "go-websocket/routers" "go-websocket/servers" _ "go-websocket/tools/log" "go-websocket/tools/readconfig" "go-websocket/tools/util" "net/http" "os" ) func main() { port := getPort() //初始化配置文件 if err := readconfig.InitConfig(); err...
94521c91408378bc7e1d2791ab7c769a3c0b87aa
9c23d3735f48a8bec4cd5a6e36894c5fd58e4f24
alext234/expipe
/engine/operations.go
Go
go
3,314
permissive
// Copyright 2016 Arsham Shirvani <arshamshirvani@gmail.com>. All rights reserved. // Use of this source code is governed by the Apache 2.0 license // License that can be found in the LICENSE file. package engine import ( "context" "runtime" "time" "github.com/alext234/expipe/tools" "github.com/alext234/expipe...
1ec51ce078429cc6e9d487e7d683f6abdc66e30d
b128ac2a42ae2d481855f4c2304cca38035ad329
haftrine/fluxquest
/internal/transformation/jsoncombiner/json_creator.go
Go
go
449
no_license
package jsoncombiner import ( "encoding/json" "github.com/haftrine/fluxquest/internal/idrf" ) type jsonCreator interface { toJSON(row idrf.Row) ([]byte, error) } type defCreator struct { colsToCombine map[int]string } func (d *defCreator) toJSON(row idrf.Row) ([]byte, error) { data := make(map[string]interfac...
361d6b386a8606f0d0df194f31e51e8b7ff150ec
c9b4b866c5a92e7f75f6cacf7d7c24368ad7a053
lealife/dcrdata
/explorer/syncstatus.go
Go
go
4,622
permissive
package explorer import ( "math" "sync" "time" "github.com/decred/dcrdata/v4/db/dbtypes" ) // SyncStatusInfo defines information for a single progress bar. type SyncStatusInfo struct { // PercentComplete is the percentage of sync complete for a given progress bar. PercentComplete float64 `json:"percentage_comp...
0ae97755736181e3a3e48bcb5283fe87ee2f0b0a
c388acf1a59ad08f92ebcf2947f3fb20d982e481
shenshengkafei/TFRP
/pkg/core/engines/providerengine.go
Go
go
722
no_license
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------ package engines import ( "TFRP/cloudflare" "TFRP/datadog" "TFRP/kubernetes" "TFRP/pkg/core/consts" "github.com/hashicorp/ter...
c26ea1a60f3eaa862348431c0cd71c7345014444
a8ba5df15b98e5374d565a41adb3f50d496ae1f9
devonartis/kubernetes
/test/e2e/cluster_upgrade.go
Go
go
5,311
permissive
/* 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, ...
515ab6d5ebbdfe28e4e0e6091167826c7b6a0902
3b48f68d583bba86175a6fb20fa96451728467e0
bdshadow/kubernetes-client-android
/kubernetes-model/vendor/k8s.io/kubernetes/pkg/proxy/winuserspace/proxysocket.go
Go
go
19,394
permissive
/** * Copyright (C) 2015 Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
7919d13223e7dca08e6bf69f28c70b496b135b70
d5e1da2d7dd63ba35fd84d9f3cea97eb8c0d7f64
micro-community/tutorials
/microservice-in-micro/part3/basic/db/mysql.go
Go
go
749
permissive
package db import ( "database/sql" "time" "github.com/micro-in-cn/tutorials/microservice-in-micro/part3/basic/config" log "github.com/micro/go-micro/v2/logger" ) func initMysql() { var err error // 创建连接 mysqlDB, err = sql.Open("mysql", config.GetMysqlConfig().GetURL()) if err != nil { log.Fatal(err) pan...
c3d28137c984638ab46d6543875b1475a6cd211f
bf8976183f74df23351151acc31ae09510821dbb
vladimirok5959/golang-fave
/engine/workers/basket.go
Go
go
464
permissive
package workers import ( "context" "time" "golang-fave/engine/basket" "github.com/vladimirok5959/golang-worker/worker" ) func BasketCleaner(sb *basket.Basket) *worker.Worker { return worker.New(func(ctx context.Context, w *worker.Worker, o *[]worker.Iface) { select { case <-ctx.Done(): return case <-t...
ac81acaa2cc4c210d9023ec70fc65df8413542e7
3d3452e731b1ae4535144d4fa618051a66b97018
JessonChan/go-start
/view/textfield.go
Go
go
2,028
permissive
package view type TextFieldType int const ( NormalTextField TextFieldType = iota PasswordTextField EmailTextField ) /////////////////////////////////////////////////////////////////////////////// // TextField type TextField struct { ViewBaseWithId Text string Name string Size int MaxLen...
a2b547d2be3cc8f2a06085300f25d6003b518d1b
23ea202cdd4a22623b2a39cdd5c3685ca7fe1d04
darrylwest/spot-cache
/tools/spotachedb.go
Go
go
846
permissive
// // SpotCacheDb - utilities to manipulate the cache database; dump, restore, size, etc // // @author darryl.west <darryl.west@raincitysoftware.com> // @created 2017-04-16 07:58:14 // package main import ( "fmt" "os" "github.com/darrylwest/spot-cache/spotcache" "github.com/syndtr/goleveldb/leveldb" ) func pars...
6e6eac667cb44f35e8df9bac577386651c1358a0
8fcf4d59df4b73116481f0b04a3afc149d7d6516
jbrette/argo
/cmd/argoexec/commands/root.go
Go
go
4,695
permissive
package commands import ( "encoding/json" "fmt" "os" "time" "github.com/argoproj/pkg/cli" kubecli "github.com/argoproj/pkg/kube/cli" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" "k8s.io/client-go/...
b33ef5b7f450cd21de730bc5e4830ff29787632f
4bfe97541cad0ea2db530cf4cff5cd867b4e2786
vdice/workflow-cli
/cmd/auth.go
Go
go
5,895
permissive
package cmd import ( "errors" "fmt" "net/url" "os" "reflect" "strings" "syscall" "github.com/deis/workflow-cli/controller/client" "github.com/deis/workflow-cli/controller/models/auth" "golang.org/x/crypto/ssh/terminal" ) // Register creates a account on a Deis controller. func Register(controller string, u...
ba3c6c13eb1f35554296f278ca605bd05625ed14
e0cfebbd8628a34b4e8e99164cc5e9bc7e50a69c
hinha/krakend
/router/mux/render.go
Go
go
2,913
permissive
// SPDX-License-Identifier: Apache-2.0 package mux import ( "encoding/json" "io" "net/http" "sync" "github.com/luraproject/lura/v2/config" "github.com/luraproject/lura/v2/encoding" "github.com/luraproject/lura/v2/proxy" ) // Render defines the signature of the functions to be use for the final response // en...
732fc9cb1772a09ddd1015e6619541c8e124431b
4c714ace3bd3831c346e8feb50abab09f57f7771
payamb/algorithm
/sorting/bubble_sort.go
Go
go
336
no_license
package sorting // Bubble sort algorithm func BubbleSort(input []int) []int { lastIndex := len(input) - 1 sorted := false for !sorted { sorted = true for i := 0; i < lastIndex; i++ { if input[i] > input[i+1] { sorted = false input[i], input[i+1] = input[i+1], input[i] } } lastIndex -= 1 } ...
c58303a33941758c7213c0b78a003f70c182097c
f2e2e12e31106d117c8103f7e0c31164fc7204a7
bmacnee/apm-agent-go
/module/apmawssdkgo/sns_test.go
Go
go
4,991
permissive
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
22cf2e2701716d478277bbb62185c353c0693862
413c31ae8f6a988c7183fea76158edba19e1ae8d
nerdynick/trafficcontrol
/traffic_ops/client/deliveryservice.go
Go
go
8,427
permissive
/* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed unde...
b8210576ba974d81250d09b2d2a2ee104c4bdeb7
a8f5ddd84775e7c154a56ffc6fcf3e04af9014ec
jwowillo/viztransform
/viz/viz.go
Go
go
2,943
permissive
package viz import ( "image" "image/color" "github.com/jwowillo/viztransform/geometry" "github.com/jwowillo/viztransform/transform" ) const ( width = 500 height = 500 ) func newSetImage() setImage { // TODO: Fill the canvas with white. return image.NewRGBA(image.Rect(0, 0, width, height)) } // Transformat...
c8846376f5752cbcbf3497e98cbfd4ed04eaa889
9b71e8c668a0a1efb671178791a044790c4b2b8d
Comdex/gosl-1
/la/vector.go
Go
go
5,514
permissive
// Copyright 2016 The Gosl 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 la import ( "math" "math/cmplx" ) // Vector defines the vector type for real numbers simply as a slice of float64 type Vector []float64 // NewVec...
104fa9a35c9c1a0d1fa05e919de34ddc2191f94e
a624f138c5729e8b9bf7044e6e2c07ff8d6b4bbe
esys/srmessaging
/internal/messaging/store.go
Go
go
604
no_license
package messaging import ( log "github.com/sirupsen/logrus" "sync" ) type Store struct { users map[string]*User sync.Mutex } func NewStore() *Store { return &Store{users: make(map[string]*User)} } func (s *Store) RegisterUser(user *User) { s.Lock() defer s.Unlock() s.users[user.ID] = user } func (s *Store...
311d4350ba299ec3daeb59efd8f0573393d60443
b2ecb9ce1564571c4f0e4d592bb27e208ab4734e
Andrew161644/laba_aviks
/rest/api/clients/clients_tests/clients_test.go
Go
go
584
no_license
package clients_tests import ( "log" "testing" ) import ( . "github.com/Andrew161644/avicks_laba/api/clients/organization_status_client" ) func TestMakeRequestOrgStatus(t *testing.T) { var uri = "http://localhost:5000/coefficient" var res, err = CallGetOrgStatusInfo(uri, OrgStatusRequestModel{ Name: ...
c99c7d2b23d71c033081f9884fd4a327514a0370
d07b5d493a4766b49777e1417b0fc8ea7c4d743e
multimedial/Hyperledger
/Network/Schoenhofer/go/src/docutracker/workplace/Workplace.go
Go
go
4,154
no_license
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Document tracking system POC for // Schoenhofer Sales and Engineering GmbH, Siegburg // // author: christophe leske, christophe.leske@extern.schoenhofer.de // v: 1.0 (10th of nov 2017) // // Requ...
a5bc746a65760e5d7c28ec67d9ce01ceabe69846
979ff459f2bb426cfbea08dd30cabb1ae548e5da
triplekill/ziti-edge
/edge/controller/predicate/state.go
Go
go
1,506
permissive
/* Copyright 2019 Netfoundry, 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
8f6c4ec8b5cacf1590975565cd1424242340692b
130bfe61cce50fb1188b4272de0ba4110100f8a4
linqiyou/agones
/pkg/apis/stable/v1alpha1/fleet_test.go
Go
go
1,696
permissive
// Copyright 2018 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
850edba301514582536de7c825e0572f43b6f65c
60214eeab2f0eeb554386e8c5ffd913a1e35176f
cormacpayne/Oryx
/src/startupscriptgenerator/src/node/main.go
Go
go
3,661
permissive
// -------------------------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. // -------------------------------------------------------------------------------------------- package main import ( "common...
3139fc7b47f196f56e88de2aa9f4d4c67bef956f
748183151e3bc4bb02c29d283cc966c9e7924ad9
student1304/insolar
/api/requester/requester.go
Go
go
7,181
permissive
// // Copyright 2019 Insolar Technologies GmbH // // 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...
8e3771f2881891f0ce8bf88806f840a57cd2b46c
7855b089659bff192f111c5f6c3e054da6c152b9
authgear/authgear-server
/pkg/lib/authn/identity/loginid/normalizer_test.go
Go
go
3,969
permissive
package loginid import ( "testing" . "github.com/smartystreets/goconvey/convey" "github.com/authgear/authgear-server/pkg/lib/config" ) func TestNormalizers(t *testing.T) { type Case struct { LoginID string NormalizedLoginID string } f := func(c Case, n Normalizer) { result, _ := n.Normalize(c....
c43f1b87f6b0f80c40817b3482ffa4fbf5f384d8
b85b42f11d7d9572b5edbadefc828970c60b27b4
canhtuan97/week2
/application/order/data.go
Go
go
1,554
no_license
package order import ( "context" "encoding/json" "fmt" "github.com/canhtuan97/week2/connector" orderPb "github.com/canhtuan97/week2/protobuff/orderpb" "google.golang.org/grpc/metadata" "log" ) func CreateOrder(ctx context.Context, request *orderPb.CreateOrderRequest) (*orderPb.CreateOrderResponse, error) { fm...
15f8b5e9afa7836c5cf1c22fe6ec2f2d5e8feb7c
de07329c78a6e87cdbb02d0ce4fc47184916ef9d
hadoop835/fabric
/common/tools/idemixgen/metadata/metadata.go
Go
go
538
permissive
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package metadata import ( "fmt" "runtime" ) // Package version const Version = "1.2.1" var CommitSHA string // Program name const ProgramName = "idemixgen" func GetVersionInfo() string { if CommitSHA == "" { CommitSHA = "deve...
5ba9274ba58779a77d405af0d1d9af0c683a171f
97aa5f4cd5eefcd304693dd753ec610ee43deb55
nanomiter/go-zero
/tools/goctl/api/parser/g4/ast/type.go
Go
go
17,469
permissive
package ast import ( "fmt" "sort" "github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/gen/api" "github.com/tal-tech/go-zero/tools/goctl/api/util" ) type ( // TypeExpr describes an expression for TypeAlias and TypeStruct TypeExpr interface { Doc() []Expr Format() error Equal(v interface{}) bool NameE...
5d68ea185e1d6903910dd9b25ef20d1b89ba5173
b8bf28382a8b4a25e96ea60a2d7d95141324bbdc
hazbo/rocket
/rkt/help.go
Go
go
3,321
permissive
// Copyright 2014 CoreOS, 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...
75b12122a90d7051b400d50c341355b232942cdb
a68035107c703408609b306dab05ae6d47be3b50
antholord/poe-livesearch-api
/custom/customParser.go
Go
go
1,416
no_license
package custom import ( "io/ioutil" "github.com/antholord/poeIndexer/itemData" "encoding/json" "log" "gopkg.in/mgo.v2" //"gopkg.in/mgo.v2/bson" ) type Category struct { TopCategory string SubCategory string } type CustomParser struct { BasesMap map[string]Category ItemsMap map[string]bool ModsMap map[strin...
8378425d2e6bd8067adbbe82c4b7fa7b8caca03e
4edb5ceb8974fd40aa9bb9e3c160242a87b99701
dcsg/datadog-event-resource
/cmd/out/main.go
Go
go
3,083
permissive
package main import ( "encoding/json" "os" "strconv" "strings" "time" "io/ioutil" "path/filepath" "github.com/concourse/datadog-event-resource/cmd" "github.com/zorkian/go-datadog-api" ) func main() { artifactDirectory := os.Args[1] // Parse payload var ( err error payload cmd.OutPayload ) e...
f72403c3172912d9bc0d02cd9f12bf17c5eab9ed
c52ea0b8e4a540ea9ffc0f3b1ecf05a76d9131b2
vanadium/core
/x/ref/runtime/internal/test/concurrency/context.go
Go
go
710
permissive
// Copyright 2015 The Vanadium 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 concurrency import ( "sync" ) // context stores the abstract state of resources used in an execution // of a concurrent program. type context s...
1ef2fc4062da91c27bddef960c062254d760ea81
2d0926001389213bf304e71019128ef1c5187083
niwho/hellox
/im/strategy.go
Go
go
2,113
no_license
package im import ( "fmt" // "sync" "time" "github.com/niwho/hellox/logs" "github.com/orcaman/concurrent-map" ) var LonlyClientsIns *LonlyClients type LonlyClients struct { FC cmap.ConcurrentMap // sync.Lock } func PushFC(client *Client) { if LonlyClientsIns == nil { return } LonlyClientsIns.Push(clien...
2a2e3074b3ec043941c74da3208815ab5f5d8c37
6bac0fa5a01590efe94c3b0357d06325362804de
knabben/forwarder
/vendor/k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go
Go
go
19,286
permissive
/* 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, ...
d0dbe4499bd75f951cfc7eb11e35bc8640205173
058d595153bb785149adb9c1281b131df9fe8f43
mokiat/softgfx
/cmd/softgfx-lvlgen/main.go
Go
go
843
permissive
package main import ( "log" "os" cli "github.com/urfave/cli/v2" "github.com/mokiat/softgfx/cmd/softgfx-lvlgen/internal/conversion" ) func main() { app := cli.NewApp() app.Name = "softgfx-lvlgen" app.Usage = "generate levels for softgfx from wavefront obj files" app.UsageText = "softgfx-lvlgen [--in obj_file...
723c59dccc630f3b551418584af0d0a3da0322db
7d77c7cb3a4b4583ed375e11e00e1cb8c7327f9b
JacobTanenbaum/ovn-kubernetes-1
/go-controller/pkg/ovn/address_set/fake_address_set.go
Go
go
12,613
permissive
package addressset import ( "fmt" "github.com/onsi/gomega" "net" "sync" "sync/atomic" "github.com/ovn-org/libovsdb/ovsdb" "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config" "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/libovsdbops" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" ) func NewFak...
e802c6804df9ba79f2e71e82a06ccdc58aeaebe5
c7c6e720d3e8ae5c9989047968c979b604b5f097
SvenHamers/terraform-provider-keycloak
/provider/data_source_keycloak_group.go
Go
go
816
permissive
package provider import ( "github.com/hashicorp/terraform/helper/schema" "github.com/mrparkers/terraform-provider-keycloak/keycloak" ) func dataSourceKeycloakGroup() *schema.Resource { return &schema.Resource{ Read: dataSourceKeycloakGroupRead, Schema: map[string]*schema.Schema{ "realm_id": { Type: ...
89cad0bec36d839bdc14714665f8977edeef7da7
d576d70b91c3c2f4e74ea62f72c05be7b2f29b4e
KeenH/etcd
/etcdmain/config.go
Go
go
19,711
permissive
// Copyright 2015 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...
27ba6a8390426a47238643edeaff76ae0581f30c
74f62a7eab18d039923eaa7ee2ad4cdb85452548
pocke/slot
/slot.go
Go
go
565
permissive
package slot import ( "fmt" "io" "math/rand" "time" ) type Slot struct { symbols []string w io.Writer } func New(syms []string, w io.Writer) *Slot { s := &Slot{ symbols: syms, w: w, } return s } func (s *Slot) Start() int { rand.Seed(time.Now().UnixNano()) sym := 0 for cnt := 1; ; cnt++...
175f54e212bb9dd234a6b63bdbdd176cdbace418
1453fae4fda68267a678e58ccc6f0d30aad34878
namtzigla/argo
/pkg/apis/workflow/v1alpha1/workflow_types.go
Go
go
64,786
permissive
package v1alpha1 import ( "encoding/json" "fmt" "hash/fnv" "reflect" "strings" apiv1 "k8s.io/api/core/v1" policyv1beta "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) // TemplateType is the type of a template type TemplateType string // P...
d9b2f1f0129a35ac5a98845e7e7d9545e576f75f
9ef684cb02dfd04ac514768f78bfeb60793f795a
eyedeekay/Lens
/lens.go
Go
go
6,293
permissive
package lens import ( "bytes" "encoding/json" "errors" "io/ioutil" "net/http" "strings" "github.com/RTradeLtd/Lens/analyzer/images" "github.com/RTradeLtd/Lens/analyzer/text" "github.com/RTradeLtd/Lens/models" "github.com/RTradeLtd/Lens/searcher" "github.com/RTradeLtd/Lens/utils" "github.com/RTradeLtd/Len...
75d9b97955b9c210a0cb1bbaa5394159a478709f
3a4bb82e63de79eefb7dbe3edc8667e412a6f7cc
webchen/fyweb_go
/server.go
Go
go
2,901
no_license
package main import ( "goweb/controller" "goweb/core" "goweb/tool/FyLogger" "log" "net/http" "reflect" "strings" "sync" "time" ) // regList , 注册所有的控制器 var regList = make(map[string]interface{}) // init , 所有的控制器必须手动注册进来,这点和PHP完全不同,PHP可以动态引入,而GO不行 // go 只可反射已经存在的struct,而这个存在,则必须是预先加载好的 func...
ec1c19421ab5ea88270d1d8fdd00953130e4790f
8979af477992458fd6cd946ebdb67824d7901a49
mdumandag/hazelcast-go-client
/internal/logger.go
Go
go
1,650
permissive
// Copyright (c) 2008-2019, Hazelcast, 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 a...
1d9f321835ac7e995913c8fd24c67e4b0b979c47
ed382a08d900555246c5f850b37d128ce895bb74
kubernetes-client/go
/kubernetes/client/v1_user_info.go
Go
go
898
permissive
/* * Kubernetes * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: v1.10.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package client // UserInfo holds the information about the user needed to im...
0d23844703cb30e2cfee1977b77115382925ea1c
9770744eace57bef075ca3e6fe3224bd845905e4
eran-nussbaum/nuclio
/pkg/processor/build/runtime/golang/eventhandlerparser/parse_test.go
Go
go
4,224
permissive
/* Copyright 2017 The Nuclio Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
bd2a2e0755ae3899be9c36454e29dbaf8c20a098
ea5c084a253c3cf28c95cc3ef1ea827c6d3cdd48
julia-yin/AgentBaker
/pkg/aks-engine/api/apiloader.go
Go
go
3,474
permissive
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. package api import ( "encoding/json" "fmt" "io/ioutil" "reflect" "github.com/Azure/agentbaker/pkg/agent/datamodel" "github.com/Azure/agentbaker/pkg/aks-engine/helpers" ) const ( VlabsAPIVersion = "vlabs" def...
c266de468899ae067562e55ba63e3ae83c0c0721
c57c947932ab6e483fd045c395a2b40b9af0f882
NPC-Chain/npcchub
/tests/cli/gov_test.go
Go
go
5,314
no_license
package cli import ( "fmt" "github.com/NPC-Chain/npcchub/app/v1/gov" "github.com/NPC-Chain/npcchub/tests" sdk "github.com/NPC-Chain/npcchub/types" "github.com/stretchr/testify/require" "testing" ) func TestIrisCLISubmitProposal(t *testing.T) { t.Parallel() chainID, servAddr, port, irisHome, iriscliHome, p2pAd...
897554ebb2d825339951f40b86fed13b6db201f1
1a29a69596b80cee32a8d1de378b09c983579d88
xoxo-go/xoxo
/examples/django/mysql/authgroup.xo.go
Go
go
3,338
permissive
// Package mysql contains the types for schema 'django'. package mysql // GENERATED BY XOXO. DO NOT EDIT. import ( "errors" ) // AuthGroup represents a row from 'django.auth_group'. type AuthGroup struct { ID int `json:"id"` // id Name string `json:"name"` // name // xo fields _exists, _deleted bool } ...
01ac46013a0c0d2eec2c2b810d025d3d0b1b700a
d161ae2ae65371a0dcd1886a9715b0666f56a9bd
suneyz/amazon-ecs-agent
/agent/api/task/util_test.go
Go
go
1,557
permissive
// +build unit // Copyright 2014-2018 Amazon.com, Inc. or its affiliates. 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. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or...
ef0a43976152f699ac60af1d277ba1cf9acf0eba
053fdfae19d765e474571c864014cc9691c6e616
kubemq-io/broker
/server/stan/server/clustering.go
Go
go
22,888
permissive
// Copyright 2017-2020 The NATS 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 ...
3e76fbe8c970c6664aa579477dd70081bf5324a5
264b3444a3f4524c4a544d86c0a2310f9e91fbb6
dustintownsend/origin
/Godeps/_workspace/src/github.com/google/cadvisor/validate/validate.go
Go
go
10,284
permissive
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
95f2f9e5df8c9f9e892035a064191c97909b6567
fcbebacd170a35f2e3644ddfba6826812beb9c9f
pinka117/go-example
/repositories/userRepository.go
Go
go
728
no_license
package repositories import ( "github.com/kamva/mgm/v3" "go.mongodb.org/mongo-driver/bson" "example/models" ) type UserRepository struct { } type IUserRepository interface { SearchByMail(mail string) *models.User SaveUser(name, surname, hashedPassword, mail string) error } func (p UserRepository) SearchByMail...
c61248f9780cb29ce8b73daaacc2fff3af9b08ae
7ff42878eafb72e44c02af00ecdc062934a082d4
DrJekyllandMrHyde/dashboard
/template.go
Go
go
5,898
permissive
package dashboard import ( "html/template" ) type templateInfo struct { Projects []*Project } var ( indexTmpl = template.Must(template.New("index.html").Parse(` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta co...
26d05cd11d7c2ee2576a96a104a359b67a59f09d
acd0c1098172fabfcd3890b0e43298dc73cf3425
phanirajl/cassandrabackup
/restore/plan.go
Go
go
3,967
permissive
// Copyright 2019 RetailNext, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
75cc93073caaf9261664668cd07f2d71365321c0
64da1c2ee6029fddb33d5ac525be960056256a4c
iamwy7/validathor
/main.go
Go
go
679
permissive
/* Copyright © 2021 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...
b00a1a67b64c7e2264c252a5cf722e5e37636e35
6edcbfb19f8b7648e583a75af36bb4369d639e7b
MBeliou/go-api-template
/handler/handler.go
Go
go
234
no_license
package handler import ( "github.com/asdine/storm" "golang.org/x/crypto/bcrypt" ) const ( saltCost = bcrypt.DefaultCost JwtKey = "mysecretkey" // Should come from somewhere else ) type ( Handler struct { DB *storm.DB } )
a97ebf9f2695687747c43aa41fb233c19f36f8aa
cfdaa22dfc7a5eceee003adfe897e34ac420b3fb
kormat/eve-overview-tool
/csv.go
Go
go
4,715
permissive
// Copyright 2017 Stephen Shirley // // 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...
c53459bb809b1bb330db6e847f6a09f7e699f508
8a2f08dcb77eb4922b40e8d1829c88251b1db898
ClassroomCode/GoLang
/Labs/21 Testing Basics/solution/spell_test.go
Go
go
2,154
no_license
package spell_test import ( "io/ioutil" "strings" "testing" "github.com/gopherguides/spell" ) func TestAutoCorrect(t *testing.T) { word := "accaptable" got := spell.AutoCorrect(word) exp := "acceptable" if got != exp { t.Errorf("unexpected value for %q. got: %q, exp: %q", word, got, exp) } word = "accid...
cad9f107ebb2307411b0bf0312faf15538e88e5b
4e922baf2af88cddce4a56391c22d739bbf243d1
soedev/soelib
/orm/grom/logger/logger.go
Go
go
5,006
no_license
package logger import ( "context" "fmt" "io/ioutil" "log" "os" "time" "github.com/soedev/soelib/orm/grom/utils" ) // Colors const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36...
299ef8bec2a4ccd4c5a27b79343f7d321d59b6ed
d746796256be0943ed37a98abfa02002943b0194
huangyingting/linkerd2
/pkg/charts/linkerd2/values_test.go
Go
go
8,093
permissive
package linkerd2 import ( "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" "github.com/go-test/deep" "github.com/linkerd/linkerd2/pkg/version" ) func TestNewValues(t *testing.T) { actual, err := NewValues() if err != nil { t.Fatalf("Unexpected error: %v\n", err) } testVersion :...
95b286aa7b3e05721a40668089fce905fd2a2f3d
0d8784b8b95e40782154151973475e38b5f24d6b
aruaru0/golang_myatcoder
/PM9/210604/D/main.go
Go
go
2,471
no_license
package main import ( "bufio" "fmt" "math" "os" "sort" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var wr = bufio.NewWriter(os.Stdout) func out(x ...interface{}) { fmt.Fprintln(wr, x...) } func getI() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } ...
1a1f650b3f2228b39224c7b7bd275470ee4cf29c
26cb6e9668e7a8da1bd70c35f0e4d4afddffb98f
crackcell/memobird-go
/rest_api_test.go
Go
go
947
permissive
/*************************************************************** * * Copyright (c) 2016, Menglong TAN <tanmenglong@gmail.com> * * This program is free software; you can redistribute it * and/or modify it under the terms of the BSD licence * **************************************************************/ /** * ...
e5a2e9c521c1a7cc145863cd91b02071ed1d4532
63ff5437f9ef16c373bbbfddcf3860fb45c86d45
dburkland/netappdvp
/storage_drivers/ontap_nas.go
Go
go
9,715
permissive
// Copyright 2016 NetApp, Inc. All Rights Reserved. package storage_drivers import ( "encoding/json" "fmt" "os/exec" "runtime" "strings" "github.com/netapp/netappdvp/apis/ontap" "github.com/netapp/netappdvp/azgo" "github.com/netapp/netappdvp/utils" log "github.com/Sirupsen/logrus" ) func init() { nas := ...
1a80238d7b00aa1ca7d2c5f57b5e4f8488fa6160
c47af04a89455c7aac0f54a539c272a10c6c32ff
thecodeassassin/tidb-operator
/pkg/manager/member/tikv_upgrader_test.go
Go
go
21,685
permissive
// Copyright 2018 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
1ad1749b2fb7df80b52220df44f894f41972b89c
7d0d5d537092ef687598d5065b0454e8188c221d
winoros/tidb
/meta/autoid/autoid_test.go
Go
go
6,074
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...
00373faf927fd9e34d16a420fd8ae8b0c6a32217
b7e95b404e7934813186de65893000c7f14baa13
lvlzyro/advent-of-code
/2015/day2/day2.go
Go
go
879
permissive
package main import ( "bufio" "fmt" "os" "sort" "strconv" "strings" ) func howMuchPaper(filename string) (int, int) { f, _ := os.Open(filename) defer f.Close() scanner := bufio.NewScanner(f) totalArea, totalRibbon := 0, 0 for scanner.Scan() { line := scanner.Text() spl := strings.Split(line, "x") s...
3d8103d743c576ae172a2f84c296dedf06e0e63d
0107652fc7826c3a2c2baae1d870b4597940d9bb
rohan-prasad/magma
/symphony/pkg/ent-contrib/entgqlgen/internal/todo/ent/hook/hook.go
Go
go
2,519
permissive
// Code generated (@generated) by entc, DO NOT EDIT. package hook import ( "context" "fmt" "github.com/facebookincubator/symphony/pkg/ent-contrib/entgqlgen/internal/todo/ent" ) // The TodoFunc type is an adapter to allow the use of ordinary // function as Todo mutator. type TodoFunc func(context.Context, *ent.To...
7f9e31099aeb135e3a17f645ccb2f278a42e94e6
df0622ba312579da0c18e70b04b9d78148a663b4
reactos/syzkaller
/sys/linux/init_test.go
Go
go
2,823
permissive
// Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. package linux_test import ( "testing" "github.com/google/syzkaller/prog" _ "github.com/google/syzkaller/sys/linux/gen" ) func TestNeutralize(t *testi...
5178e3eba3899d98ed1b8e27c72a9c6b9e0cee79
e6673e87f9edb7ae473ef3feb24396cafe9c65c9
xy02/oaas-go
/nats_private.go
Go
go
874
no_license
package oaas import ( "log" "github.com/golang/protobuf/proto" nats "github.com/nats-io/go-nats" ) var finalCompelete []byte func init() { out, err := proto.Marshal(&Data{ Type: &Data_Final{ Final: "", }, }) if err != nil { log.Fatal(err) } finalCompelete = out } type natsPublisher struct { nc ...
8d0f4d1b35d28c532f00fc186e9b8ff96a306e15
c689efff1c09eb42acb1f9384958f2f8a2e9f319
shohei-ojs/docker_sandbox
/app/main.go
Go
go
217
no_license
package main import ( "app/controller" "github.com/gin-gonic/gin" ) func main() { router := gin.Default() router.GET("/", controller.IndexGet) router.POST("/", controller.UserPost) router.Run(":5000") }
6c469479eaf66772c25dbd868bc7a9e141075035
b7e3765869ffae8b4134df74fc5927e4b764cd44
kovart/seoterminal
/clusternode.go
Go
go
3,833
permissive
// This is a changed clone of Tview Component (primitive) package main import "strings" // ClusterNode represents one node in a tree view. type ClusterNode struct { *Cluster Name string IsExpanded bool Parent *ClusterNode // The Parent node (nil for the root). Neighbors []*ClusterNode level int...
e27f4a2bf0d6d0fa21d97a28b5bac98b860adb4c
cba105a4b7099e532e643a458502fb0b530623e5
yinlingchaoliu/jvmgo
/go/src/main/instructions/loads/xaload.go
Go
go
2,891
no_license
package loads import ( "main/instructions/base" "main/rtda" "main/rtda/heap" ) // Load reference from array type AALOAD struct{ base.NoOperandsInstruction } func (self *AALOAD) Execute(frame *rtda.Frame) { stack := frame.OperandStack() index := stack.PopInt() arrRef := stack.PopRef() checkNotNil(arrRef) ref...
18ac72333adcda1626b1964134201a1ca04243da
4e7d9ead6334c7b3bb34c9b3c5d88979f2677807
kranjcarz/sshclient
/nix-operations.go
Go
go
6,238
permissive
package sshclient import ( "fmt" "github.com/eaciit/errorlib" // "io" // "os" // "log" "strings" ) const ( LIST = "ls -l %v" LIST_PARAM = "ls -l %v | awk '{ print $1,\"||\",$2,\"||\",$3,\"||\",$4,\"||\",$5,\"||\",$6,\"||\",$7,\"||\",$8,\"||\",$9,$10,$11}'" SEARCH = "find %v -name *%v* | xargs...
4fa913218a73a468cf3c8bd60aee0693e73abae3
cb55a9096fc9451f3db6cb75a05963eb3fcb0e35
Shopify/twilio-go
/task_router.go
Go
go
273
permissive
package twilio // WorkspaceService lets you interact with a TaskRouter Workspace. type WorkspaceService struct { Activities *ActivityService Queues *TaskQueueService Workflows *WorkflowService Workers *WorkerService TaskChannels *TaskChannelService }
3f96ce0072cc71abc24a6fd02fb65eca3d6cd22a
ede83a7a434dabdc579acff8268c14070feee568
Unibond7/Go
/Flow Control Statements/loop-ex.go
Go
go
461
no_license
/* Exercise to create a function that implements the square root */ package main import ( "fmt" "math" ) func Sqrt(x float64) (float64, float64) { z := float64(x) diff, y, i := 0.0, 0.0, 0.0 for diff > 1e-10 && diff > -1e-10 { y -= (z*z - x) / (2 * z) diff = (z - y) i++ z = y } return z, i } func mai...
a793c8bc7a55894c05becea4102c6b5b361ee3a1
b5697f99d1aced7f9597967a187fbc1dd19004e9
jeremysolarz/buildpacks
/builders/gae/java11/acceptance/acceptance_test.go
Go
go
4,105
permissive
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
0a23a1e49d141c7e4b5b97916c08bc477d3ceb81
eacf7fcc496d3e6cb8a9010a10d893f629cc7855
analaka/bosh-agent
/settings/service_interface.go
Go
go
473
permissive
package settings import ( boshlog "github.com/cloudfoundry/bosh-agent/logger" boshsys "github.com/cloudfoundry/bosh-agent/system" ) type ServiceProvider interface { NewService( boshsys.FileSystem, string, Fetcher, DefaultNetworkDelegate, boshlog.Logger, ) Service } type Service interface { LoadSetting...
8baafc4cffc24f0def7bcd003ec0ea7ae7ed30b0
8f98156aabf2be2b38fa5ba280b84c1555bfa3b3
lpsantil/cluster-capacity
/vendor/cloud.google.com/go/storage/writer.go
Go
go
4,064
permissive
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
2db84a3a135c36e5f6acb8afb2b30d03a3ba7884
4e23c4261431f4d2d6f1b374a9d9f5a9ce06f4f7
lordbender/golang-presentation-code
/packb/asyncb.go
Go
go
1,162
no_license
package packb import ( "fmt" "golang-presentation-code/core" "sync" "time" ) type rowHelper struct { row []int position int } // SquareMatrixParallel takes a matrix and returns // a matrix of the same size, but with every // index squared. // // bit overflow possible when squaring 32bit integers: be caref...
0d01254c566b12afadf04a1d1938ba0339e61d45
8c58b51c62929b9b9a4b1d93b0c714161823ae72
jojopoper/horizon
/vendor/src/github.com/jteeuwen/go-bindata/config.go
Go
go
6,609
permissive
// This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication // license. Its contents can be found at: // http://creativecommons.org/publicdomain/zero/1.0/ package bindata import ( "fmt" "os" "path/filepath" "regexp" ) // InputConfig defines options on a asset directory to be convert. type...
f7a0f94996bc5cba84e422bb18b9c52bbd1323d6
08fe1ed907351ba1c1f606b9cffbc32d32441c11
kwilczynski/assume-role-arn
/cmd/assume-role-arn/creds_cache.go
Go
go
1,988
no_license
package main import ( "crypto/sha256" "encoding/gob" "fmt" "os" "path/filepath" "time" "github.com/sirupsen/logrus" ) const ( expirationTimeDelta = 60 * time.Minute ) type AWSCreds struct { AccessKeyID string AccessKey string SessionToken string Expiration time.Time } func (a AWSCreds) IsExpired(...
68fde7fddd32d1a21710cdaec73fa373f21a25be
d8e8b6b5ef5b34d3c52210232f41b9eb5dc5ea9a
m-lukas/gonut
/assets/sample-apps-src/binary/main.go
Go
go
388
permissive
package main import ( "fmt" "net/http" "os" "strconv" ) func main() { port := 8080 if strValue, ok := os.LookupEnv("PORT"); ok { if intValue, err := strconv.Atoi(strValue); err == nil { port = intValue } } http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, Hom...
f5897b0fcfc1c7f2af4432d84eae568fe648b12f
6fe6944a38269156605be27821bdd0a71f8cded8
johnbirdau/pulumi-azure-native
/sdk/go/azure/automation/v20190601/runbook.go
Go
go
11,082
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 v20190601 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Definition of the runbook type. type ...
5a8d425fbd802bd487964aaca04c40444a1fd20e
34d16b4affebe716a92065f792c875f20587a22b
mbarnes/osde2e
/vendor/github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1/cluster_authorization_response_type_json.go
Go
go
3,225
permissive
/* Copyright (c) 2020 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
6541aced4aab49090b7c2fd747ea3d6e0a02c2d5
efd15162ba8e6dc290fcfee033bce1a9353006ba
entelecheia7/leetcode-go
/tree/95.go
Go
go
1,725
no_license
package main import ( "github.com/davecgh/go-spew/spew" ) // 95. 不同的二叉搜索树 II // 给定一个整数 n,生成所有由 1 ... n 为节点所组成的 二叉搜索树 。 // 提示: // 0 <= n <= 8 // https://leetcode-cn.com/problems/unique-binary-search-trees-ii/ func main() { // spew.Dump(generateTrees(3)) spew.Dump(generateTrees2(3)) } type TreeNode struct { Val ...
e4274782d3e549ea00aa5d1bd99a688c67251c6e
d30bc065bdf7ea76aaa0f5a2aebb93ca8dda68ed
shogo82148/aws-xray-yasdk-go
/xrayhttp/client.go
Go
go
3,652
permissive
package xrayhttp import ( "context" "io" "net/http" "net/http/httptrace" "strconv" "sync" "github.com/shogo82148/aws-xray-yasdk-go/xray" "github.com/shogo82148/aws-xray-yasdk-go/xray/schema" ) const emptyHostRename = "empty_host_error" // Client creates a shallow copy of the provided http client, // default...
7e9871161bef218aa400eff7f500a6ebf461a601
c83f1560da9e5e574cf8f0a6364586db7e2dc4be
jetmuffin/kruise
/pkg/util/json.go
Go
go
1,222
permissive
/* Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
a377ea569a32525c2577f3d753c5736ba30dbe47
b3bea411d02a0b19c749212845abd8128e8fe04c
RichardLS09/GO-tolearnweb
/monitor/logger.go
Go
go
758
no_license
package monitor import ( syslog "log" ) // 实现一个简单的logger,记录相关信息 // 用户可以通过SetLogger方法重定向log输出 // logger只要实现分级输出方法即可 type logInterface interface { Debug(msg ...interface{}) Info(msg ...interface{}) Error(msg ...interface{}) Warn(msg ...interface{}) } type logger struct{} var log logInterface func init() { log...
c2a36c1d66df728c59686156ac9dc39372ec6dfd
dd4d7527123141ac6d559bdf9644c59f5acb3048
echlebek/sensu-lite
/cli/commands/namespace/delete.go
Go
go
1,136
permissive
package namespace import ( "errors" "fmt" "github.com/echlebek/sensu-lite/cli" "github.com/echlebek/sensu-lite/cli/commands/helpers" "github.com/spf13/cobra" ) // DeleteCommand adds a command that allows user to delete namespaces func DeleteCommand(cli *cli.SensuCli) *cobra.Command { cmd := &cobra.Command{ U...
eb43e7131664343533f95af39e59b1be40211a01
70a0dcad5574434895ed396d21cca07b895bc4ab
CalvinKirs/istio
/pilot/pkg/security/authn/v1beta1/policy_applier.go
Go
go
18,233
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...
108e2c226023c808c43e4a2605c463f75530d513
7f676eec48bf459f9aee1ec2da65b3b18079a5ab
heyHui2018/demo
/config/configWithStruct.go
Go
go
1,343
no_license
package main import ( "github.com/go-ini/ini" "strings" "fmt" "os" ) var ConfigInstance *Config type FtpConfig struct { Host string Port string } type LogConfig struct { Path string Level string } type Config struct { Ftp FtpConfig Log LogConfig } func main() { ConfigInit() fmt.Println("done---------...