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
a655e0206be247d686e4b18ae5360916d5d510ac
611d4e8f9a69d0c89c5b942e5bbe617057627c2f
Sts0mrg0/bee
/pkg/content/content_test.go
Go
go
1,774
permissive
// Copyright 2020 The Swarm 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 content_test import ( "encoding/binary" "testing" "github.com/ethersphere/bee/pkg/content" "github.com/ethersphere/bee/pkg/swarm" ) // TestChu...
164669e3e4f30c99cac4b8c40f620a1fca7accb2
3f02b8727be3697938d2898951e44f1e7792441b
esupeng/doraemon
/cmd/alert-gateway/models/alerts.go
Go
go
21,763
permissive
package models import ( "runtime" "sort" "strconv" "strings" "time" "github.com/astaxie/beego/orm" "github.com/pkg/errors" "github.com/Qihoo360/doraemon/cmd/alert-gateway/common" "github.com/Qihoo360/doraemon/cmd/alert-gateway/logs" ) type Alerts struct { Id int64 `orm:"column(id);auto" ...
30ae3e01d48b0380685c4261aa16f501f09d5e96
97b6df07e748d57d4ff3c7b1458cc0e44f4f2cbe
imranismail/json-patch
/v5/patch.go
Go
go
20,854
no_license
package jsonpatch import ( "bytes" "encoding/json" "fmt" "strconv" "strings" "github.com/pkg/errors" ) const ( eRaw = iota eDoc eAry ) var ( // SupportNegativeIndices decides whether to support non-standard practice of // allowing negative indices to mean indices starting at the end of an array. // Defa...
94e70c22a80f19ed1d3cadc5f2b9e2c4ec97929a
f2e9e6e4175777e6a6a8dfb0185dff9c7372318f
soypat/curso
/main.go
Go
go
891
no_license
package main import ( "log" "github.com/soypat/curso/actions" ) // main is the starting point for your Buffalo application. // You can feel free and add to this `main` method, change // what it does, etc... // All we ask is that, at some point, you make sure to // call `app.Serve()`, unless you don't want to start...
d42dac8f743df52be0831883c9187fda01eec157
a0b33fd9532889359b73d046b4127077dd735289
swordqiu/onecloud
/pkg/compute/models/cloudaccounts.go
Go
go
57,750
permissive
// Copyright 2019 Yunion // // 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...
dce1c937558be7603d4b9d0316d5f241953fd433
d1c0abc5384f19785cd64f7ff9f4037e9527f3b7
takagisou/go_monkey
/monkey/token/token.go
Go
go
444
no_license
wpackage token type TokenType string type Token struct { Type TokenType Literal string } const { ILLEGAL = "ILLEGAL" EOF = "EOF" // 識別子 + リテラル IDENT = "IDENT" // add, foobar, x, y, ... INT = "INT" // 1343456 // 演算子 ASSIGN = "=" PLUS = "+" // デリミタ COMMA = "," SEMICOLON = ";" LPAREN = "(" RPA...
ec3f9b42911ffd0690cbc0e210d90e3dcafb1b5b
480adb88a3fe9fa40478daa242c049d3f0c30b84
Utopiah/podman
/pkg/domain/infra/tunnel/pods.go
Go
go
7,047
permissive
package tunnel import ( "context" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/pkg/bindings/pods" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/util" "github.com/pkg/errors" ) func (ic *ContainerEngine) PodExists(ctx context.Conte...
ce4f6327e4733caf27e552d965e6dbf0afea11a0
8308bee5731229ef7fafaa21c1b7ac50faca3d40
edvinerikson/serving
/pkg/autoscaler/stats_scraper_test.go
Go
go
7,758
permissive
/* Copyright 2019 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...
4bf9efa98d9026b2b97bbd16a79e3cde74b7a392
de69346c1f6db31337c25e65cb8004039327b769
wawandx/basic_golang
/13. pointer/changing_pointer.go
Go
go
433
no_license
package main import ( "fmt" ) func ubah(data *int) { *data = 100 } func ubah2(data int) *int { data = 20 return &data } func main() { var a int = 10 var b *int = &a var c int = 15 ubah(b) datac := ubah2(c) fmt.Println("Alamat Memori variable b adalah", b) fmt.Println("Nilai dari variable b adalah", *b...
9aaaadc755b1f95cfa96f353dc1241aac306fdc3
3d2b3506d378c3380ccabe31e96afdfbb1cea907
nybidari/gvisor
/runsc/boot/limits.go
Go
go
4,985
permissive
// Copyright 2018 The gVisor 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 agree...
4bb75504d67e0a4820f15ac01de0fb287bf858b5
d94220c00ec9b3435b9b1f2febd0b410e92a0ced
ghjan/go-gin-example
/service/tag_service/tag.go
Go
go
3,226
permissive
package tag_service import ( "encoding/json" "io" "strconv" "time" "github.com/360EntSecGroup-Skylar/excelize" "github.com/tealeg/xlsx" "go-gin-example/models" "go-gin-example/pkg/export" "go-gin-example/pkg/file" "go-gin-example/pkg/gredis" "go-gin-example/pkg/logging" "go-gin-example/service/cache_serv...
42430d8bf176c853ff4c3c3ca2219a257662ecc2
d1e6613fce8af1087ea031679c1e15666f6e32f4
chongg039/gof
/web/mvc/controller.go
Go
go
243
no_license
/** * Copyright 2015 @ z3q.net. * name : controller.go * author : jarryliu * date : -- : * description : * history : */ package mvc type Controller interface{} // Generate controller instance type ControllerGenerate func() Controller
67c5d6001a1b71d8e5c0bae4d7733335dcf968e4
101c33312ae4e6ec94f87a863c88388671b3b1c7
JJCinAZ/gami
/event/extension_status_test.go
Go
go
493
permissive
package event import ( "testing" "github.com/jjcinaz/gami" ) func TestExtensionStatus(t *testing.T) { fixture := map[string]string{ "Exten": "Extension", "Context": "Context", "Hint": "Hint", "Status": "Status", } ev := gami.AMIEvent{ ID: "ExtensionStatus", Privilege: []string{"all"}, ...
9ca8ce673b34d542a4a91465fbf71ef8060d0cf2
fbe6de81278aba33aadcd59b82dbc7a41666e9dc
ksurent/carbonapi
/expr/functions/pearson/function.go
Go
go
3,187
permissive
package pearson import ( "context" "fmt" "math" "github.com/bookingcom/carbonapi/expr/helper" "github.com/bookingcom/carbonapi/expr/interfaces" "github.com/bookingcom/carbonapi/expr/types" "github.com/bookingcom/carbonapi/pkg/parser" "github.com/dgryski/go-onlinestats" ) type pearson struct { interfaces.Fun...
38ac2d9b20c718acb54445f87f32507920ee21f9
55e12f7e2edb84d06b501c657a02e10263786124
sbc64/ethdo
/cmd/depositverify.go
Go
go
10,051
permissive
// Copyright © 2019-2021 Weald Technology Limited. // 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 la...
26435b52dcb63d11ffa348b71f0d27bbea542864
644778ffc686a252c22cb55d6d2e9f39b42f9d58
aergoio/aergo
/p2p/metric/peermetric.go
Go
go
1,090
permissive
/* * @file * @copyright defined in aergo/LICENSE.txt */ package metric import ( "sync/atomic" "time" "github.com/aergoio/aergo/p2p/p2pcommon" "github.com/aergoio/aergo/types" ) type PeerMetric struct { mm MetricsManager PeerID types.PeerID seq uint32 Since time.Time totalIn int64 totalOut i...
8880bdbf69b66882cd0ae38c62ae90f8159842c6
8e4e9cc6409c637aa8d546d139dac19d928b9703
husio/wasmd
/x/wasm/client/rest/gov.go
Go
go
8,160
permissive
package rest import ( "encoding/json" "net/http" "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" ...
66e176efb809ec36f71d5a482f356f223302f18b
dfbb3f3a1117a1cb9a3595b2ba19794465b0d329
lee501/go_travel
/src/exercise-fib-closure.go
Go
go
212
no_license
package main import "fmt" func fib() func() int { a, b := -1, 1 return func() int { a, b = b, a+b return b } } func main() { f := fib() for i := 0; i < 10; i++{ fmt.Println(f()) } }
7e93a71aef13a8f040dc0d9dd8ca168f038ad974
4e42383946fc19c1f4371cc083d3537d7d119b01
winoros/tidb
/statistics/update_test.go
Go
go
28,385
permissive
// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
7e4f68fb4b918dd84614caac1b8f55c59d4416ac
de30f890fa71403f6bb9e7cdde525a7b5b04c3a5
smartlon/gateway
/adapter/ports/adaptor_fabric.go
Go
go
4,304
no_license
package ports import ( "encoding/json" "fmt" "github.com/hyperledger/fabric-sdk-go/pkg/client/event" "github.com/pkg/errors" "github.com/smartlon/gateway/adapter/ports/fabric/sdk" "github.com/smartlon/gateway/log" "github.com/smartlon/gateway/types" ) func init() { builder := func(config AdapterConfig) (Adapt...
300a2f0f154f38e2342dba59444b2312cf4753cb
7f56a35f42a07e31ac82b98cf6a1fbcd4dbd26c0
blanham/pgmgr
/pgmgr/pgmgr.go
Go
go
10,755
permissive
package pgmgr import ( "bytes" "database/sql" "errors" "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "regexp" "strconv" "strings" "time" "github.com/lib/pq" ) // Migration directions const ( DOWN = iota UP ) const datetimeFormat = "20060102130405" // Migration directions used for error message bu...
4c9f5954d8bb9733a82486485a197acef0d64f59
56caf133369cbb6ddd75ec5c39bdb72b1f766417
quoclm/kubernetes
/plugin/pkg/admission/deny/admission_test.go
Go
go
913
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 law or agreed to in ...
41f92df49af3db71534d9f26ec83865218680fe6
797eb0a4306b62c7bfb76d1ac8ae869b84661369
andrewjdawson2016/cadence
/common/mocks/PublicClient.go
Go
go
29,559
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...
dcf47eb34c8896af4590dff4fe048a7604010473
bc3f42ccf8f31ae6346d73f72b2ed53c636f4eb8
narrowizard/nirvana
/service/rpc/builder_test.go
Go
go
9,378
permissive
/* Copyright 2017 Caicloud 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, softwar...
5c92a2bc8564da5ba50cb13088be37def6a35e6a
bc804409c249a4cb8afee3099744b1b2991babda
alena1108/rancher
/pkg/catalog/manager/traverse.go
Go
go
4,246
permissive
package manager import ( "fmt" "strings" "github.com/rancher/rancher/pkg/catalog/helm" "github.com/rancher/types/apis/management.cattle.io/v3" "github.com/sirupsen/logrus" "gopkg.in/yaml.v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func traverseFiles(repoPath string, catalog *v3.Catalog) ([]v3.Template...
c0ad66b804555231648ac7b7cc8c767ccee949cc
cac76fc82029d517e64aa1d31325305da2ef4430
yangchangshun/ephemerald
/adapter.go
Go
go
4,991
permissive
package ephemerald import ( "context" "io" "io/ioutil" "strconv" "github.com/Sirupsen/logrus" "github.com/boz/ephemerald/config" "github.com/boz/ephemerald/params" "github.com/docker/distribution/reference" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/dock...
710ef85c1f395df7e92a6e23748ec2c6cb3e5e74
f52b81303a44c04f2ad0c05fe4754ed3e6f95e12
benzcash/lightwalletd
/common/cache_test.go
Go
go
6,376
permissive
package common import ( "encoding/hex" "encoding/json" "io/ioutil" "testing" "github.com/zcash-hackworks/lightwalletd/parser" "github.com/zcash-hackworks/lightwalletd/walletrpc" ) func TestCache(t *testing.T) { type compactTest struct { BlockHeight int `json:"block"` BlockHash string `json:"hash"` ...
0ffbb85f8bbd8b384c809eafeb1a117fd736b53c
ca6c245a3231b3e604670503827b49483daa13e4
ml-lab/dfcpub
/dfc/metasync.go
Go
go
10,721
permissive
// Package dfc is a scalable object-storage based caching system with Amazon and Google Cloud backends. /* * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. * */ package dfc import ( "encoding/json" "fmt" "net/http" "time" "github.com/NVIDIA/dfcpub/3rdparty/glog" ) // enumerated REVS types (opaq...
b4613f8ec224fc350943a2a9c140461f5bc348ef
91d87b6a3695d9a35b8e161f52d70aef6b623eb4
Lxy417165709/myGo
/梳理/刷题相关/Draft_Code/LeetCode/LeetCode_1024_视频拼接.go
Go
go
1,377
no_license
package main import ( "fmt" "sort" ) type arr [][]int func (a arr)Len() int{ return len(a) } func (a arr)Less(i,j int) bool{ if a[i][0]==a[j][0] { return a[i][1]>a[j][1] }else{ return a[i][0]<a[j][0] } } func (a arr)Swap(i,j int) { a[i],a[j] = a[j],a[i] } func videoStitching(clips [][]int, T int) int {...
006ee127e6a3fc877ecb8fb24ee2c906390ab705
74109d9a3a26eadf7eb4605e54f4e0d2d67ec598
blastbao/gopsutil
/host/host_solaris.go
Go
go
5,971
permissive
package host import ( "bufio" "bytes" "context" "fmt" "io/ioutil" "os" "os/exec" "regexp" "runtime" "strconv" "strings" "time" "github.com/blastbao/gopsutil/internal/common" ) func Info() (*InfoStat, error) { return InfoWithContext(context.Background()) } func InfoWithContext(ctx context.Context) (*In...
579154bbe3185a2215ea1aa311d9dd6bcf4a113a
092784145ea803bdc233a476d1ead237ce7410fb
ffcactus/promise.go
/enclosure/object/model/ApplianceSlot.go
Go
go
544
no_license
package model // ApplianceSlot represents the appliance slot info. type ApplianceSlot struct { ApplianceSlotCommon } // ApplianceSlotCommon holds the common properties for model, dto and entity. type ApplianceSlotCommon struct { Index int `gorm:"column:Index"` Inserted bool `gorm:"column:Inse...
168fecadc00c535d4062e8de39108e8b1f015894
eac3bf43dc386241400ad5045d49b1b3e8913331
lichongsw/algorithm
/binary_search.go
Go
go
1,265
permissive
package main import ( "fmt" ) func binarySearch(arr []int, val int) int { first := 0 last := len(arr) - 1 for first <= last { mid := first + (last-first)>>1 switch { case arr[mid] == val: return mid case arr[mid] < val: first = mid + 1 case arr[mid] > val: last = mid - 1 } } // not exist ...
0f6cae3d779b8cc7f09610625e4e541ab22d18b9
349963bd77fcfe7a3fbedc5c8c841519a5c40a98
openshift/cloud-credential-operator
/vendor/github.com/microsoftgraph/msgraph-sdk-go/devicemanagement/notification_message_templates_notification_message_template_item_request_builder.go
Go
go
13,453
permissive
package devicemanagement import ( "context" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242 "github.com/microsoftgraph/msgraph-sdk-go/models" ia572726a95efa92ddd544552cd95065...
c33988250a4eedd66bce90c9f7ad57750fffda6d
fbbba96caff92e17d2f8766d7d72d3bacb509474
jmervine/readable
/examples/basic/basic.go
Go
go
1,025
permissive
package main import ( // "gopkg.in/jmervine/readable.v1" "../.." ) func main() { readable.Log("type", "default", "fn", "Log") // 2015/08/23 19:17:38 type=default fn=Log readable.SetFlags(0) readable.Log("type", "without data stamp", "fn", "Log") // type=without data stamp fn=Log readable.SetFormatter(readab...
afe1bd949d65547083fb5420623796e114a71672
0588ce8d271359b72be6fd39aea184ff35e7e19f
go-magma/magma
/modules/feg/gateway/services/eap/providers/sim/provider/linked_client_api.go
Go
go
2,239
permissive
// +build !stand_alone_eap_service /* Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ...
48a111ce4db51ad51bf8f85a2388fcebbe467be6
de1699f078c0a2dd3944b47f45e3aaeace74d979
m1zzx2/influxdb
/mock/session_service.go
Go
go
2,068
permissive
package mock import ( "context" "fmt" "time" platform "github.com/influxdata/influxdb/v2" ) // SessionService is a mock implementation of a retention.SessionService, which // also makes it a suitable mock to use wherever an platform.SessionService is required. type SessionService struct { FindSessionFn func(c...
c0c0b803e31a10933929b1db93cef4b8d020fd1d
95301692cc9904d94b82f127f8b228c7c3655a29
edmooneyvtx/anthology
/vendor/github.com/onsi/gomega/matchers/succeed_matcher_test.go
Go
go
1,707
permissive
package matchers_test import ( "errors" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/matchers" ) func Erroring() error { return errors.New("bam") } func NotErroring() error { return nil } type AnyType struct{} func Invalid() *AnyType { return nil } ...
65ae826fc836a50d4e1f6505297dc4ea4c69b58e
85071f1531deffc2b37028f10c368f10e05e2ce5
Alaedeen/360VideoEditorAPI
/router/videoRouter.go
Go
go
1,483
no_license
package router import ( "github.com/Alaedeen/360VideoEditorAPI/helpers" "github.com/gorilla/mux" handlers "github.com/Alaedeen/360VideoEditorAPI/handlers" ) // VideoRouterHandler ... type VideoRouterHandler struct { Router *mux.Router Handler handlers.VideoHandler } // HandleFunctions ... func (r *VideoRouterHan...
6310b8dbe93e9dd4148275434b3e3cc1b6217bd8
839a12c5a44f25993cb09c66314519212d769b81
s-matyukevich/cilium
/pkg/hubble/relay/observer/observer.go
Go
go
5,802
permissive
// Copyright 2020 Authors of Cilium // // 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 ...
1f434b2086862c504c9b2f2adb1d7125b5cbc593
12ad98a98086e4622a54f8011d9dbdd83e800e67
stevenferrer/kalupi
/transaction/service.go
Go
go
10,001
permissive
package transaction import ( "context" "fmt" validation "github.com/go-ozzo/ozzo-validation/v4" gonanoid "github.com/matoous/go-nanoid/v2" "github.com/pkg/errors" "github.com/shopspring/decimal" "go.uber.org/multierr" "github.com/stevenferrer/kalupi/account" "github.com/stevenferrer/kalupi/balance" "github...
5a13d85b63e1ce63bf5400f59bfca25a6d202a2f
9fefa54987948975d7837cea392c3df05ad3a900
whoisjeremylam/enu
/addressHandlers.go
Go
go
409
no_license
package main import ( "net/http" "github.com/whoisjeremylam/enu/consts" "github.com/whoisjeremylam/enu/enulib" "github.com/whoisjeremylam/enu/internal/golang.org/x/net/context" ) func AddressCreate(c context.Context, w http.ResponseWriter, r *http.Request) *enulib.AppError { // Add to the context the RequestTyp...
68b46e5379295d37749096eea4911f6ef36a2b72
52c6176a51d22e372de9d214a709da2f2103dfce
woshizhangyue/fabric
/internal/peer/common/common.go
Go
go
12,574
permissive
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package common import ( "context" "crypto/tls" "fmt" "io/ioutil" "os" "strconv" "strings" "time" "github.com/golang/protobuf/proto" pcommon "github.com/hyperledger/fabric-protos-go/common" pb "github.com/hyperledger/fabric...
e9a112cbb8a9629bf9b1b5ce87eb1e0b57008df7
cab536243878af0a23bafccbfdb2dbd5fc09064f
P79N6A/flamingo
/vendor/code.byted.org/hystrix/hystrix-go/hystrix/circuit.go
Go
go
8,413
permissive
package hystrix import ( "fmt" "log" "sync" "sync/atomic" "time" "code.byted.org/gopkg/alarm" ) // CircuitBreakerInterface is the interface of circuit breaker type CircuitBreakerInterface interface { // Name returns circuit name Name() string // AllowRequest returns true if circuit allow request AllowReque...
c7fdefc5f54500dd606831ee235906aef1a74f8d
7277b794439d819a7bacbce9074815361605c620
paultyng/google-cloud-go
/bigquery/integration_test.go
Go
go
40,169
permissive
// Copyright 2015 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...
804dfd0982f096770f59bdf8704075e47f51d899
2d5dbd1685511e9d28c807cd547b63a2ebc38a9a
cloudfoundry/cli
/cf/commands/user/delete_user.go
Go
go
2,630
permissive
package user import ( "fmt" "code.cloudfoundry.org/cli/cf/api" "code.cloudfoundry.org/cli/cf/commandregistry" "code.cloudfoundry.org/cli/cf/configuration/coreconfig" "code.cloudfoundry.org/cli/cf/errors" "code.cloudfoundry.org/cli/cf/flags" . "code.cloudfoundry.org/cli/cf/i18n" "code.cloudfoundry.org/cli/cf/r...
3d5c2964f1cf46ece03fbeff7fd68fc25ea89b22
c90f8f699bf440c7ccd87734f4b2f3338310393e
johnharris85/trek
/internal/trek/pods.go
Go
go
731
permissive
package trek import ( "fmt" "strings" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) // GetPodInfo ... func GetPodInfo(c kubernetes.Interface, ns, name string) (*corev1.Pod, error) { pod, _ := c.CoreV1().Pods(ns).Get(name, metav1.GetOptions{}) return ...
ff7899d8dc5cb43d3b9c0ff5fb476291f19866c5
6adcc1fac68ae69b9ec876a60dde3d5526710946
baifjece/grpc-go
/profiling/profiling.go
Go
go
1,283
permissive
/* * * Copyright 2019 gRPC 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 agree...
03ecd81690322514795f514444ce47ed940d6f78
e14d44561e70d6f298744b3c23d344c5a18a2c58
uzimith/goa-learn
/main-mock.go
Go
go
743
no_license
// +build mock //go:generate goagen bootstrap -d github.com/uzimith/goa-learn/design package main import ( "github.com/goadesign/goa" "github.com/goadesign/goa/middleware" "github.com/uzimith/goa-learn/app" "github.com/uzimith/goa-learn/mock" ) func main() { // Create service service := goa.New("goa.learn") ...
5a7ec36b2de4f1cebc380a9724f24a34962286e9
a35b3bb1f21f33cae1aa797ae63b0300f57dc85d
chenlei65368/algorithm004-05
/Week 1/id_005/LeetCode-142-005.go
Go
go
1,108
permissive
/** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func detectCycle(head *ListNode) *ListNode { if head == nil || head.Next == nil { return nil } slow, fast := head.Next, head.Next.Next for fast != nil && fast.Next != nil && slow !=...
c2a0418003ec1efb81059eb419f01469c8dedc48
6db7ac88cde2fa4cb96adbb1319919a72c55f1d6
jonathanbs9/bankingApp
/domain/customerRepositoryDb.go
Go
go
1,863
no_license
package domain import ( "database/sql" _ "github.com/go-sql-driver/mysql" "github.com/jmoiron/sqlx" "github.com/jonathanbs9/bankingApp/errs" "github.com/jonathanbs9/bankingApp/logger" ) type CustomerRepositoryDb struct { client *sqlx.DB } func (d CustomerRepositoryDb) FindAll(status string) ([]Customer, *errs....
7fbc92232ebcb476c2b0a0b9840d1d16b95b139e
92cfb5fe95a1cc67ec5f56349b8d910456573171
thanks173/proctify
/process_linux.go
Go
go
2,878
no_license
// +build linux package proctify import ( "errors" "fmt" "io" "io/ioutil" "os" "regexp" "strconv" "strings" "syscall" "time" ) // linuxProcess is an implementation of Process from Linux type linuxProcess struct { pid int ppid int state rune executable string cmd string path string ...
729f72c05e84e2cbca4fe09f043a10f35e5e3abe
aa1e8b1e3c791249f3b1ef55a07eff53bd32c870
IMissSoMuch/RaftGo
/LAB1-MapReduce/src/mapreduce/common_map.go
Go
go
2,753
no_license
package mapreduce import ( "hash/fnv" "os" "encoding/json" ) // doMap does the job of a map worker: it reads one of the input files // (inFile), calls the user-defined map function (mapF) for that file's // contents, and partitions the output into nReduce intermediate files. func doMap( jobName string, // the nam...
5c4b600bf0342e43f86535aa8e905810b939d64d
cdc9b7fce4c10fea36a545938921cbc9241a0f5c
liuhuanqiang/chatengine
/messenger/biz_server/biz/core/account/notify_setting.go
Go
go
2,641
permissive
// Copyright (c) 2018-present, NebulaChat Studio (https://nebula.chat). // 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/LI...
6e7149fceaa6a84debaea260e6655b0f0d2eb264
6d6c81b3a115289e1596623a9fb112e5fa46ada8
ActiveState/cli
/internal/constants/preprocess/preprocess_test.go
Go
go
211
permissive
package preprocess import ( "testing" "github.com/stretchr/testify/assert" ) func TestConstants(t *testing.T) { for k, v := range Constants { assert.NotEmpty(t, v(), "Value for "+k+" is generated") } }
789c4464270893bad816eb15b4fe6dfadfa861fc
e3f4d466b1541d4c4fdd62f699ec495afa52cc76
kzmake/dapr-clock
/microservices/second-hand/infrastructure/statestore/hand.go
Go
go
1,283
permissive
package statestore import ( "context" "fmt" "strconv" "github.com/dapr/go-sdk/client" dapr "github.com/dapr/go-sdk/client" "github.com/kzmake/dapr-clock/microservices/second-hand/domain/aggregate" "github.com/kzmake/dapr-clock/microservices/second-hand/domain/repository" "github.com/kzmake/dapr-clock/microse...
0c5fe7a3057d9ff994bcb99ecfec2bfe032b98e4
b10eaf24fea430d202b83fcc94954e7b1917478d
roberthbailey/open-match
/examples/functions/golang/soloduel/main.go
Go
go
1,405
permissive
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
ec0ed1afd2bf093d17877cb808a5bc82408f7888
9d3b1e8c473372bf37f52e8e8dfc1b7b18be3259
goharbor/harbor-operator
/controllers/goharbor/jobservice/configs.go
Go
go
1,252
permissive
package jobservice import ( "context" "crypto/sha256" "fmt" goharborv1 "github.com/goharbor/harbor-operator/apis/goharbor.io/v1beta1" conftemplate "github.com/goharbor/harbor-operator/pkg/config/template" "github.com/goharbor/harbor-operator/pkg/resources/checksum" "github.com/pkg/errors" corev1 "k8s.io/api/c...
af5cd9294763a6214c2b3af0fb49b9ec4aed07b6
1e1be22befee388bd3e623e94f6fedce5f121237
rchamorro/pulumi-azure-nextgen
/sdk/go/azure/apimanagement/v20200601preview/getGroup.go
Go
go
1,665
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 v20200601preview import ( "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.Invok...
faa204986a0c9389100489b5f9e6074f1ec24c5a
f7c7c6eef049f190c226c533a6b5116cc462e394
joeylichang/minio
/cmd/peer-rest-client.go
Go
go
24,441
permissive
/* * MinIO Cloud Storage, (C) 2019 MinIO, 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 la...
69aaae8d3c58f9f46b2d698dfdefc5b3f9963a22
950ab9c7442f6c305089c25a82d8200c99ba5303
microsoftgraph/msgraph-beta-sdk-go
/models/document_comment.go
Go
go
4,280
permissive
package models import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) // DocumentComment type DocumentComment struct { Entity } // NewDocumentComment instantiates a new documentComment and sets the default values. func NewDocume...
6c1c57e369623653fd5e928fae12087e9888e710
e62e37bd38ca03f596b192d8ca3835de6174ba4b
Gessiux/go-events
/events.go
Go
go
4,893
permissive
/* Pub-Sub in go with event caching */ package events import ( "sync" . "github.com/Gessiux/go-common" ) // Generic event data can be typed and registered with tendermint/go-wire // via concrete implementation of this interface type EventData interface { //AssertIsEventData() } // reactors and other modules shou...
39d48dd045e0d1a6351f040342345cee0bc40188
3f6b17528a8d4c6561cca16be46600fc2a750eb8
bmurithi/magma
/feg/gateway/registry/cloud_registry.go
Go
go
3,121
permissive
/* Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ package registry import ( "fmt" "time" "magma/orc8r/cloud/go/service/config" "golang.org/x/net/context" "goo...
e81801787a87d29eb1c9e93a2ea880f5ed16308b
23aa3c4822eaa0995773a170263762924b7d554e
superf0sh/terrascan
/pkg/cli/scan.go
Go
go
3,281
permissive
/* Copyright (C) 2020 Accurics, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
6a9286a13eb1a5921b5216301d8a19d13ebcb255
69a33d6400fbe25f42bb5acaab62090960477ea2
flowerwedding/reCaChe
/tour_cache.go
Go
go
2,918
no_license
/** * @Title tour_cache * @description 提供给用户端使用的接口,二次封装 * @Author 沈来 * @Update 2020/8/17 18:04 **/ package reCaChe import ( "log" "reCaChe/cachepb" "reCaChe/singleflight" "sync" ) type Getter interface{ Get(key string) interface{} } type GetFunc func(key string) interface{} //实现Getter接口的Get方法 func (f ...
401176010eb78e19e3fffbe3e71bd1eef8f237ee
6f3005428472017244545f7056a1603288d7e747
sapcc/kubernetes-operators
/openstack-seeder/vendor/k8s.io/kubernetes/pkg/kubelet/remote/doc.go
Go
go
705
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, ...
10c6e78f8cb09eb26e72483f4b5fb9aa06cf8dba
26f35a9af6c2b0b816b2f3510c83c665a7fe2504
jjcanci/golang-secure-rest-api
/app/errors.go
Go
go
405
no_license
package app import ( "net/http" u "github.com/jjcanci/golang-secure-rest-api/utils" ) // NotFoundHandler NotFoundHandler var NotFoundHandler = func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) u.Respond(w, u.Messag...
e4cc4518dee52e5ad3cfa5969962ad2622708893
8efc14395128930b3e72ec405e289a7019479daf
henrypfhu/agento
/plugins/agents/entropy/entropy.go
Go
go
1,119
no_license
package entropy import ( "path/filepath" "strconv" "strings" "github.com/influxdata/influxdb/client/v2" "github.com/abrander/agento/configuration" "github.com/abrander/agento/plugins" ) func init() { plugins.Register("entropy", NewEntropy) } type Entropy int func NewEntropy() plugins.Plugin { return new(E...
9f578b42c62894ec5752437dcf61e068f6672be4
9b53e9e39dc3b2ccf0e41f84234368fe01b8265b
BoynChan/GoLanguage
/src/main/goblog/strings.go
Go
go
1,423
no_license
package main import ( "bytes" "encoding/base64" "fmt" "strings" "unicode/utf8" ) func main() { //读取字符长度 fmt.Println(len("忍者")) //读取utf8字符长度 fmt.Println(utf8.RuneCountInString("忍者")) words := "网站:boyn.top" //按字符遍历字符串 for i := 0; i < len(words); i++ { fmt.Printf("%c %d ", words[i], words[i]) } fmt.Pr...
1014fb7d93614e4a6c86862862220409aa11bb43
eeca56e4d9cda3c270f1013338f4a00a340221ba
bastienbc/work-board
/work_board.go
Go
go
1,939
permissive
package worker import ( "sync" ) //SimpleWork is here to be able to use a function as a Work type SimpleWork func() //Run simply call the function func (w SimpleWork) Run() { w() } //Work is the interface that describes a Work. //It only needs one method type Work interface { Run() } //WorkBoard is a board with...
9ab3164c2777c686bdce21a7e3221688f9443663
190498aba16a1fb006090312f805239c1fa70ca8
springernature/halfpipe-cf-plugin
/push/push.go
Go
go
2,385
no_license
package push import ( "strconv" "strings" "github.com/springernature/halfpipe-cf-plugin" "github.com/springernature/halfpipe-cf-plugin/command" . "github.com/springernature/halfpipe-cf-plugin/helpers" "github.com/springernature/halfpipe-cf-plugin/manifest" "github.com/springernature/halfpipe-cf-plugin/plan" ) ...
7ae1d8bf444cb79ed10d1c307f89961061ba49b7
abb320638acb28a8ed9925baea2944a5903da405
cc13ny/cayley
/graph/gaedatastore/quadstore.go
Go
go
14,544
permissive
// Copyright 2014 The Cayley Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
5d278c0a10309fd7a4c96d9dfde5af6a5d4bc658
b7d8abe1b69a1a1ddbb7dce6b06afb889c74e8d5
CarlosPepin/Kata-3-RGB-to-Hexadecimal-Color-Code-Converter
/mainProgram.go
Go
go
524
no_license
package main import ( "fmt" "strconv" ) type RGB struct { red, green, blue int64 } type HEX struct { str string } //Funcion de prueba func Sum(x int, y int) int { return x + y } func t2x(t int64) string { result := strconv.FormatInt(t, 16) if len(result) == 1 { result = "0" + result } return result } f...
b361daf1db2261696902922b6c1f497a92a2e151
338ef96961774fa126a1f3f5817e11a5e19708f4
deiscc/workflow-manager
/pkg/swagger/client/operations/publish_doctor_info_responses.go
Go
go
2,695
permissive
package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io" "github.com/go-swagger/go-swagger/client" "github.com/go-swagger/go-swagger/httpkit" strfmt "github.com/go-swagger/go-swagger/strfmt" "gi...
6b51f716d5c238c9da90e5f561e00bf926c6205e
3831894a88f641f459b262beaad9eb2f23bbc384
pombreda/st
/linking/semanticizer_test.go
Go
go
2,048
permissive
package linking import ( "encoding/json" "github.com/semanticize/st/hash" "github.com/semanticize/st/hash/countmin" "github.com/semanticize/st/storage" "reflect" "testing" ) var sem = makeSemanticizer() func TestBestPath(t *testing.T) { sem.BestPath(" ") // should not crash } func makeSemanticizer() Semant...
02f3b41fb7ac9f347d09e79e1ac16e639cf391b8
e622c21c3aacc7e935db4f8678fd3845b622fcf8
divinerapier/learn-kubernetes
/pkg/registry/registrytest/validate.go
Go
go
2,898
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, ...
e29053a58f2a26e1ec9455fb37d4925a493a4446
f3c0ca1bd8e8d0bf0d52489caa772ea159237195
bobintornado/gocql
/connectionpool.go
Go
go
13,154
permissive
// Copyright (c) 2012 The gocql 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 gocql import ( "crypto/tls" "crypto/x509" "errors" "fmt" "io/ioutil" "log" "math/rand" "net" "sync" "time" ) // interface to implemen...
5d5942577b0cd5f897e93465d824490b626dccf7
b71d75dfcffc509cc960028ae68ed131c3383abf
jmigpin/editor
/core/internalcmds/lsprotoreferences.go
Go
go
1,224
permissive
package internalcmds import ( "context" "fmt" "io" "path/filepath" "github.com/jmigpin/editor/core" "github.com/jmigpin/editor/core/lsproto" "github.com/jmigpin/editor/util/iout/iorw" ) func LSProtoReferences(args0 *core.InternalCmdArgs) error { ed := args0.Ed erow := args0.ERow if !erow.Info.IsFileButNot...
e322610146e5d94def44e3a2ff9af33af1981637
bdd1d30740fd7723cc15099926dcabea7f4367ae
champon1020/gsorm
/rows_parser_test.go
Go
go
4,891
permissive
package gsorm_test import ( "reflect" "testing" "github.com/champon1020/gsorm" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" ) func TestRowsParser_ParseMapSlice(t *testing.T) { model := []map[string]interface{}{} expected := []map[string]interface{}{ {"emp_no": 1001, "first_name": "Tar...
4c5d952b4649711079e5ab8347ea1f4d1f1a2f02
eab2b9247ada232d8b06c3a434ebd28d4842dd45
Mattlk13/oci-go-sdk
/dataintegration/oracle_read_attribute.go
Go
go
1,217
permissive
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
eb22350000a309f35317c89ae9e772394f2c96cd
620cacf3e5d1b2579a5449dd49c14a508b4b3f13
jasonwcc/machine-config-operator
/vendor/github.com/golangci/go-tools/stylecheck/lint.go
Go
go
16,670
permissive
package stylecheck // import "github.com/golangci/go-tools/stylecheck" import ( "fmt" "go/ast" "go/constant" "go/token" "go/types" "strconv" "strings" "unicode" "unicode/utf8" "github.com/golangci/go-tools/lint" . "github.com/golangci/go-tools/lint/lintdsl" "github.com/golangci/go-tools/ssa" "golang.org...
740d710a93b67af9c3956241d2a0f6cc3d781973
0eb022b37454237346c27d257fb840672fdb46db
stlyz3/ion
/pkg/signal/init.go
Go
go
1,344
permissive
package signal import ( "encoding/json" "fmt" "sync" "time" "github.com/cloudwebrtc/go-protoo/peer" log "github.com/pion/ion-log" "github.com/pion/ion/pkg/proto" ) type AcceptFunc peer.AcceptFunc type RejectFunc peer.RejectFunc type RespondFunc peer.RespondFunc type BizEntry func(method string, peer *Peer, ms...
1f5b1eede7e404edb0ab1cff958a9d2a6f48a5df
48a14b4855c4fa1b37aca6a61d60214507f3727b
yunionio/ocadm
/pkg/cmd/baremetal.go
Go
go
3,866
no_license
package cmd import ( "io" "os" "github.com/pkg/errors" "github.com/spf13/cobra" flag "github.com/spf13/pflag" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/klog" "k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow" kubeadmutil "k8s.io/kubernetes/cmd/kubead...
2345b9f7072061608397185fa76f7efa9adcabb5
9e5eba4013a570a831036792d00f5f0e95897327
nuagenetworks/nuage-libnetwork
/vendor/github.com/docker/libnetwork/drivers/overlay/overlay.go
Go
go
4,706
permissive
package overlay import ( "fmt" "net" "sync" "github.com/Sirupsen/logrus" "github.com/docker/libkv/store" "github.com/docker/libnetwork/datastore" "github.com/docker/libnetwork/driverapi" "github.com/docker/libnetwork/idm" "github.com/docker/libnetwork/netlabel" "github.com/hashicorp/serf/serf" ) const ( n...
908e87349a9fbc0342b7edb766dbdabef868b778
b6856e0d27f963cf6cd2b990c6565be2809980b4
china-jiajia/tidb
/privilege/privileges/cache_test.go
Go
go
14,115
permissive
// Copyright 2016 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...
6eee9e4266d79ecacb057ec6b934a3632c19f8e7
b8d66e0175af726c09d9e7ef0b038112456ad8b1
agoric-labs/cosmos-sdk
/codec/types/any.go
Go
go
4,261
permissive
package types import ( fmt "fmt" "github.com/gogo/protobuf/proto" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) type Any struct { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. This string must contain at least // one "/" character. The last se...
d9d8fc870bd0a2683f79b6e995ff7e184656fb93
634b32c1e2622de006b464b00f167ff657da4da0
weichweich/gabi
/issuer.go
Go
go
3,076
permissive
// Copyright 2016 Maarten Everts. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gabi import ( "crypto/rand" "github.com/privacybydesign/gabi/big" "github.com/privacybydesign/gabi/pkg/common" "github.com/privacybydesign/gabi/re...
afad1731668283e7cb0e0d25689eb04529c17ec4
cb206fb1785841bbf61645bdf696f365267975b9
surajssd/fabric8-oso-proxy
/provider/kubernetes/kubernetes_test.go
Go
go
49,008
permissive
package kubernetes import ( "errors" "fmt" "reflect" "testing" "github.com/containous/traefik/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/apis/extensions/v1beta1" "k8s.io/client-go/pkg/util/intstr" ) func TestLoadIngr...
6ad550066f8f067bdb9762e52beda792c6804534
0b2311fa3f17ff21157c6a197a238c8f5db8200e
Bidon15/tendermint
/internal/p2p/transport.go
Go
go
7,137
permissive
package p2p import ( "context" "errors" "fmt" "net" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/internal/p2p/conn" "github.com/tendermint/tendermint/types" ) //go:generate ../../scripts/mockery_generate.sh Transport|Connection const ( // defaultProtocol is the default protoco...
b76ca45e8e861c52b818be628672f5d80d2908b9
bbcc02ee674e85fe80543c645e69708b66cb9db3
thedemodrive/istio
/pkg/test/framework/components/bookinfo/configs.go
Go
go
5,508
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...
3c38b00d83356bab5c5e8a5d79cc2509b5498ec6
433f6d5d02c4861cffc993d207e5c853c056e6c6
freemed/freemed-data
/hcpcs/dtd.go
Go
go
1,829
no_license
package main type HcpcsRecord struct { Code string `fixed:"1-5"` ModiferCode string `fixed:"4-5"` SequenceNumber string `fixed:"6-10"` RecIdentificationCode string `fixed:"11-11"` LongDescription string ...
3865dbb61f28ad87e09628fb8822505f48080394
ccfbd4b6bb0735258c904aaccd2d5e8e7416f1e0
dongjoon-hyun/perf-tests
/clusterloader2/pkg/framework/client/objects.go
Go
go
12,431
permissive
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
2e8af19bca86e1112fdb5599eb51e8db04704fc1
2b91d37dd22256305672b22096055b41db39f2db
DigitalRogues/baikonur
/cityparser/cityparser.go
Go
go
5,856
permissive
package cityparser import ( "bytes" "encoding/csv" "html/template" "io" "net/http" "strconv" "sync" "time" log "github.com/apex/log" "github.com/q231950/baikonur/model" keymanager "github.com/q231950/sputnik/keymanager" requests "github.com/q231950/sputnik/requesthandling" ) // CityParser parses cities ...
dc5a7ae11429c15cc0ce81056d21f62213e6c948
ffb1f37db9c067f195946732dc557eb7a1f3c4f4
vaskravchuk/go-rabbitmq-test
/distr_course/coordinator/databaseconsumer.go
Go
go
1,462
no_license
package coordinator import ( "bytes" "encoding/gob" "github.com/streadway/amqp" "go-rabbitmq-test/distr_course/dto" "go-rabbitmq-test/distr_course/qutils" "time" ) type DatabaseConsumer struct { er EventRaiser conn *amqp.Connection ch *amqp.Channel queue *amqp.Queue sources []string } const maxRate = 5 * ...
7ac8582a29e1586b29fc223e5ef28572c61abf4d
f63ff932c86999a67767b68e88902784a9bcf7c5
mister-hai/sandboxy
/data/challenges/forensics/earota/handout/file_to_bternary.go
Go
go
1,223
permissive
package main import ( "fmt" "os" "io/ioutil" "math/big" ) func main() { //fbuf, err := ioutil.ReadFile("sf_postcard_trinary_flag.png") fbuf, err := ioutil.ReadFile("testin.bin") if err != nil { fmt.Fprintf(os.Stderr, "Unable to read flag: %s\n", err.Error()) os.Exit(1) } fmt.Fprint(os.Stderr, "Conver...
d85ed721364f991cede8c3eddeb1113be138edd2
d882193cf6f48252217194bf1fcf89f11108efbe
seven5/seven5
/version1/page.go
Go
go
2,346
permissive
package seven5 import ( "fmt" "net/url" ) //PageMapper is an interface for expressing the "landing" pages for a particular action in the user application. //These are part of the application. This is necessary because this must be handled programmatically by the //back end and can't necessarily use files. Note t...
97f00a29d15021a3b652bcce37a8bd0b3168e05b
a5fea0426ae275d292ab7b7ce2efe3d471d34670
StevenPG/database-state-presented-experiment
/cmd/multipleWriterFast.go
Go
go
4,309
permissive
package main import ( "fmt" "github.com/StevenPG/database-state-presented-experiment/pkg" "time" ) func main() { fmt.Println("Starting Experiment") fmt.Println("Description: We're going to write 10 items to the service and continually update the value.\n" + "For each update, we will require the entire state of...
63f6b31c8595ea9f97d8211b68413903fadd5c2e
4bdb15fdd218fe1207eb5a47c77bbcf7190bcebb
someshsridhara/tf-eks
/test/tf_eks_unit_test.go
Go
go
2,613
no_license
package test import ( "fmt" "testing" "github.com/gruntwork-io/terratest/modules/aws" "github.com/gruntwork-io/terratest/modules/logger" "github.com/gruntwork-io/terratest/modules/random" "github.com/gruntwork-io/terratest/modules/terraform" test_structure "github.com/gruntwork-io/terratest/modules/test-struct...
2c5c5620b1d0c1227a5ebe0c17056b6ad0cd6255
b030bed52655c48c1e52484545424d4cdbec10cc
drakeywakey/LearnGoWithTests
/Iteration/repeat.go
Go
go
338
no_license
package iteration const repeatCount = 5 // Takes a string and a number of times to repeat that string, and returns that string repeated that number of times func Repeat(word string, repeat int) string { var result string if repeat == 0 { repeat = repeatCount } for i := 0; i < repeat; i++ { result += word }...
34624f45bf94c24a0bb94d45ae254fcee4e6cc6a
8994b0bb7d0fdd16a980bb150a73d1fcf0f8f497
W00t3k/ffuf
/pkg/output/file_html.go
Go
go
4,821
permissive
package output import ( "html/template" "os" "time" "github.com/ffuf/ffuf/pkg/ffuf" ) type htmlFileOutput struct { CommandLine string Time string Keys []string Results []Result } const ( htmlTemplate = ` <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/htm...
855f56a050f170e7d1f730b763f3c96011c89be1
a69c7fbbf3574d90aacaa9995c8429d733b9f840
mailsundar57/Go-Routine-threading-to-call-C-
/rout2.go
Go
go
815
no_license
package main import ( "fmt" "log" "os/exec" "sync" "strconv" ) var wg sync.WaitGroup func callCpp(s string){ supplyArg := "./a.out" fmt.Println(supplyArg) out, err := exec.Command("./a.out", s).Output() if err != nil { log.Fatal(err) } fmt.Printf("The out of Cpp is %s\n", out) wg.Done() }...