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
444675c42a06a8c3018a7fef25c1708c964d3b82
deb7829c52730a59173e93516ad40a36cf58ba4c
dr-aryone/Amass
/amass/sources/yahoo_test.go
Go
go
429
permissive
package sources import ( "testing" "github.com/OWASP/Amass/amass/core" ) func TestYahoo(t *testing.T) { if *networkTest == false { return } config := setupConfig(domainTest) bus, out := setupEventBus(core.NewNameTopic) defer bus.Stop() srv := NewYahoo(config, bus) result := testService(srv, out) if re...
f4412434a233b50fcd392a79710f5b958aca7ef0
24b8bd1cc8dd04e448ad768d9dbaaa82ccc9d7d1
phpyandong/opentaobao
/model/product/AlibabaItemCategoryPredictResponse.go
Go
go
1,028
permissive
package product import ( "encoding/xml" "github.com/bububa/opentaobao/model" ) /* 商品发布类目预测 APIResponse alibaba.item.category.predict <font color='red'>商品发布类目预测接口,预测匹配的结果存在一定误差,需要商家二次确认,避免类目配置错误产生其他影响。</font> */ type AlibabaItemCategoryPredictAPIResponse struct { model.CommonResponse AlibabaItemCate...
1da09aa3fad4e28ba3ecc9090ba5b21006cd5f92
7e52d996c9b7dba73686fe9235551682626377f6
HuangMarco/spiff-1
/dynaml/read.go
Go
go
2,268
permissive
package dynaml import ( "io/ioutil" "net/http" "path" "strings" "github.com/mandelsoft/spiff/debug" "github.com/mandelsoft/spiff/yaml" ) var fileCache = map[string][]byte{} func func_read(arguments []interface{}, binding Binding) (interface{}, EvaluationInfo, bool) { info := DefaultInfo() if len(arguments)...
b88adb20e582b73205eabdf9c739980b0e16aaea
500696248e3c49b29627a487a5cf5f036f33baf2
fossabot/kip
/pkg/server/cloud/aws/ecr.go
Go
go
2,329
permissive
/* Copyright 2020 Elotl 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 dist...
72cb7cec60a5d85efaa428d289892b74d9914dd2
9e36d5f22d7129272d725e5d93eb1cd7e8a3c15b
bRRRITSCOLD/bookstore_oauth-api
/domains/access_token/access_token_request.go
Go
go
866
no_license
package access_token_domain import ( errors_utils "github.com/bRRRITSCOLD/bookstore_utils-go/errors" ) const ( GRANT_TYPE_PASSWORD = "password" GRANT_TYPE_CLIENT_CREDENTIALS = "client_credentials" ) type AccessTokenRequest struct { GrantType string `json:"grant_type"` Scope string `json:"scope"` ...
85e581fad648bf79113cfea9ac1d15da9467611e
f83aee4bf74189f4c14cacdbe005393c8dc0097b
apache/beam
/sdks/go/pkg/beam/core/runtime/exec/userstate.go
Go
go
15,311
permissive
// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not...
6ff6435d5cd44b404a007d13c8ac5b337b2ca81f
8803bb1367934a7ff068364175c8b23af479872a
gah242s/mokey
/server/otp.go
Go
go
5,607
permissive
package server import ( "net/http" "strings" "github.com/labstack/echo-contrib/session" "github.com/labstack/echo/v4" log "github.com/sirupsen/logrus" "github.com/ubccr/goipa" "github.com/ubccr/mokey/util" ) func (h *Handler) OTPTokens(c echo.Context) error { user := c.Get(ContextKeyUser).(*ipa.UserRecord) ...
973c4eb86635d6295cf3eb869cbfac8b6d116778
0852da44add38f70008e78f915d7745f8db93e0b
phpyandong/opentaobao
/model/mos/AlibabaMosOnsiteTradePayRequest.go
Go
go
1,309
permissive
package mos import ( "net/url" "github.com/bububa/opentaobao/model" ) /* 新商场当面付商户扫码付 APIRequest alibaba.mos.onsite.trade.pay 收银员使用扫码设备读取用户“付款码”后,将二维码或条码信息通过本接口上送至喵街发起支付。 */ type AlibabaMosOnsiteTradePayRequest struct { model.Params // 创建订单请求参数 onsiteTradePayRequest *OnsiteTradePayRequest }...
80ed3eb1f3d943105986387fd69a3243330603fd
a8955f34ade2efff87a66e38a623ab50e08b8484
435420057/gylib
/Library/src/gylogger/config.go
Go
go
1,360
no_license
package logger import ( "os" "github.com/stvp/go-toml-config" "github.com/kyugao/go-logger/logger" ) var ( logPath string logFile string enableConsole bool level LEVEL ) func InitLogger(path string) { logger.Infof("Init logger with given config file %s", path) loadConfig(path) _, err := os.Stat(logPath) i...
0b369b3845196e7202cc83334f67fd894d0b14ca
33ebaf58f36c8e5959c5bd15ed87381dca12f553
droslean/ci-tools
/cmd/sprint-automation/main_test.go
Go
go
7,344
permissive
package main import ( "context" "fmt" "testing" "time" "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" ctrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client" fakectrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" conf...
b7a9b3aee39c285057358f54dec6f1492e5675fa
6fa2232c7ec08bc336383f8b9db20d69257c7ecc
Plex-Ecosystem/PeUD
/internal/server/cli.go
Go
go
2,125
no_license
package server import ( "os" "sort" "github.com/DirtyCajunRice/PeUD/internal/handlers" "github.com/urfave/cli/v2" ) func CLI(env *handlers.Env) { app := &cli.App{ Name: "PeUD", HelpName: "peud", Version: *env.Build.Version, Usage: "Plex Ecosystem User Database", Action: func(c *cli.Context) e...
927323b1fe2da062ea32f62370fa60243d797fde
42a11d26a9977a9658cb35528fa361cf8cc65453
w3f-grants-archive/go-substrate-rpc-client
/types/ucompact.go
Go
go
1,397
permissive
// Go Substrate RPC Client (GSRPC) provides APIs and types around Polkadot and any Substrate-based chain RPC calls // // Copyright 2019 Centrifuge 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 th...
c5c63ec589ed8854fca00f80affe62f660fd131d
475d6605370ed45480d3d1fb871e4cb9ff9f22c8
cghsystems/gosum
/metrics/file_recorder_test.go
Go
go
1,643
no_license
package metrics_test import ( "fmt" "io/ioutil" "os" "time" . "github.com/cghsystems/gosum/metrics" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" ) var _ = Describe("Metrics File Recorder", func() { Context("metrics are recorded", func...
96be2f27778faf363abfd1a3bfa62f6814a8df5a
c310f8c56af82b9477a3599883cd93b2da7e414a
yufan022/rancher
/pkg/systemtemplate/import.go
Go
go
2,315
permissive
package systemtemplate import ( "crypto/md5" "crypto/sha256" "encoding/base64" "encoding/hex" "io" "strings" "text/template" util "github.com/rancher/rancher/pkg/cluster" v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3" "github.com/rancher/rancher/pkg/settings" ) var ( t = temp...
ccfe19dec9780ed5fdaae695cf49c38ad3196033
2cb7489b8ba4d2a3d40bda47253d0cb112af68dc
epek/structs
/field.go
Go
go
3,273
permissive
package structs import ( "errors" "fmt" "reflect" ) var ( errNotExported = errors.New("field is not exported") errNotSettable = errors.New("field is not settable") ) // Field represents a single struct field that encapsulates high level // functions around the field. type Field struct { value reflect.Valu...
9063b342177e8bca3d4ded22dc349154c90dea63
b259ef4e741ef9a3de0358b78317f4cc3ff14453
g623171541/TheGoProgrammingLanguage
/main/book/8.3.channels通信机制.go
Go
go
2,788
no_license
package main import ( "fmt" "reflect" "net" "log" "io" "os" ) /* Channels:是goroutine(线程) 之间的通信机制,一个channels是一个通信机制。 它可以让一个goroutine通过它给另一个goroutine发送值信息。每个channel都有一个特殊的类型,也就是channels可发送数据的类型。 */ func main() { // 一个可以发送int类型数据的channel一般写为chan int ch := make(chan int,1) // 后面的 1 代表channel的容量,如果容量大于零,则ch...
8ba349280efaf42e9da02828b943c2a3f62a9b32
e50bfbdbc0319c7c2708079c25f6e71547766e35
SmartEnergyPlatform/camunda-engine-wrapper
/vidmigration.go
Go
go
3,567
permissive
/* * Copyright 2018 InfAI (CC SES) * * 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...
206d5e340c5a4fbc37fd574ab61d876b0feaced1
2658b948918001d97164eb15416555a231105200
digitalrebar/provision
/api/info_test.go
Go
go
2,070
permissive
package api import ( "net" "runtime" "strings" "testing" "github.com/digitalrebar/provision/v4/models" ) func TestInfo(t *testing.T) { localId := "" intfs, _ := net.Interfaces() for _, intf := range intfs { if (intf.Flags & net.FlagLoopback) == net.FlagLoopback { continue } if (intf.Flags & net.Flag...
b348cf90d3390f366c03746e2959360099af81dd
c2d820f6df7deb6f9c4ddd760c98e4bae344c537
paxthemax/insolar
/ledger/storage/node/node.go
Go
go
2,954
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...
aff47d3f81622d24e965979f8b3fff386516c935
de878aa3cf14c81c7dd136138c72d1e0632a3df0
wccsama/kubernetes
/cmd/kubeadm/app/cmd/init.go
Go
go
22,912
permissive
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
f6050bca1b4fcc1e4a47239cf931cfd35cd2f844
812d9fc7a1b6912ae003c06c08f7cdb477ef5b86
lwnmengjing/calmwu-go
/utils/redistool/redis.go
Go
go
23,026
permissive
/* * @Author: calmwu * @Date: 2017-10-23 14:59:25 * @Last Modified by: calmwu * @Last Modified time: 2018-11-30 19:48:37 * @Comment: */ package redistool import ( "fmt" "strconv" "sync" "time" "github.com/go-redis/redis" utils "github.com/wubo0067/calmwu-go/utils" ) type RedisMgr struct { redisSvrAddrs...
b139cd0708f0f64c5e131aa841222c593f74c079
b2c279f2c8a5b353fee2141a5d7dd6b31423e3f5
stevekuznetsov/kubernetes
/pkg/volume/git_repo/git_repo.go
Go
go
7,310
permissive
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
726a8c0da0cb0764fec905aad928ab144bd2f6c0
8fd63b4d2831adc785cd576ae8ac540a0d4a0828
priestd09/go-micro-services
/services/rate/server.go
Go
go
1,970
permissive
package rate import ( "encoding/json" "fmt" "log" "net" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/harlow/go-micro-services/data" pb "github.com/harlow/go-micro-services/services/rate/proto" opentracing "github.com/opentracing/opentracing-go" "golang.org/x/net/context" "google.golang...
18669a5723afa14d454160fe62627146ed44cfb4
cc4cf8e5a78abd9efdd865f80b32e5cb57aea655
jbelke/errands-server
/errand-routes.go
Go
go
7,076
no_license
package main import ( "errors" "fmt" "net/http" gin "github.com/gin-gonic/gin" "github.com/polygon-io/errands-server/metrics" schemas "github.com/polygon-io/errands-server/schemas" utils "github.com/polygon-io/errands-server/utils" ) const inactive = "inactive" const active = "active" type UpdateRequest stru...
ca5c2fd378b4cdf72501d7dcc657eea6e4c96cfb
de90f5305f2bec6047f31d485d1a6678013fcf5b
longsleep/golang-deb
/src/runtime/mem_js.go
Go
go
1,950
permissive
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build js,wasm package runtime import ( "runtime/internal/sys" "unsafe" ) // Don't split the stack as this function may be invoked without a valid G, //...
d39429f8070b88c559f70c08ca61ec8f36afa2c9
7c16bb91142be00b2b8ffdfa16ffa71bcba4be2f
wedojava/go_upload_srv
/cmd/server/server_test.go
Go
go
208
no_license
package server import ( "github.com/wedojava/myencrypt" "testing" ) const n = 16 func BenchmarkBytesMaskImprSrc(b *testing.B) { for i := 0; i < b.N; i++ { myencrypt.RandStringBytesMaskImprSrc(n) } }
db8931988f7a8949eac82004286e345a20efc927
3ad59ca8987455a99a23b4085c5758ee11f08c8c
kubevirt/kubevirt
/pkg/ephemeral-disk/fake/ephemeral-disk.go
Go
go
657
permissive
package fake import ( "path/filepath" v1 "kubevirt.io/api/core/v1" "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api" ) type MockEphemeralDiskImageCreator struct { BaseDir string } func (m *MockEphemeralDiskImageCreator) CreateBackedImageForVolume(_ v1.Volume, _ string, _ string) error { return nil } func...
33a8a74bd826888e6c52608503b1b93eff8ffa6e
83a57d780572b1025498d1d93bc1d0488980054a
dennymrh/go_by_example
/main/range-over-channels.go
Go
go
404
no_license
package main import "fmt" func main() { // We’ll iterate over 2 values in the queue channel. queue := make(chan string, 2) queue <- "one" queue <- "two" close(queue) // This range iterates over each element as it’s received from queue. // Because we closed the channel above, // the iteration terminates afte...
c7e8b4171c515fcfcd1a785f29783b3daa8d452c
9410df2b7d498c58f5544128077d01f853089adf
xpzouying/notebook
/go/go_md5/serial/main.go
Go
go
1,727
permissive
package main import ( "crypto/md5" "fmt" "io/ioutil" "os" "path/filepath" "sort" "sync" ) type result struct { path string sum [md5.Size]byte err error } func sumFiles(done <-chan struct{}, root string) (<-chan result, <-chan error) { res := make(chan result) errc := make(chan error, 1) go func() { ...
dbd1a25078a775221affceb6b76ec01befaca547
fffeffb8955878228e47416df57c0aea3506abd3
nextrevision/env2ini
/config.go
Go
go
1,158
permissive
package main import ( "regexp" "github.com/go-ini/ini" ) // Config : struct for defining OpenStack backed configs type Config struct { EnvPrefix string Filename string } // matchRegex is a named regex that matches an env key in the following format: // PREFIX__SECTION__KEY var matchRegex = regexp.MustCompile(`...
03e5fe1d0691c5f02d4cc4ad6d80b54a43ca3971
146eada50917fe992b03e599733ac535c8813d21
medbs/gochain
/core/block_operations_test.go
Go
go
1,575
no_license
package core import ( "testing" ) func TestGenerateBlock(t *testing.T) { b1 := Block{ Index: 1, Timestamp: "stamp", BPM: "bpm", Hash: "41064f80255aee51e0e954f42ec238099eb636fbf11ffb929ecdb809d5d0dc6f", PrevHash: " ", } generatedBlock := GenerateBlock(b1, "bpm2") if generatedBlock.Pre...
f8954c3370c171ea16159edab6d38d038918a05e
8644fecbd1d05ccf456fa30f8f27037204c71f39
flanksource/canary-checker
/checks/folder_gcs.go
Go
go
1,814
permissive
package checks import ( "strings" gcs "cloud.google.com/go/storage" "github.com/flanksource/canary-checker/api/context" v1 "github.com/flanksource/canary-checker/api/v1" "github.com/flanksource/canary-checker/pkg" "github.com/flanksource/canary-checker/pkg/clients/gcp" ) type GCS struct { BucketName string *...
8a670e5c46447f609ddf8492132d6a1ba68af967
21d95f5aa8586e1914e34c8582086c7ae7650f61
gitter-badger/hoverfly
/core/middleware_test.go
Go
go
2,302
permissive
package hoverfly import ( "github.com/SpectoLabs/hoverfly/core/models" "github.com/SpectoLabs/hoverfly/core/testutil" "testing" ) func TestChangeBodyMiddleware(t *testing.T) { command := "./examples/middleware/modify_response/modify_response.py" resp := models.ResponseDetails{Status: 201, Body: "original body"}...
457f124c22043dcdae8860034a0fa10402c096da
5de9b19208bc8f43beec439614ad942a64150e84
guangbochen/web-ui-operator
/pkg/controller/add_kwebui.go
Go
go
262
permissive
package controller import ( "github.com/kubevirt/web-ui-operator/pkg/controller/kwebui" ) func init() { // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. AddToManagerFuncs = append(AddToManagerFuncs, kwebui.Add) }
4e23f6018fad1e43c6f72795d6d593501a4febfe
39080a0c4c665fab2ab6e1a843a2c029eb711f06
mooncool/go-async
/concurrent_run_test.go
Go
go
808
no_license
package async import ( "fmt" "testing" . "github.com/smartystreets/goconvey/convey" ) func function1() { println("function1") fmt.Println("function1") } func functionWithError() { println("functionWithError") fmt.Println("functionWithError") // return errors.New("fake error") panic("fake error") } func T...
9fdd3aaf88220d8b1483e5dbc72bbe271310196e
866613bf75327617138fddf80852e0bafeb806ce
TIERS/rclgo
/internal/msgs/geometry_msgs/msg/AccelWithCovarianceStamped.gen.go
Go
go
6,167
permissive
/* This file is part of rclgo Copyright © 2021 Technology Innovation Institute, United Arab Emirates Licensed under the Apache License, Version 2.0 (the "License"); http://www.apache.org/licenses/LICENSE-2.0 */ /* THIS FILE IS AUTOGENERATED BY 'rclgo-gen generate' */ package geometry_msgs_msg import ( "unsafe" ...
d32ad2d7ba3a2af16cd79dd3b17fc3f55d1dca1c
27f333d3fafd4900b47f886a736dc33f8f899ab6
MaxBreida/mongo-go-driver
/mongo/integration/unified_spec_test.go
Go
go
25,660
permissive
// Copyright (C) MongoDB, Inc. 2017-present. // // 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 package integration import ( "io/ioutil" "path"...
c86c32207c8878242f4a6ab5a4d1d5bcb76f3cee
b1a6ccda13864af00e3002e9c311551124818e1c
jsmithdenverdev/mfa-spike
/storage/user.go
Go
go
1,188
no_license
package storage import ( "mfaspike" "time" "gorm.io/gorm" ) type userEntity struct { gorm.Model Id string `gorm:"primaryKey"` Name string Timezone string } type UserStore struct { client *gorm.DB } func NewUserStore(client *gorm.DB) (UserStore, error) { store := UserStore{ client, } if err ...
6aac93355cb24bec0347c42bd316fe3536a93fee
982a7514241ee18a2a039150c184ad8cac3d080e
rmdhfz/webservice
/.history/main_20210608203310.go
Go
go
1,335
no_license
package main import ( "database/sql" "encoding/json" "log" "net/http" "github.com/gorilla/mux" ) type Product struct { ID int Name string Price int } var mysqlDB *sql.DB func Server() *mux.Router { router := mux.NewRouter() router.HandleFunc("/", handleHome).Methods("GET") router.HandleFunc("/api/produc...
f36d9c969fb0c6f32e1dfb1f65997a6f85858dcb
dd096e5239e14c9ae6f0213ef247f4bd797785e9
HaoYP/lora-app-server
/internal/storage/db.go
Go
go
2,206
permissive
package storage import ( "fmt" "time" "github.com/brocaar/lora-app-server/internal/common" "github.com/garyburd/redigo/redis" "github.com/jmoiron/sqlx" "github.com/pkg/errors" log "github.com/sirupsen/logrus" // register postgresql driver _ "github.com/lib/pq" ) const ( redisDialWriteTimeout = time.Second...
1d7c9dcaedb5f823c14ff00d7e7ef11985fee39a
567119162629f806d51b49395d3f0522ecf123f2
girtsf/bazel-watcher
/ibazel/ibazel.go
Go
go
14,763
permissive
// Copyright 2017 The Bazel 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 appl...
6452672e30278605cc29894df3c7cabce07a4e3e
1324b35f94984329946dcd245cbb9e9a5f66bba5
abraithwaite/tools
/ws/main.go
Go
go
420
no_license
package main import ( "net/http" "os" "github.com/abraithwaite/tools/ws/chatroom" "github.com/gorilla/handlers" "github.com/gorilla/mux" ) func main() { r := http.NewServeMux() rm := mux.NewRouter() b := broadcast.NewWS() r.Handle("/", http.FileServer(http.Dir("."))) rm.Handle("/chat/{room}", b) r.Handle(...
df1d175152a758c00a39d4bfc4e7dceb86d1f7df
1f2171abad36e491627671f61e333eea54b676ba
zhangzhanpei/algorithm
/leetcode-729_my-calendar-i.go
Go
go
625
no_license
/** * 设计一个日历表可预约事件日期,保证所有事件日期不重叠 */ package main import "fmt" func main() { obj := Constructor() fmt.Println(obj.Book(10, 20)) fmt.Println(obj.Book(15, 25)) fmt.Println(obj.Book(20, 30)) } type MyCalendar struct { date [][]int } func Constructor() MyCalendar { return MyCalendar{date: [][]...
843f5916ae610e2054f66889a382f127d52f1795
201a26162596ddd0b2cb2470181cea5db190998a
openshift/installer
/terraform/providers/ovirt/vendor/github.com/ovirt/terraform-provider-ovirt/v2/internal/ovirt/resource_ovirt_disk_resize.go
Go
go
3,106
permissive
package ovirt import ( "context" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ovirtclient "github.com/ovirt/go-ovirt-client/v3" ) var diskResizeSchema = map[string]*schema.Schema{ "disk_id": { Type: schema.TypeString, Required: ...
4dbddd8ee057f2f4f30567b963638ec38e443fe5
e39dc7b1c504fd74682b57e608735125781fb3a2
blackducksoftware/synopsys-operator
/contrib/hydra/pkg/apps/standardperceptor/openshift.go
Go
go
2,668
permissive
/* Copyright (C) 2018 Synopsys, Inc. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "...
6a299fe93e1431077cd7c9673193e40215f98d98
24b8134256bebac7fff5190fc2dcb38d41fa79e6
eysdo/eudore
/_example/appMiddleware.go
Go
go
1,368
permissive
package main /* AddMiddleware 方法如果第一个参数为字符串"global",则作为全局请求中间件添加给App(使用DefaultHandlerExtend创建请求处理函数),否则等同于调用app.Rputer.AddMiddleware方法。 func (app *App) AddMiddleware(hs ...interface{}) error { if len(hs) > 1 { name, ok := hs[0].(string) if ok && name == "global" { handler := DefaultHandlerExtend.NewHandlerFunc...
be20a7df00bb05ad5f9662327f5d703c7048a92d
22ce9832564c11adf173f65e77723790dd95b0fb
cwen0/spider
/types/pd.go
Go
go
3,441
no_license
package types import ( "time" ) type StoreState int32 // Case insensitive key/value for replica constraints. type StoreLabel struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } type Store struct { Id...
9b826c6b05c92a3c8c7405ac589bf23898817372
0c00e7afb8dd77e01233d2dafde37f7afa1513db
MyPureCloud/platform-client-sdk-cli
/build/gc/models/getprofilesresponse.go
Go
go
1,395
permissive
package models import ( "encoding/json" "strconv" "strings" ) var ( GetprofilesresponseMarshalled = false ) // This struct is here to use the useless readonly properties so that their required imports don't throw an unused error (time, etc.) type GetprofilesresponseDud struct { } ...
d90f32b72b9c5cba971e1923001daef9a0936d8c
09968bebdab81db2f11e994935c864b9da6c321e
nathanboktae/cadence
/service/history/MockTimerQueueProcessor.go
Go
go
1,846
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...
363d7883667e252a40e369a7159adba2a5ec2bf2
6a6c9c332d5354ddf1f8a2da3cc477bd18d2be53
chainhelen/delve
/pkg/version/version.go
Go
go
855
permissive
package version import ( "fmt" "runtime" ) // Version represents the current version of Delve. type Version struct { Major string Minor string Patch string Metadata string Build string } var ( // DelveVersion is the current version of Delve. DelveVersion = Version{ Major: "1", Minor: "8", Patc...
4e5adf9db8d5f516452a15f2b8a0cd48bc86c32e
af4296e1deebc448ddf2180b42f0f35dac5fa037
jdkasten/zlint
/v2/lints/rfc/lint_ext_policy_map_not_in_cert_policy_test.go
Go
go
1,304
permissive
package rfc /* * ZLint Copyright 2020 Regents of the University of Michigan * * 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 requi...
985745272d0c82f27483deece5c1c956d50464e7
b299adc288f4704d92f3dbdb2934cb52406e3c64
Icco123/bget
/api/fetch/covid19.go
Go
go
3,037
permissive
package fetch import ( "encoding/json" "io" "strings" "github.com/openbiox/ligo/stringo" "github.com/clindet/bget/api/types" ) const Covid19Host = "https://api.covid19api.com/" // Covid19 access api.covid19api.com API func Covid19(endpoints *types.Covid19Endpoints, bapiClis *types.BapiClisT, f func(), of io.W...
f0c6d0f501961f323144495c151665eb0f930d08
e19132f4c37d56488f9d8fe8701ff40b64c95a30
luozhe023/kt-connect
/pkg/kt/command/connect.go
Go
go
3,615
permissive
package command import ( "fmt" "os" "strings" "github.com/alibaba/kt-connect/pkg/kt" "github.com/alibaba/kt-connect/pkg/kt/options" "github.com/alibaba/kt-connect/pkg/kt/util" "github.com/rs/zerolog" "github.com/rs/zerolog/log" urfave "github.com/urfave/cli" ) // newConnectCommand return new connect command...
0ca96a070e27496ae4f3e7363d53e044dcba1413
bc0390af460f473779dfcaf4b8bf3b4a15977008
xgpc/iris-gorm-demo
/route/route.go
Go
go
758
no_license
package route import ( "irisGorm/controllers" "irisGorm/middleware" "net/http" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/mvc" ) func InitRouter(app *iris.Application) { //app.Use(CrossAccess) bathUrl := "/api" mvc.New(app.Party(bathUrl + "/user")).Handle(controllers.NewUserController()) app...
9cdfb3c046145a564356b976471eb2b6ba8927c9
53276d73fc43ddb25ed2a28f7d88c36be35208b1
MfonabasiOmagbemi/persistenceSDK
/modules/exchanges/genesis/genesis.go
Go
go
1,161
permissive
/* Copyright [2019] - [2020], PERSISTENCE TECHNOLOGIES PTE. LTD. and the persistenceSDK contributors SPDX-License-Identifier: Apache-2.0 */ package genesis import ( sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/persistenceOne/persistenceSDK/schema/helpers" ) //TODO define genesis state type genesisSt...
f2b7ca361fc34fb39b739e48879aaeaea271de9c
646093b23b3ea6ea2fa2e10fedec2a50366d924c
avertrees/scorohope
/cli-master/actor/v2action/resource_test.go
Go
go
4,069
permissive
package v2action_test import ( "archive/zip" "io/ioutil" "os" "path/filepath" . "code.cloudfoundry.org/cli/actor/v2action" "code.cloudfoundry.org/cli/actor/v2action/v2actionfakes" "code.cloudfoundry.org/ykk" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Resource Actions", func() ...
7334483ba4a3fa3d2fb38ca645bf7c8e1e767a13
8e1c1c5685adeb3c0c504d6e8b0356afb9891be2
GoChallenge/GCSolutions
/march15/extra/kelly-dunn/src/github.com/kellydunn/go-challenge-1/track.go
Go
go
2,254
permissive
package drum import ( "encoding/binary" "io" ) // Track describes a single track that is encoded inside of the splice file. // It is comprised of an ID, a Name, and a Step Sequence which describes // When the track should be triggered for output. // // Note that the Buffer and Playhead attributes are used for audio...
022111dc054610c0019f829fa5bb45de8d93bfda
4a12705ebad88394158ec33e53720b3911665192
NguyenPhuoc/GoLang
/models/hf_skill.go
Go
go
1,832
no_license
package models import ( "GoLang/libraries/util" "encoding/json" "github.com/kataras/iris" "sort" ) type HfSkill struct { Id int `gorm:"primary_key"` Name string ManaCost int AngryCost int PieceCost int Cooldown int Detail string WeightAttack float32 `gorm:"default:0"`...
ae3d24de01f486c5a02d573aedfae2be71a60071
0b698aabf0db1558ab62bb3ddf349c371256c3d2
Anoque/vuego
/back/structs/music.go
Go
go
249
no_license
package structs type Artist struct { Id int Name string } type Track struct { Id int ArtistId int Title string Description string } type Genre struct { Id int Name string } type ArtistGenre struct { Id int ArtistId int GenreId int }
6b7d66366dbc25d85705d9ad93c1337fd352c255
56d99a408c82413c04a851302005ed97cf0f3f32
winstarshl/pip-services3-commons-go-vgo
/data/FilterParams.go
Go
go
774
permissive
package data type FilterParams struct { StringValueMap } func NewEmptyFilterParams() *FilterParams { return &FilterParams{ StringValueMap: *NewEmptyStringValueMap(), } } func NewFilterParams(values map[string]string) *FilterParams { return &FilterParams{ StringValueMap: *NewStringValueMapFromMaps(values), }...
8636f113ca3038b29c227e14dad3a0317daa46d5
6e9c7fa8115cb4bc4421dbc1881a3094fa8b79ce
collinmsn/stvpresp
/string.go
Go
go
1,371
no_license
package resp import ( "bytes" "strconv" ) // A String is a RESP simple string or bulk string. type String []byte // NewBulkString returns a String (as a bulk string) with the given contents. func NewBulkString(s string) String { var buf bytes.Buffer buf.WriteByte(BULK_STRING_PREFIX) buf.WriteString(strconv.Itoa...
2f30f472d30025deb5340e1dc5f20f2c77f5565c
8bce48f360f6b5c6a3b9cd7fa504312259926c76
gobindadas/ocp-on-ovirt
/ocp-release-finder/main.go
Go
go
4,528
no_license
package main import ( "context" "flag" "fmt" "net/url" "os" "regexp" "strconv" "strings" "time" "github.com/gocolly/colly/v2" "github.com/google/go-github/v32/github" "golang.org/x/oauth2" ) // PullRequestData holds all the data needed for a PR type PullRequestData struct { org string repo string i...
216b7c277e098d991c0406a6f37a4289ff58dede
82e7f7006020bc7edd57644f9997977c400c9e01
zjdznl/leetcode_go
/1389_test.go
Go
go
1,757
no_license
package leetcode import ( "reflect" "testing" ) func Test_createTargetArray(t *testing.T) { type args struct { nums []int index []int } tests := []struct { name string args args want []int }{ // TODO: Add test cases. { name: "", args: args{ nums: []int{4, 2, 4, 3, 2}, index: []int{...
8a46fd354288e24add55aeabdd1c1cf62efd773b
7afb60aa4a7ecdd3743b5d3f0173240ebd357fe1
bpkgoud/pulumi-azure-native
/sdk/go/azure/recoveryservices/replicationStorageClassificationMapping.go
Go
go
6,364
permissive
package recoveryservices import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type ReplicationStorageClassificationMapping struct { pulumi.CustomResourceState Location pulumi.StringPtrOutput `pulumi:"location"` Name pulumi...
76c982fd186617a5bb89f8bbb447e8c8f5440f20
73c08eda43b4d2491310b3df293eee0a5967a070
VonRosenchild/arktos
/pkg/apis/admissionregistration/validation/validation_test.go
Go
go
25,548
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, ...
803258a40a666edcc5ab7fe6b89cba853c18c0ea
e98db078cb69efaecbb3ce1a938d5ba29d489cad
rlatorraca/GolangCode
/06-Fluxo_Controle/6_04-Loops-DeclaracaoFor.go
Go
go
578
no_license
package main import "fmt" /* - For: inicialização, condição, pós - For: condição ("while") - For: ...ever? (http servers) - For: break - golang.org/ref/spec#For_statements, Effective Go - (Range vem mais pra frente.) */ func main(){ // NAO EXISTE WHILE em GO lang /* Adaptamos em FOR */ x := 0 for x< 10 { ...
5467a569ef77f583f24baf352bf49678d265ffef
e580d0855a93a400d87a1320d11ae9e3f15ecf3e
sachin-ngpws/fabric
/core/ledger/kvledger/txmgmt/privacyenabledstate/db.go
Go
go
8,199
permissive
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package privacyenabledstate import ( "fmt" "github.com/hyperledger/fabric/core/ledger/cceventmgmt" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" )...
8f6df61e724b60d47a699814fb60c4f4af8f276a
9e8227b31b930e0a5f426a466cd330091b4fde81
keithc-ca/odo
/pkg/api/component.go
Go
go
2,007
permissive
package api // Component describes the state of a devfile component type Component struct { DevfilePath string `json:"devfilePath,omitempty"` DevfileData *DevfileData `json:"devfileData,omitempty"` DevControlPlane []DevControlPlane `json:"devControlPlane,omitempty"` DevForwardedPorts ...
37fae5f1f4eb9c35bc829cb1139a925265acbf0a
a2d3dc5c71952038bc6ad08d1e6743e5fafa38a7
olympikesoft/Go-lang-API
/vendor/api/http/request.go
Go
go
999
no_license
package http import ( "encoding/json" "encoding/base64" "github.com/asaskevich/govalidator" "errors" ) type Base64Request struct { Search string `json:"search" query:"search"` } type SearchRequest struct { Filters struct { SortPrice string `json:"sort_price"` } `json:"filters"` Categories Cate...
d77692b545fe135ae47dbf5e8b7cdf85bf97f34c
d14b6ab97076cfbc34c8cf63eaa461a8f194f72a
fvsqr-NetApp/harvest
/pkg/tree/node/node.go
Go
go
7,852
permissive
/* * Copyright NetApp Inc, 2021 All rights reserved */ package node import ( "bytes" "encoding/xml" "fmt" "goharvest2/pkg/color" "goharvest2/pkg/util" "strings" ) type Node struct { parent *Node name []byte XMLName xml.Name Attrs []xml.Attr `xml:",any,attr"` Content []byte `xml:",innerxml...
c6b026c4bd0b2413e21c129e4fba101358e21f92
4ee698cc4be9923c920a1dcbc2ecd39c03b3f43f
Shiferex/telegram-bot-api
/types.go
Go
go
110,161
permissive
package tgbotapi import ( "encoding/json" "errors" "fmt" "net/url" "strings" "time" ) // APIResponse is a response from the Telegram API with the result // stored raw. type APIResponse struct { Ok bool `json:"ok"` Result json.RawMessage `json:"result,omitempty"` ErrorCode i...
93f5ef7fd25b52acde2f39bb6049119eb4a38571
2fafca47fc6a9f42a834e52f4d787eb257d2cc0e
gaocegege/tidb
/util/ranger/range.go
Go
go
18,195
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...
aeac3a368e7ec8e128c41475198cf21cbdd30002
9dc9adc38f4f94603456d74fab0428527197db7a
hefju/DbSync
/IncubatorServer/synctable.go
Go
go
3,637
no_license
package IncubatorServer import ( "fmt" _ "github.com/mattn/go-sqlite3" "log" "time" "xorm.io/xorm" "xorm.io/xorm/names" ) var engine *xorm.Engine func init() { var err error engine, err = xorm.NewEngine("sqlite3", "./incubator.db") engine.ShowSQL(true) engine.SetMapper(names.SameMapper{}) if err != nil { ...
20f9d4e34c590b4ee35c04f25a09925cb2025efe
fa46d8870badd9dcf71ab8926c8fedcb281baa66
zero-shubham/gin_boilerplate
/basic/controllers/auth.go
Go
go
1,396
no_license
package controllers import ( "basic/core/models" "basic/core/schemas" basicjwt "basic/libs/basic_jwt" "basic/libs/hashing" "basic/services" "net/http" "github.com/gin-gonic/gin" ) func Login(loginCreds *schemas.AuthPost) (*schemas.AuthPostResp, *gin.Error) { // * get db db, err := services.GetDB() if err !...
ae76891225ca78055b03285a374db5c24ecfbf7c
d23c617fb040c74fb64162157d595cb25782b69a
xeddmc/feesim
/predict/predict_test.go
Go
go
5,046
permissive
package predict import ( "errors" "testing" col "github.com/bitcoinfees/feesim/collect" "github.com/bitcoinfees/feesim/sim" "github.com/bitcoinfees/feesim/testutil" ) type MockPredictDB struct { txs map[string]Tx attained, exceeded []float64 } func (d *MockPredictDB) GetTxs(txids []string) (ma...
ec1df2665f438cb808c66054d1b5138557db7f7e
5486486c1932cbaf43d38d9dc0e9dbf6bd997e99
SkycoinSynth/cx-chains
/cmd/cxchain-cli/cmd_run.go
Go
go
3,804
no_license
package main import ( "flag" "fmt" "os" "github.com/skycoin/skycoin/src/cipher" "github.com/skycoin/cx-chains/src/api" "github.com/skycoin/cx/cxgo/parser" "github.com/skycoin/cx-chains/src/cx/cxutil" "github.com/skycoin/cx-chains/src/cx/cxflags" "github.com/skycoin/cx-chains/src/cx/cxspec" ) type runFla...
e8b52b439796c36477830664addd998e55eae056
efbc5ee9c25b7346ecccf39507383afd4da9b99e
oneumyvakin/browser-efficiency-test
/generatecharts/amdProfCli.go
Go
go
7,599
permissive
package main import ( "bufio" "fmt" "io" "os" "os/exec" "path/filepath" "regexp" "strconv" "strings" ) const ( amdProfCli = "amdProfCli" amdProfCliBinary = `C:\Program Files\AMD\AMDuProf\bin\AMDuProfCLI.exe` symbolsYandex = "SymbolsYandex" symbolsChromium ...
bdfa528aaabc664f29456d3a955f839971a188f9
b66000a2e69acadab48cbf6909c2b6b68634e621
pjmorr/minishift
/test/integration/integration_test.go
Go
go
10,120
permissive
// +build integration /* Copyright (C) 2017 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 agree...
127cf4405dd0a626f74e8ab87d06ddca9561aa1f
aff31b9707215689dcf53cdc5c7b49a89ddc608b
ekmixon/reguerr
/builder.go
Go
go
1,353
permissive
package reguerr type Builder struct { err *ReguError } func New(code, format string) *Builder { return &Builder{ err: &ReguError{ code: code, format: format, level: DefaultErrorLevel, statusCode: DefaultStatusCode, }, } } func (b *Builder) Label(index int, name string, goType interf...
08fea0228bd733a71945f8a94a8ca5572ac08e0a
58ba385793b9272d364c4b1d3bf47fdda52c35f3
renesugar/godev
/main.go
Go
go
7,091
permissive
//go:generate go run data/generate.go package main import ( "bufio" "fmt" "os" "path" "strings" "sync" shellquote "github.com/kballard/go-shellquote" ) func main() { config := InitConfig() godev := InitGoDev(config) godev.Start() } type InitFile struct { Filename string Data string } var InitFileMa...
a75a13e241000c7c6ad3e406648c2848ca1eec17
d42d3d25405edfb0ca571edae3049cb34971a2a9
gkarlik/quark-go
/middleware/ratelimiter/middleware_test.go
Go
go
1,628
permissive
package ratelimiter_test import ( "net/http" "net/http/httptest" "testing" "time" "github.com/gkarlik/quark-go/middleware/ratelimiter" "github.com/stretchr/testify/assert" ) type TestHttpHandler struct{} func (h *TestHttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write([]byte("OK")) } fu...
5cc40d8aa4976b2210a037f3b6f325879e264916
2f7b31bb877c24b3ed2bf42743daf72cb2982f8a
pintu0789/mysql-operator
/test/e2e/basic_test.go
Go
go
3,121
permissive
// Copyright 2018 Oracle and/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. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless requ...
bf0bd56bd626390ce4583ef755e889d4831ff96e
052885e52d8879c771faf1587bc144baff893f27
bdshadow/kubernetes-client-android
/kubernetes-model/vendor/golang.org/x/net/route/binary.go
Go
go
3,391
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...
e636cd24bf416c831a262a3c2da2e81c6ab6f1cb
7307320d93fa326220b222651d16275760ec1d94
alexandregz/gogs
/modules/auth/user_form.go
Go
go
4,902
permissive
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package auth import ( "mime/multipart" "github.com/go-macaron/binding" "gopkg.in/macaron.v1" ) type InstallForm struct { DbType string `binding:"Requ...
b403d1ea6b6e39a6dc8a3fbb926959f89c768dd3
efc4607802f1b3a29f0799b2b3a9fd3a3e7ac7b0
morlay/aliyun-go
/clients/emr/cancel_order_for_admin.go
Go
go
858
no_license
package emr import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" "github.com/morlay/aliyun-go/common" ) type CancelOrderForAdminRequest struct { requests.RpcRequest ResourceOwnerId int64 `position:"Que...
a666261acf02eae4198929db2c016efd7d11131f
e3e8d3ceb891e94b0ef593e8aa17622450a1984a
kostty/carbonapi
/expr/functions/diffSeries/function.go
Go
go
3,111
permissive
package diffSeries import ( "fmt" "github.com/bookingcom/carbonapi/expr/helper" "github.com/bookingcom/carbonapi/expr/interfaces" "github.com/bookingcom/carbonapi/expr/types" "github.com/bookingcom/carbonapi/pkg/parser" "strings" ) type diffSeries struct { interfaces.FunctionBase } func GetOrder() interfaces....
48149523f922e80597af0ebc4acf809f51777fd4
a204651d055f542ccce7030eb1946944a6f98f59
gesellix/engine-api
/client/volume_create_test.go
Go
go
1,870
permissive
package client import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "strings" "testing" "github.com/docker/engine-api/client/transport" "github.com/docker/engine-api/types" ) func TestVolumeCreateError(t *testing.T) { client := &Client{ transport: transport.NewMockClient(nil, transport.ErrorMock...
d20239df3d7a270f9be7416ca08b919a990457c7
706586135afe66e8ab8dca84a0ebe87e2971c285
VenuMeda/golib
/sml/sml.go
Go
go
2,006
permissive
// Tideland Go Library - Simple Markup Language // // Copyright (C) 2009-2016 Frank Mueller / Tideland / Oldenburg / Germany // // All rights reserved. Use of this source code is governed // by the new BSD license. package sml //-------------------- // IMPORTS //-------------------- import () //--------------------...
cc0cd4b7262e2aa2b5e492a6addac3c4b331ad0e
5944ff1cacdef78602dd12b224549ff2bd1d8f93
quynhlab/kubescape
/main.go
Go
go
1,003
permissive
package main import ( "fmt" "kube-escape/cautils" k8sinterface "kube-escape/cautils/k8sinterface" "kube-escape/inputhandler/clihandler" "kube-escape/opaprocessor" "kube-escape/policyhandler" "kube-escape/printer" "os" ) func main() { if err := CliSetup(); err != nil { fmt.Println(err.Error()) os.Exit(...
b1bf78ea64ccd49c04e4366e869887cdc50ab473
d8c418a107ee719a48c6e4a5080cc5c5652a3e55
Alan-ZYT/Golang-Language-Document
/Arrays/array/homework/homework08_猴子.go
Go
go
660
no_license
package main import "fmt" func main() { /* 猴子分桃:海 滩上有一堆桃子,五只猴子来分。 第一只猴子把这堆桃子平均分为五份,多了一个,这只猴子把多的一个扔入海中,拿走了一份。 第二只猴子把剩下的桃子又平均分成五份,又多了一个,它同样把多的一个扔入海中,拿走了一份, 第三、第四、第五只猴子都是这样做的,问海滩上原来最少有多少个桃子? */ for i:=1;i<=10000;i++{ count := 0//统计次数,5次 s := i for (s-1)% 5 ==0{ count++ if count == 5{ fmt...
49d013faaa4ec3a35b63fedb2b0347c31b7f94d5
7598faf460e46d628560b2d6dfd3dadfc03693b3
reusee/li
/li/ui.go
Go
go
1,798
permissive
package li import ( "reflect" ) type Element interface { RenderFunc() any } type ( BGColor Color FGColor Color Bold bool Underline bool Fill bool Point [2]int Align uint8 ) const ( AlignLeft Align = iota AlignRight AlignCenter ) // UIDesc type UIDesc struct { InitFuncs []any } ...
c9b2791b8582c820c507bac086897a85610c1d52
cf3fbac9facc3f58dea1c22e51be8a033268043c
parkedwards/gloo
/projects/gloo/pkg/plugins/buffer/plugin.go
Go
go
3,469
permissive
package buffer import ( "github.com/envoyproxy/go-control-plane/pkg/wellknown" "github.com/rotisserie/eris" envoyroute "github.com/envoyproxy/go-control-plane/envoy/api/v2/route" envoybuffer "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/buffer/v3" "github.com/solo-io/gloo/pkg/utils/gogou...
122ff23ea57fe12c2fdcb8df417aa23802d29f2e
090f489d6dd41819c8c2d3cf30f7456317078a6f
mistifyio/mistify-agent-image
/snapshot_test.go
Go
go
8,717
permissive
package imagestore_test import ( "fmt" "net/http" "net/http/httptest" "path/filepath" "strings" "testing" "github.com/mistifyio/mistify-agent/rpc" "github.com/pborman/uuid" "github.com/stretchr/testify/suite" "gopkg.in/mistifyio/go-zfs.v1" ) var defaultZFSOptions map[string]string = map[string]string{ "co...
877c4a696b6743c173216d259c93bcf17e0d7374
70593914519bc11181b3feaf9a5662b1ea69e55e
ssiyad/gopass
/internal/store/leaf/fsck_test.go
Go
go
1,373
permissive
package leaf import ( "bytes" "context" "io/ioutil" "os" "testing" "github.com/gopasspw/gopass/internal/backend/crypto/plain" "github.com/gopasspw/gopass/internal/backend/storage/fs" "github.com/gopasspw/gopass/internal/out" "github.com/gopasspw/gopass/pkg/ctxutil" "github.com/gopasspw/gopass/pkg/gopass/sec...
45f5cc65892eb4cdc24d03f0e3f31c84b1fdc814
76aea39d1838682cb06c6c7aba4e7ab19298b008
caicloud/mpi-operator
/pkg/apis/kubeflow/v1alpha2/constants.go
Go
go
746
permissive
// Copyright 2019 The Kubeflow 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 agr...
41e65e9d597688e73c49883f3d521c2871b9bdb7
3c421525e1bcf72a82ef487c4a0501f180a85843
realb0t/go-clope
/cluster/cluster.go
Go
go
2,223
permissive
package cluster import ( "fmt" "math" "github.com/realb0t/go-clope/atom" "github.com/realb0t/go-clope/transaction" ) // Cluster struct type Cluster struct { Id int // ID // Cluster parameters N int // Transaction quantity W int // Quantity of uniq atoms (cluster width) S int // Area of cluster //...
99177fec44d85f85c8986e405d16dbd54253682e
668098d1f4faf5f71acfd3aeb7f91df843127223
dkcyber/MyNewsWeb
/myNewsWeb/models/model.go
Go
go
1,120
no_license
package models import ( "github.com/astaxie/beego/orm" _"github.com/go-sql-driver/mysql" "time" ) //用户结构体 type User struct { Id int UserName string `orm:"unique"` Pwd string Articles []*Article `orm:"rel(m2m)"` } //文章结构体 type Article struct { Id int `orm:"pk;auto"` Title string `orm:"size(100)"` Content st...
55443bb5fd1bdd68ad7e6c107db71098f9d30c7b
f2994b911961881ec4bc935e695833f33aeda42d
microsoft/KubeDevice
/vendor/k8s.io/kubernetes/test/e2e/common/expansion.go
Go
go
21,423
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, ...
655c05988393636021f1c10c340dd23166707fba
258bb6d19b4f568ffe6e19af73123093996d3961
l50/goutils
/git/gitutils_test.go
Go
go
13,999
permissive
package git_test import ( "fmt" "os" "path/filepath" "strings" "testing" "time" gitutils "github.com/l50/goutils/v2/git" "github.com/l50/goutils/v2/str" "github.com/l50/goutils/v2/sys" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/transp...
4eee5f7cb9be02d88f1f808f1d8e315117b5df19
4fa176f9e2c32960ec24f73574681e7642619e3b
hantempo/glu
/image/ktx/reader.go
Go
go
4,369
permissive
package ktx import ( "encoding/binary" "fmt" "image" "image/color" "io" "log" "github.com/hantempo/glu/enum" glimage "github.com/hantempo/glu/image" glcolor "github.com/hantempo/glu/image/color" ) func decodeUint32(buf []byte, isLittleEndianness bool) uint32 { if isLittleEndianness { return binary.Little...