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
c9b49793e8ac9ace43c7ca94ba33aa751cabdf17
d5f0a17b9023bfb07c6035c63b228896bcba0ea0
planetlabs/draino
/internal/kubernetes/watch_test.go
Go
go
1,955
permissive
/* Copyright 2018 Planet Labs 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 di...
e2cd60b1fb12fad557049eba275d42d59a1b0bb7
02e7aad972326dd84347f08ab27153d33bd6b7c1
packetsoftware/ics
/timezones/timezones.go
Go
go
46,756
permissive
package timezones type Timezone string const ( EuropeAndorra Timezone = "Europe/Andorra" AsiaDubai Timezone = "Asia/Dubai" AsiaKabul Timezone = "Asia/Kabul" AmericaAntigua Timezone = "America/Antigua" AmericaAnguilla Timezone = "America/A...
d993b8cbe6b76fbcf90dbf5ac7990ed04855aa06
9700b985bf44209a8c10f0448d4adf3b345e3b08
marbindrakon/origin
/pkg/apps/controller/generictrigger/factory.go
Go
go
7,837
permissive
package generictrigger import ( "fmt" "reflect" "time" "github.com/golang/glog" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" kcorelisters "k8s.io/kubernetes/pkg/clien...
665c278b5e767b2d5fd74a52126e7b75301c8ce5
8471886206907ca0241f2ae9e9f89e797d993df9
brandoncox/origin
/plugins/router/template/types.go
Go
go
2,407
permissive
package templaterouter import ( routeapi "github.com/openshift/origin/pkg/route/api" "strings" ) // ServiceUnit is an encapsulation of a service, the endpoints that back that service, and the routes // that point to the service. This is the data that drives the creation of the router configuration files type Servi...
c7054e55596d7695cbb6d2e3f05c9b30c680069d
68f8b5c891bfcda91ec10ae0aaa7fdf22a882b97
UrkelLabs/sia
/siatest/localdir.go
Go
go
4,049
permissive
package siatest import ( "fmt" "io/ioutil" "os" "path/filepath" "gitlab.com/NebulousLabs/errors" "gitlab.com/NebulousLabs/fastrand" "gitlab.com/NebulousLabs/Sia/crypto" "gitlab.com/NebulousLabs/Sia/persist" ) // LocalDir is a helper struct that represents a directory on disk that is to be // uploaded to the...
128ebf4ba6e6c53fa055a69662189f4e10033bf7
f7a4bcb886db8ed824f1f9b19911cda41f2c3bbe
Uniswapx/kit
/remote/plumbing/revert_test.go
Go
go
14,635
permissive
package plumbing_test import ( "os" "path/filepath" "github.com/bitfield/script" "github.com/make-os/kit/config" "github.com/make-os/kit/remote/plumbing" r "github.com/make-os/kit/remote/repo" testutil2 "github.com/make-os/kit/remote/testutil" "github.com/make-os/kit/remote/types" "github.com/make-os/kit/tes...
70867ea931bc7d736de1f0c55567f39183289270
8e357d1abf6b8d0ec7f70261b7edb4a2a2dc20ce
kubernetes-sigs/external-dns
/provider/dnsimple/dnsimple.go
Go
go
12,112
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, ...
bde2c2e7a9bea8d31484e5adb0468de13f53c7da
4954ec633709334934e28f153b8292b9928b8514
protoman92/go.burnbooks
/gopher_test.go
Go
go
2,334
permissive
package goburnbooks import ( "testing" "time" ) func Test_GopherDeliveringBurnables_ShouldBurnAll(t *testing.T) { /// Setup t.Parallel() suite := NewDefaultTestSuite() /// When players := suite.SetUpSystem() time.Sleep(suite.integrationWaitDuration) /// Then pileGroup := players.supplyPileGroup contribPe...
8931b1b0f9e17f087fd320360c1acd759ab65146
f777b7792aaf356e38221470c4784b8647cbfbe7
sudeepgoyal75/terraform-provider-nuagenetworks
/5.3.2/nuagenetworks/data_source_nuagenetworks_location.go
Go
go
5,684
no_license
package nuagenetworks import ( "fmt" "github.com/hashicorp/terraform/helper/schema" vspk "github.com/tpretz/vspk-go/vspk/5.3.2" "github.com/nuagenetworks/go-bambou/bambou" ) func dataSourceLocation() *schema.Resource { return &schema.Resource{ Read: dataSourceLocationRead, Schema: ...
49ad7e0b4a967e2fd61a0db1e6e4d537a1c06f20
e074b083af725f9b4e3a98e2178ee77d3c9e725b
coffeenights/kubevela-core-api
/pkg/oam/util/helper_test.go
Go
go
56,602
permissive
/* Copyright 2021 The KubeVela 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, so...
ae886d8dadf8ee6f2945d70a57a363c87048f922
18e22d7a8bce7e8558950b79c99ca5fa0d5ce19e
cuirunxing-hub/openyurt
/pkg/yurtctl/cmd/revert/revert.go
Go
go
12,854
permissive
/* Copyright 2020 The OpenYurt 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, so...
aee61e54a5191a6ad3b351ab7ed95d63d023f294
6e3f5d69c22f97a728806b1e49450ba10bb24b3c
qinzuoyan/tiup
/pkg/cluster/clusterutil/cluster.go
Go
go
2,545
permissive
// Copyright 2020 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
84944c33e80385926e5cbece7c894ea1b0ddbb41
95957c0174c75844230242c5a7bc218985037911
jadlers/advent-of-code
/2018/day1/day1_test.go
Go
go
536
no_license
package main import "testing" func TestDay1(t *testing.T) { tests := []struct { name string input []string want int }{ {"Example 1", []string{"+1", "-1"}, 0}, {"Example 2", []string{"+3", "+3", "+4", "-2", "-4"}, 10}, {"Example 3", []string{"-6", "+3", "+8", "+5", "-6"}, 5}, {"Example 4", []string{"...
6d618a4ce12fd5ebadfbdd5ac2797705e50ec509
c09afbd56ca9eb3c12427bf86deebc2fc4216cbe
loverdos/scripts
/go/findcmd/findcmd.go
Go
go
1,078
no_license
package main import "fmt" import "os" import "strings" import "regexp" func Exists(name string) bool { _, err := os.Stat(name) return err == nil } func findIn(folderName string, cmdre string) (files []string) { if !Exists(folderName) { return []string{} } f, err := os.Open(folderName) if err != nil { retu...
3076289cfd83a4c06bdb7b66fc46043a5ef31dec
4f3abd3b63ef21e65ff2a4776bcb6e9c3a5ca5fd
TylerTang06/-algorithm015
/Week_04/529-updateBoard.go
Go
go
1,411
no_license
package week04 import "container/list" // BFS func updateBoard(board [][]byte, click []int) [][]byte { if board == nil || len(board) == 0 || len(board[0]) == 0 { return board } if board[click[0]][click[1]] == 'M' { board[click[0]][click[1]] = 'X' return board } // init structures visted := map[[2]int]bo...
be38db3a0587b86fef00aabd755672518ad7efee
acb10bcec17012deb4c377965ddeff7457435b0e
andreGarvin/yumdb
/src/sys/fs.go
Go
go
2,098
permissive
package sys import ( "path/filepath" "encoding/json" "io/ioutil" "os" ) // checks if a file exist func FileExist( path string ) bool { if _, err := os.Stat(path); !os.IsNotExist(err) { return true } return false } // returns the conents of a given existing file name func ReadFil...
1ff956bc6a799f2fbaa1cbe69c0450e54268f68c
6703142f7150f557bb8f02b25fd2beb7c86e22ab
masgari/homie-go
/examples/sysinfo/main.go
Go
go
2,112
no_license
package main import ( "fmt" "time" homie "github.com/masgari/homie-go/homie" cpu "github.com/shirou/gopsutil/cpu" load "github.com/shirou/gopsutil/load" mem "github.com/shirou/gopsutil/mem" ) func formatByteCount(b uint64) string { const unit = 1024 if b < unit { return fmt.Sprintf("%d B", b) } div, exp ...
a117f1bf848de9dbfdbe38dbdade2ac2a289bf9a
6227a9f7b6784e09b661b0922bfddabcfeeb7d5f
snaka/code-pocket
/lang/go-lang/bufio/main_string.go
Go
go
304
no_license
package main import ( "fmt" "bufio" "strings" ) func main() { s := `XXXXXXX YYYYY ZZZZZ` r := strings.NewReader(s) scanner := bufio.NewScanner(r) scanner.Scan() fmt.Println(scanner.Text()) scanner.Scan() fmt.Println(scanner.Text()) scanner.Scan() fmt.Println(scanner.Text()) }
654f3c2555b77ef221e970583a38631a906e3187
72b78619199cefe10d6defd2e4d6eb0a8c0c3410
actumn/searchgoose
/http/actions/rest_source.go
Go
go
2,674
permissive
package actions import ( "errors" "github.com/actumn/searchgoose/state/cluster" "github.com/actumn/searchgoose/state/indices" "github.com/actumn/searchgoose/state/transport" "github.com/sirupsen/logrus" ) type RestGetSource struct { clusterService *cluster.Service indicesService *indi...
854f75a82046821295a711f56decaef278ab9970
b3837f389629dab90e9961853c1bd22232ef02c9
joaolms/tfsec
/cmd/tfsec/main_test.go
Go
go
1,037
permissive
package main import ( "testing" "github.com/aquasecurity/tfsec/pkg/result" "github.com/aquasecurity/tfsec/pkg/severity" "github.com/stretchr/testify/assert" ) func Test_IfIgnoreWarningsSetShouldRemoveWarningScanResults(t *testing.T) { expectedResultsAfterFiltering := 1 twoScanResultsWithOneWarning := []resul...
c7a3a7863e86f72ba7149ee89849fd5886b15d65
7eab7ba6c0b3de7e1d71d91e50a576fbe1927c2e
vulogov/TSAK-3
/internal/conf/conf.go
Go
go
3,676
permissive
package conf import ( "fmt" "os" "time" "github.com/goombaio/namegenerator" "github.com/rs/xid" "gopkg.in/alecthomas/kingpin.v2" ) type filelist []string func (i *filelist) Set(value string) error { _, err := os.Stat(value) if os.IsNotExist(err) { return fmt.Errorf("Script file '%s' not found", value) } ...
e2c94c116e6f6aa694a370140d3732cb43c722de
80d323c5c232f460e155c21f0ce5fe8213b5d0c8
chay22/tuya-cloud-sdk-go
/api/common/token.go
Go
go
1,439
permissive
package common import ( "sync" "time" "github.com/tuya/tuya-cloud-sdk-go/pkg/tylog" ) type Info struct { Token string RefreshToken string ExpireAt time.Time Mu *sync.RWMutex } var LocalToken = Info{Mu: &sync.RWMutex{}} func SetToken(token, refreshToken string, expire int) { LocalToken....
d48925d4b1b3f1b24d8e4509a7ca1edf6fa17748
6535782d83d23cd82521f3a5ddb1dc69cba81e46
m3ntalsp00n/jaeger-operator
/pkg/deployment/collector.go
Go
go
8,693
permissive
package deployment import ( "fmt" "sort" "strconv" appsv1 "k8s.io/api/apps/v1" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "github.com/jaegertracing/jaeger-operator/pkg/account" v1 "githu...
7b12db1e55b20cba8ab0a95760a808f8421b6099
bdaa158e058c10f429bd04486ba7d70d88eb229b
MoreNaruto/18F-coding-exercise
/project/builder/build_data.go
Go
go
2,045
permissive
package builder import ( "bufio" "encoding/csv" "io" "log" "os" "strconv" "strings" ) type Plan struct { Planid string State string Metalfield string Rate float64 Ratearea int64 } type SLCSP struct { Zipcode string Rate float64 } type Zip struct { Zipcode string State s...
b6414e0f16facee809d56cc8d6bca533994da05f
7030c4068bbc3a65364b8656f4acfbeb6d53b795
FrankHitman/playGo
/algorithms/shaplay.go
Go
go
876
permissive
package main import ( "crypto/sha256" "fmt" "golang.org/x/crypto/bcrypt" ) func main() { h := sha256.New() h.Write([]byte("password")) shPassword := fmt.Sprintf("%x\n", h.Sum(nil)) fmt.Println(shPassword) // sum := sha256.Sum256([]byte("password")) // fmt.Printf("%x\n", sum) hashedBytes, err := bcrypt.Ge...
8cd5c8a26c8921f832bafa05ac822f2d6bc1920f
191cb7dcb1b36734fa77e0d2ce2df807838a9d2a
AkiTaishin/VeryBlueFantasy-Server
/Message/Message.go
Go
go
703
no_license
package message import ( "fmt" "net/http" ) // SendMessage メッセージを送りたい func SendMessage(w http.ResponseWriter, r *http.Request) { // #region コメントアウト // 送りたいメッセージ data := "{\"test\":\"SuccessSendMessage\"}" //data := "{test:SuccessSendMessage}" // 書き込むためにバイトに変換 responses := []byte(data) // ヘッダーを付与してメッセージを書き込...
057d16faaca343f7e780cfe876762837d835756a
27344e06b6cb570a5772e473abead58c70e959f0
yunify/qingstor-csi
/cmd/neonsan/main.go
Go
go
3,274
permissive
// +------------------------------------------------------------------------- // | Copyright (C) 2018 Yunify, Inc. // +------------------------------------------------------------------------- // | Licensed under the Apache License, Version 2.0 (the "License"); // | you may not use this work except in compliance with t...
912bbce6a1d69059064863ed184d8b86f1c4361a
3b6d075b17eebf824606f9223d9e0c8187f021bd
templexxx/etcd
/clientv3/namespace/lease.go
Go
go
1,611
permissive
// Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
0fb75815b333f5c8e0dfec4980be0ddc9933b3dc
4cd8fa8b962fcf6edfcf60c7b51134431b0726a1
nvuillam/kics
/pkg/report/sarif.go
Go
go
602
permissive
package report import ( "strings" reportModel "github.com/Checkmarx/kics/pkg/report/model" ) // PrintSarifReport creates a report file on sarif format func PrintSarifReport(path, filename string, body interface{}) error { if !strings.HasSuffix(filename, ".sarif") { filename += ".sarif" } if body != "" { sum...
e3e00ecce14a4c950c50f10c3bc4fd396639c60f
24d14ba56cdee1818cac4315c25fa2f2b2b1c1e8
Atomicology/isilon_sdk_golang
/settings_mappings.go
Go
go
340
permissive
/* * Isilon SDK * * Isilon SDK - Language bindings for the OneFS API * * API version: 5 * Contact: sdk@isilon.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package isi_sdk_8_1_0 type SettingsMappings struct { Mappings []SettingsMappingExtendedExtended `json:"map...
a4b7b240d9e7b62fdd357993838be475cadd9eac
0c7700249c02a1c33228f42d124e63f5b74cc5e7
vonnwang/athenadriver
/athenareader/main.go
Go
go
2,187
permissive
// Copyright (c) 2020 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...
da0f89f20226cf23d74b703afea5947edb7b96a0
e1114db2114cb52e5d23c5c10e615d86dbc31bd7
utsavanand2/k3sup
/pkg/cmd/metricsserver_app.go
Go
go
2,840
permissive
package cmd import ( "fmt" "log" "os" "path" "github.com/alexellis/k3sup/pkg/config" "github.com/spf13/cobra" ) func makeInstallMetricsServer() *cobra.Command { var metricsServer = &cobra.Command{ Use: "metrics-server", Short: "Install metrics-server", Long: `Install metrics-ser...
d384da30cd12f41bf4ab8aba8462e85f6689494a
a378cada58cf9d3b4e6ed1adbef36c86cedf969d
hsartoris-bard/machine
/commands/url.go
Go
go
425
permissive
package commands import ( "fmt" "github.com/hsartoris-bard/machine/libmachine" ) func cmdURL(c CommandLine, api libmachine.API) error { if len(c.Args()) > 1 { return ErrExpectedOneMachine } target, err := targetHost(c, api) if err != nil { return err } host, err := api.Load(target) if err != nil { r...
8da6c8e6f790cb41dfff3bd32d261b07346b6579
5542d2d0a69a3b1acc77865034f113b8640e1861
mjsmith11/AOC
/2017/Go/day22.go
Go
go
2,252
no_license
package main import ( "bufio" "os" ) const ( file22 = "day22/input.txt" size = 2000 inpSize = 25 inpStart = 1000 ) func day22part1() int { net := make([][]*node, size) for i := range net { net[i] = make([]*node, size) } for y := 0; y < size; y++ { for x := 0; x < size; x++ { net[y][x] = new(...
4f02032924c2155866cb641a5becc32d743a85c8
d6965cbe56289a527d1bab386887688a2eedb833
jdcloud-api/jdcloud-sdk-go
/services/cps/apis/RestartInstance.go
Go
go
4,469
permissive
// Copyright 2018 JDCLOUD.COM // // 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 ...
398eb76dc1a58c4fe9278fb212c24f5a697df9d5
d301bad2ce9fb4d745346395335915347a395c53
guihaojin/tidb
/store/mockstore/unistore/cophandler/analyze.go
Go
go
10,054
permissive
// Copyright 2019-present 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 agr...
221857fcb76e63536ad09101494e35ff57d532fb
a7c1028564fe6f5fabe683af1ce3be50fdb42273
Charliedean/grafana
/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey/assertions.go
Go
go
3,060
permissive
package convey import "github.com/smartystreets/goconvey/convey/assertions" var ( ShouldEqual = assertions.ShouldEqual ShouldNotEqual = assertions.ShouldNotEqual ShouldAlmostEqual = assertions.ShouldAlmostEqual ShouldNotAlmostEqual = assertions.ShouldNotAlmostEqual ShouldResemble = assert...
6bc63607a03683dfd0ea11e429d08e5cbf97717e
4150d72c482f1763ed96780b072ebe442680dab3
coreweave/argo
/workflow/validate/validate_dag_test.go
Go
go
20,024
permissive
package validate import ( "testing" "github.com/stretchr/testify/assert" ) var dagCycle = ` apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: dag-cycle- spec: entrypoint: cycle templates: - name: echo container: image: alpine:3.7 command: [echo, hello] - name: cycle ...
c3b82b85bd5597053708969e41acd7c3dd23c033
33b24d4b95e23c2b9427f28ff8870083f35d1888
CenturyLinkCloud/clc-go-cli
/state/command_skeleton.go
Go
go
1,275
permissive
package state import ( "encoding/json" "io/ioutil" "os" "reflect" "github.com/centurylinkcloud/clc-go-cli/base" ) func ArgumentsToJSON(args map[string]interface{}, model interface{}) (string, error) { if reflect.ValueOf(model).Kind() != reflect.Invalid { meta := reflect.ValueOf(model).Elem() numFields := m...
20ffea3e6df47b699c424b40d22d279e5091792e
db02197b314f394e91247eaf02bef0b74efa7664
mszostok/kyma
/components/binding/internal/target/handler.go
Go
go
3,234
permissive
package target import ( "context" "fmt" bindErr "github.com/kyma-project/kyma/components/binding/internal/error" "github.com/kyma-project/kyma/components/binding/pkg/apis/v1alpha1" "github.com/google/uuid" "github.com/pkg/errors" v1 "k8s.io/api/apps/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) // TODO:...
253bef36efaa88fde4af2de482d6b60982ab67b8
87788df5408a85fbf9bbb58d4b3c955b7e522122
alistairfink/Steak
/Backend/Data/Commands/EquipmentCommand.go
Go
go
1,668
no_license
package Commands import ( "github.com/alistairfink/Steak/Backend/Data/Models" "github.com/go-pg/pg" "github.com/google/uuid" ) type EquipmentCommand struct { DB *pg.DB } func (this *EquipmentCommand) Get(uuid uuid.UUID) *Models.EquipmentModel { if !this.Exists(uuid) { return nil } var models []Models.Equip...
098b806afdbe3a6a08a3ccb9f8127dcf0ed5a42c
486afa7e4e15cae49f311606919adab52ca9f6e1
sandrask/edge-service
/pkg/storage/provider.go
Go
go
3,432
permissive
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package storage import ( "encoding/json" "time" "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" ariesstorage "github.com/hyperledger/aries-framework-go/spi/storage" ) // Provider is a storage pro...
bf19bb80df2a9b4cab1de3ec6c55a72055d40682
b3e788ba97edacd3d0f72ed236369aa302229c8f
ss89/gosoline
/pkg/test/component_cloudwatch.go
Go
go
2,058
no_license
package test import ( "fmt" "github.com/aws/aws-sdk-go/service/cloudwatch" "github.com/justtrackio/gosoline/pkg/cfg" "github.com/justtrackio/gosoline/pkg/log" ) type cloudwatchSettingsLegacy struct { *mockSettings } type cloudwatchComponent struct { mockComponentBase settings *cloudwatchSettingsLegacy clien...
438db9a811ecf46df7d5e8e05036deced45157f4
b2f088276bd8a4a8a4ffd7029bc975c6d2bc5f61
FR4NK-W/rains
/internal/pkg/siglib/rainsSiglib.go
Go
go
12,110
permissive
//siglib provides helperfunctions to sign messages and sections and to verify the validity of //signatures on messages and section. package siglib import ( "bytes" "fmt" "regexp" "time" cbor "github.com/britram/borat" log "github.com/inconshreveable/log15" "github.com/netsec-ethz/rains/internal/pkg/keys" "g...
b6123da3e11ca294f42f743ce0a7de5efd570f79
fba7657e5925c6fb26257ba5baefda038712cc2d
bububa/opentaobao
/model/fenxiao/SubOrderList.go
Go
go
8,240
permissive
package fenxiao // SubOrderList 结构体 type SubOrderList struct { // 建议废弃 Feature对象列表目前已有的属性: attr_key为 www,attr_value为1 表示是www子订单; attr_key为 wwwStoreCode,attr_value是www子订单发货的仓库编码; attr_key为 isWt,attr_value为1 表示是网厅子订单; attr_key为wtInfo,attr_value为网厅相关合约信息; attr_key为shipper,attr_value为cn表示菜鸟发货; attr_key为 storeCode,attr_va...
50abf18ed32ec2563f1003a30eef9f086fb2b396
d6099fcd29a86041bd7ac2ef8cbfb23c27ecae7a
segmentio/atlantis
/server/core/config/raw/autoplan.go
Go
go
949
permissive
package raw import ( "github.com/runatlantis/atlantis/server/core/config/valid" ) // DefaultAutoPlanWhenModified is the default element in the when_modified // list if none is defined. var DefaultAutoPlanWhenModified = []string{"**/*.tf*", "**/terragrunt.hcl"} type Autoplan struct { WhenModified []string `yaml:"wh...
6549331b74dafdf2ffb07ab75db47635c869e81f
8c5798afdf0788506a9788d3a34534bf8e7794ef
lingkio/benthos
/lib/processor/group_by_value.go
Go
go
5,253
permissive
package processor import ( "fmt" "time" "github.com/Jeffail/benthos/v3/internal/bloblang" "github.com/Jeffail/benthos/v3/internal/bloblang/field" "github.com/Jeffail/benthos/v3/internal/docs" "github.com/Jeffail/benthos/v3/lib/log" "github.com/Jeffail/benthos/v3/lib/message" "github.com/Jeffail/benthos/v3/lib...
a303cda82502d1768e8e526674b0570620a44278
2f8a0ba56e6d06137e78288ad8866b945162a641
huanwuji/go-play
/user/sort/SelectSort.go
Go
go
366
no_license
package main import "fmt" func selectSort(arr []int) []int { for i,l:=0,len(arr);i<l;i=i+1 { temp,idx := arr[i],i for j:=i;j<l;j=j+1 { if arr[j]<temp { temp,idx=arr[j],j } } if i!=idx { arr[i],arr[idx] = arr[idx],arr[i] } } return arr } func main() { arr := []int{45, 64, 34, 8, 4, 588, 7, 9...
4460031d45f9ce325de5d031362219aca2942c6c
fb2f6f3f32b281e6de6ebfbe3cdb0c51f941efad
kindermoumoute/snap
/control/plugin/client/grpc.go
Go
go
12,328
permissive
/* http://www.apache.org/licenses/LICENSE-2.0.txt Copyright 2015 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required ...
e22d455cb70622358cccebad842db4a44cd5bfc7
722dcabf3916a96a896a684f5612311d8a44b0d4
gidden/cloudlus
/Godeps/_workspace/src/github.com/gonum/blas/native/level3double_test.go
Go
go
670
no_license
// Copyright ©2014 The gonum 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 native import ( "testing" "github.com/rwcarlsen/cloudlus/Godeps/_workspace/src/github.com/gonum/blas/testblas" ) func TestDgemm(t *testing.T) {...
20f6876d6b5fabb84813c59b60fe3f95c26a7c23
fb0372b1b299eb458d26233e224fcec98ac91d04
Qolzam/ts-bootstrap
/pkg/stack/stack_test.go
Go
go
1,465
permissive
package stack import ( "strings" "testing" "github.com/Qolzam/ofc-bootstrap/pkg/types" ) func Test_applyTemplateWithAuth(t *testing.T) { clientID := "test_oauth_app_client_id" customersURL := "https://raw.githubusercontent.com/test/path/CUSTOMERS" templateValues := authConfig{ ClientId: clientID, Cus...
6bfc46d37600e0ff2f5a28d94bd178a5ec10795b
50814faf3c08f9523cbae13a0dda837744e9e35b
scottz64/obcsdk
/ledgerstresstest/nishi_draft_LedgerStressOneCliOnePeer.go
Go
go
4,762
no_license
package main import ( "fmt" "os" "strconv" "strings" "time" "obcsdk/chaincode" "obcsdk/peernetwork" "obcsdk/lstutil" ) /********** Test Objective : Ledger Stress with 1 Peer and 1 Client ************ * * Setup: 4 node peer network with security enabled * 1. Deploy chaincode * 2. Invoke 20K transactions ...
709b06766db42019f63c8e542d3453fda58bcbb6
14b07c3879cd385bf14031344bb927b177e59967
nju04zq/algorithm_code
/easy/125_Valid_Palindrome/valid.go
Go
go
873
no_license
package main import "fmt" func isAplhanumeric(c byte) bool { if c >= '0' && c <= '9' { return true } else if c >= 'a' && c <= 'z' { return true } else if c >= 'A' && c <= 'Z' { return true } else { return false } } func toLower(c byte) byte { if c >= '0' && c <= '9' { return c } else if c >= 'a' && ...
4da988b61ae4774ae917df36ac0f6f2bbaa0b8f0
1f30f1ab2634135d058be0c62f3e1d5989f38172
pulumi/pulumi
/tests/examples/examples_acceptance_test.go
Go
go
2,915
permissive
// Copyright 2016-2022, Pulumi Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
abdde51097091e45252f5673cc7b5548f8ab7312
fbbdc69ee92b54627271e8853c5a1349db891ad1
5112100070/Trek
/src/app/post-handler.go
Go
go
3,249
permissive
package app import ( "log" "net/http" "strconv" "strings" "github.com/gin-gonic/gin" constErr "github.com/5112100070/Trek/src/constants/error" "github.com/5112100070/Trek/src/global" gSession "github.com/5112100070/Trek/src/global/session" "github.com/5112100070/Trek/src/utils" ) func SendRequestItem(c *gi...
9dd74f9dabf208ccace3473181a15727cc103193
0cfab433d40b532a398f6743c6070ff4d879bff1
AnonymousCyberWarrior/zed
/zio/lakeio/writer.go
Go
go
7,106
permissive
package lakeio import ( "bytes" "fmt" "io" "strings" "github.com/brimdata/zed" "github.com/brimdata/zed/field" "github.com/brimdata/zed/lake" "github.com/brimdata/zed/lake/commits" "github.com/brimdata/zed/lake/data" "github.com/brimdata/zed/lake/index" "github.com/brimdata/zed/lake/pools" "github.com/bri...
876f0473b89cd1096e711222389a2136db3ac1b4
27e5a5b81c5c152dbf03223b4985ec8f3151ffab
rasyidmujahid/kyma
/components/console-backend-service/pkg/tracing/tracer.go
Go
go
2,927
permissive
// Base on https://github.com/99designs/gqlgen-contrib/blob/master/gqlopentracing/tracer.go, // contains the following modifications: // - shortens the name of the span created in StartOperationExecution method // - full graphQL query is stored in graphQL.query span tag package tracing import ( "context" "fmt" "gi...
d95117112fa2ffb580e92155d18c0b98b016f26b
5d83e7dd4e20c4ff53a8cb92f48eb1692dc452de
OskarStark/continuouspipe
/gcb-builder/vendor/k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/core/v1/fake/fake_persistentvolumeclaim.go
Go
go
4,452
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, ...
107cc35fe6cf1861ce7d04d0025f16447c10d5e8
f8b188f5cd26d1676688f918abb4ace9ed81c01d
ge7nic/GoodLock
/GoodMutex/goodmutex.go
Go
go
477
no_license
package goodmutex import ( tree "goodlock/LockTree" ) type GoodMutex struct { l chan int LockID int } var id int = 1 var critchan = make(chan int, 1) func NewMutex() *GoodMutex { var ch = make(chan int, 1) var gm GoodMutex critchan <- 1 gm = GoodMutex{ch, id} id++ <-critchan return &gm } func (gm Go...
65ea4168e213c9968021c17f59eb00bf50d973b5
42178bdbf00e901c4c449d8a646e499bd2f3e781
micro/micro
/cmd/options.go
Go
go
2,292
permissive
package cmd import ( "context" "github.com/urfave/cli/v2" ) type Option func(o *Options) type Options struct { // Name of the application Name string // Description of the application Description string // Version of the application Version string // Action to execute when Run is called and there is no sub...
569070994042b9c67cea5f35e0f2a9d5892134cd
30945eecccae88fc08290c597b14dcc589494dee
nasermirzaei89/chance
/int32_test.go
Go
go
607
permissive
package chance_test import ( "fmt" "github.com/nasermirzaei89/chance" ) func ExampleInt32() { fmt.Print(chance.Int32()) // Output: 583532949 } // Returns a random int32 with max of 10 func ExampleInt32_setMax() { fmt.Print(chance.Int32(chance.SetInt32Max(10))) // Output: -1764108444 } // Returns a random int...
8bb60a799e422dd48550b3b9d70959dc5f5da912
cafeb766dcb39eda8ac8b009530d2d67a16e0511
viccom/influxdb
/task/servicetest/servicetest.go
Go
go
24,961
permissive
// Package servicetest provides tests to ensure that implementations of // platform/task/backend.Store and platform/task/backend.LogReader meet the requirements of platform.TaskService. // // Consumers of this package must import query/builtin. // This package does not import it directly, to avoid requiring it too earl...
41ac8aa63e2f97c1baa5efedf26be62839221bac
454d7a9b5241ba670a09622970c12594c6ba1fc9
kubax2000/goment
/goment.go
Go
go
3,735
permissive
package goment import ( "errors" "time" "github.com/kubax2000/goment/locales" ) var timeNow = time.Now // Goment is the main class. type Goment struct { time time.Time locale locales.LocaleDetails } // DateTime is a class to define a date & time. type DateTime struct { Year int Month int Day ...
60a5bb91075026977d1cc02c4a4b55836962cf58
8d47c72bac9b958bd24ee4930ddf656164b24582
jwhy89/goalert
/devtools/mockslack/state.go
Go
go
1,615
permissive
package mockslack import ( "sync" "time" ) type state struct { mx sync.Mutex gen *idGen flags struct { autoCreateChannel bool } apps map[string]*appState channels map[string]*channelState tokens map[string]*AuthToken users map[string]*userState tokenCodes map[string]*tokenCode } func...
3d8a1a88dab4dd9ce182e83d13db1d0d177aaa5a
55f0e97c32bb986fb6de1382efc7fdb608cf0237
keybase/go-merkle-tree
/doc.go
Go
go
2,095
permissive
/* Package merkleTree is a generic Merkle Tree implementation, for provably publishing lots of data under one succinct tree root. Install: go get github.com/keybase/go-merkle-tree Design: This package outputs a MerkleTree with two types of nodes: interior index nodes, or iNodes, and exterior data nodes, of Leaf no...
51d9522147f8a1507c6611c4592fe75c17ca1e9b
ea6ecbcbd28b47486938617cd227f3fe3ab14987
huaweicloud/huaweicloud-sdk-go-v3
/services/dataartsstudio/v1/model/model_job_log_request.go
Go
go
464
permissive
package model import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" "strings" ) type JobLogRequest struct { // 桥接作业id BridgeId string `json:"bridge_id"` // 分类作业id ClassificationId *string `json:"classification_id,omitempty"` } func (o JobLogRequest) String() string { data, err := utils.Marshal...
96a4da195355d5c1763d174001e342d145311c17
4bb7b19faf49a89cabda57421eba50f79eb12193
cloudfoundry/app-autoscaler-release
/src/autoscaler/eventgenerator/client/log_cache_client_test.go
Go
go
14,003
permissive
package client_test import ( "context" "crypto/tls" "errors" "net/http" "net/url" "path/filepath" "reflect" "strconv" "time" gogrpc "google.golang.org/grpc" "google.golang.org/grpc/credentials" logcache "code.cloudfoundry.org/go-log-cache" . "code.cloudfoundry.org/app-autoscaler/src/autoscaler/eventgen...
7271452907d263a60e34c96ab1790a3260eb0552
eaf7656087d603076b5c89b43ac15efa0c704f4a
jltrade/api-connectors
/clients/go/api_response.go
Go
go
1,252
permissive
/* * BitMEX API * * REST API for the BitMEX.com trading platform.<br><br><a href=\"/app/restAPI\">REST Documentation</a><br><a href=\"/app/wsAPI\">Websocket Documentation</a> * * OpenAPI spec version: 1.2.0 * Contact: support@bitmex.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * * Li...
6dc1e2afef8994a00ec911cf891eab3e7dc99aab
62795d8a945e4005efdf43584b477e37a2f8ba89
cloudfoundry/stratos
/src/jetstream/plugins/kubernetes/get_release.go
Go
go
6,235
permissive
package kubernetes import ( "encoding/json" "fmt" "io/ioutil" "time" "github.com/gorilla/websocket" "github.com/labstack/echo/v4" log "github.com/sirupsen/logrus" "helm.sh/helm/v3/pkg/action" "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/kubernetes/helm" "github.com/cloudfoundry-incubat...
be2dc14fb7e43e10e99c0fc327d2a8df13a01705
8b1f15e28a6af0bb77d659ea48919cc8c8028025
AlexxNica/aws-operator
/service/resource/cloudformationv2/adapter/security_groups_test.go
Go
go
4,389
permissive
package adapter import ( "reflect" "testing" "github.com/giantswarm/apiextensions/pkg/apis/provider/v1alpha1" ) func TestAdapterSecurityGroupsRegularFields(t *testing.T) { testCases := []struct { description string customObject v1alpha1.AWSConfig expectedError ...
78226c8190f8106349373e0fe7ca9a1fbecf9e2d
dca320d87942f4a204ba1c11c61300f979d9d0ba
akospinter/libpod
/vendor/github.com/containers/common/pkg/config/default.go
Go
go
10,465
permissive
package config import ( "bytes" "os" "os/exec" "path/filepath" "regexp" "strconv" "github.com/containers/common/pkg/unshare" "github.com/containers/storage" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) const ( // _conmonMinMajorVersion is the major version required for conmon. _conmonMinMajorVe...
2296094575f3f99ce789fa27745e54cf09379f84
04ba6e612aa088941a520ec8bcad6f60a479d267
mingpengxiao/cayley
/db/repl.go
Go
go
4,783
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...
6ae771136feeeb551c4be412d44e68e28064a756
74e0d7b1d290d4687c03913f1f333bc80181724a
abieberbach/goplane
/goplane.go
Go
go
485
permissive
//Copyright (c) 2015. The goplane AUTHORS. All rights reserved. // // Use of this source code is governed by a license that can be found in the LICENSE file. package goplane import ( "crypto/rand" "fmt" ) func IdGenerator() string { buffer := make([]byte, 16) rand.Read(buffer) return fmt.Sprintf("%X-%X-%X-%X-%...
b0d64c0fb055dad37d97aa5f5777d5d6d0c1a56c
0573cec76f71e334a72899f35a54499b087a4fb9
kendra904/integreatly-operator
/pkg/products/solutionexplorer/reconciler.go
Go
go
15,416
permissive
package solutionexplorer import ( "context" "encoding/json" "fmt" "strings" "github.com/integr8ly/integreatly-operator/version" "github.com/integr8ly/integreatly-operator/pkg/resources/events" "github.com/integr8ly/integreatly-operator/pkg/resources/owner" "github.com/sirupsen/logrus" "github.com/integr8l...
86f281d7e7ce74d14bcf524ddf8586767950bac2
2b05ef67f3c4eba7ec4d0f23205daba32d0d02c5
crackdog/ts3chatter
/server/server.go
Go
go
4,803
permissive
//Package server contains the ts3chatter server. package server import ( "fmt" "github.com/crackdog/ts3sqlib" "log" "net/http" "strconv" "sync" "time" ) //Server contains the ts3 sq connection and other ts3 server data. type Server struct { ts3conn *ts3sqlib.SqConn servemux *http.ServeMux data ...
84fe3f27488a53097df65a2126d0502059661c91
93855ea22e5260ec8bb9e2bfd007075fe40af834
gombadi/dnsseeder
/vendor/github.com/btcsuite/btcd/txscript/engine.go
Go
go
20,686
permissive
// Copyright (c) 2013-2015 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package txscript import ( "fmt" "math/big" "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/wire" ) // ScriptFlags is a bitmask defining additional oper...
a109368260ffe860456478ce314eea354af0d3d3
790e86033580f23eb48acdccf9409c0677471de0
Technotects/app-functions-sdk-go
/internal/security/secret_test.go
Go
go
9,989
permissive
// // Copyright (c) 2020 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed ...
e8184c191c3a54a44081ff9098babbc59c13981a
5e59c7cd6e1fdfdceb658ef2cc4bdcf0ecfa3201
golint-fixer/bmutil
/wire/internal_test.go
Go
go
2,277
permissive
// Originally derived from: btcsuite/btcd/wire/internal_test.go // Copyright (c) 2013-2015 Conformal Systems LLC. // Copyright (c) 2015 Monetas // Copyright 2016 Daniel Krawisz. // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. /* This test file is part of the wire.pac...
9837993eeba624ecd37b21786a1224e3a8464062
2a36fd14eb0d2be13e82ef43f56697539c760bce
sh4nnongoh/goyaml
/types-yaml.go
Go
go
416
no_license
package main type Yaml struct { ApiVersion string Metadata metadata Specification Specification } type metadata struct { Name string Label string } type Specification struct { Endpoint []endpoint Transport []transport } type endpoint struct { Name string Input input Output []interface{} } ty...
f623ca120dd40bb1559e01721a1fd508a5f68b83
3b9f79ca3b1b687574d2f3b94113cffbbbee9d20
apernet/hysteria
/core/transport/server.go
Go
go
2,843
permissive
package transport import ( "net" "strconv" "time" "github.com/apernet/hysteria/core/sockopt" "github.com/apernet/hysteria/core/utils" ) type ServerTransport struct { Dialer *net.Dialer SOCKS5Client *SOCKS5Client ResolvePreference ResolvePreference LocalUDPAddr *net.UDPAddr LocalUDPIntf...
8a7dd3e3ae84f0cb827e794686ba98053a60ebd2
30b07ee9d883bd13323e413a69402af933e68aa8
hanneshofmann/go-c8y-cli
/pkg/fileutilities/fileutilities.go
Go
go
1,195
permissive
package fileutilities import ( "fmt" "os" "os/exec" "runtime" ) // CreateDirs create directory. All non-existing nested paths will be created. // The folder owner will also be changed to match the current user (on non-windows systems only) func CreateDirs(p string) error { if p == "" { return nil } if err :=...
c95a7d0a14eb079eae8592a61de9bcb4503ce406
96997e54080724aebe668c032834e940df3588c5
HoshinoSyou/Advance-Study
/workThree/service/create.go
Go
go
326
no_license
package service import ( "github.com/gin-gonic/gin" "github.com/gorilla/websocket" "github.com/satori/go.uuid" ) func Create(c *gin.Context, conn *websocket.Conn) { cl := &Client{ uuid.NewV4().String(), c.Param("Username"), conn, make(chan []byte)} CS.Login <- cl go Surf(cl) go Input(cl) } //创建客户端
66a4dd11c71386f3bbe43245841693ef547b3cd2
7d25c653e65dfc4348725ac3f3a6c4d8f86b8550
kcmerrill/alfred
/pkg/alfred/for.go
Go
go
1,805
permissive
package alfred import ( "strings" ) func forC(task Task, context *Context, tasks map[string]Task) { if task.For.Args == "" { return } if task.For.Tasks == "" && task.For.MultiTask == "" { // probably a typo ... lets error out outFail("for", "'args' set but missing 'tasks' or 'multitask'", context) task.E...
34efcb4e05a4b3d99fd673b14993920d386bfdd9
8d5666c5f92d9675328f49f27e6d9d5e5f573a5d
suskin/stack-gcp
/pkg/controller/storage/bucket.go
Go
go
9,362
permissive
/* Copyright 2019 The Crossplane 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, sof...
a4c5e1aa5ea50769886ff27df665e819f7869221
ae8464069fe21c3280165748682d41f667dd50fb
timakin/octop
/command/pr.go
Go
go
1,026
no_license
package command import ( "github.com/timakin/octop/client" "fmt" "log" "net/url" "github.com/codegangsta/cli" "github.com/fatih/color" "github.com/pkg/errors" "github.com/timakin/octop/repl" ) func CmdPr(c *cli.Context) { baseUrl := "" if c.String("enterprise") != "" { gheHost := c.String("enterprise") ...
b78e343ee782fc2af589396990a292bf42cedbf6
b8d3b043a85e56f3411240048f56aa547e7aacbf
smosindi/hello
/numbers.go
Go
go
425
no_license
package main import ( "fmt" ) func main() { sum := 0 for i := 0; i < 1000; i++ { if i%3 == 0 || i%5 == 0 { hold := sum sum = sum + i fmt.Println(hold, " + ", i, " = ", sum) //fmt.Println("FizzBuzz") } /*else if i%3 == 0 { //fmt.Println("Fizz") } else if i%5 == 0 { //fmt.Println("Bu...
751b63b5d2850b0c91251fb260739875d000fbbe
de66cbffb99ff27788d3fb328731b2d86b031477
kubehippie/database-operator
/pkg/config/config.go
Go
go
445
permissive
package config // Server defines the general server configuration. type Server struct { Addr string Kubeconfig string } // Logs defines the level and color for log configuration. type Logs struct { Level string Pretty bool } // Config is a combination of all available configurations. type Config struct { ...
8be558312ed175c2a019800de998b5441dbab175
1c159b4dc6b48c927af30679be35fa3ef780363f
ContainerSolutions/flux
/service/instance/multi.go
Go
go
939
permissive
package instance import ( "github.com/go-kit/kit/log" "github.com/pkg/errors" "github.com/weaveworks/flux/history" "github.com/weaveworks/flux/service" "github.com/weaveworks/flux/service/bus" ) type MultitenantInstancer struct { DB DB Connecter bus.Connecter Logger log.Logger History history.DB...
08f62b1892e9380be33dcf40dc050096e48c5631
400db81da232dfe2fe1f26129f14b6bc62968e8a
surfyst/jvm.go
/jvmgo/rtda/class/constant_pool.go
Go
go
1,942
permissive
package class import ( cf "github.com/zxh0/jvm.go/jvmgo/classfile" ) type Constant interface{} type ConstantPool struct { class *Class consts []Constant } func newConstantPool(owner *Class, cfCp *cf.ConstantPool) *ConstantPool { cpInfos := cfCp.Infos() consts := make([]Constant, len(cpInfos)) rtCp := &Consta...
f56a66dca2e1f8a1d76b1a99b46a815b4744c56c
c3237549b1d89c1fa396fd45f94d18dfbcba1d90
7shu/ketchup
/util/gots/main.go
Go
go
1,434
permissive
// package gots (or go-ts) is responsible for converting structs into // typescript models. Has limited support for protobuf generated structs, // specifically `oneof` and `enum` types package main import ( "fmt" "os" router_api "github.com/octavore/nagax/proto/nagax/router/api" "github.com/octavore/pbts" "git...
728bc3692a76665bbe5bdf40cb262f1698d00801
91e1656180dbcb1158290daf49087aa3b61afe58
peterlabuschagne/replay
/handle.go
Go
go
3,834
no_license
package replay import ( "github.com/golang/protobuf/proto" "github.com/luno/reflex" "github.com/corverroos/replay/internal" ) // Handle provides an event handler for custom replay event consumers, // most notably workflow output consumers. It abstracts the replay encoding internals. // // Note that handling proto...
9213a7a3481d331b8b9d7b11c801a5e38e751bbd
c958dd5d1af93f206af33c5617bf2d31546b5096
hfeeki/bingo
/rest/handler_test.go
Go
go
2,908
permissive
package rest import ( "net/http" "net/http/httptest" "net/url" "testing" ) func run_test_request(t *testing.T, handler *ResourceHandler, method, url_str, payload string) *httptest.ResponseRecorder { url_obj, err := url.Parse(url_str) if err != nil { t.Fatal(err) } r := http.Request{ Method: method, URL...
caa4a7492a2e42f02248c0a2265be5dd801298cd
dad7bf6afb79ceb2d09ba541cb2b377c38955441
ledongthuc/dialogflow-go-client
/models/entity.go
Go
go
485
permissive
package models type Entity struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` Preview string `json:"preview,omitempty"` IsOverridable bool `json:"isOverridable,omitempty"` IsEnum ...
fa95dfaa74611c7e074f8aec9ec1eb825efd3ce1
2d05512e8e78d4c809b1c9bbb42b3fa3728245ac
feng-du/risk-monitor-server
/client/core/subscribers/TunnelRealFundRtn.go
Go
go
3,514
no_license
package subscribers import ( "context" "encoding/json" "time" "github.com/fengdu/risk-monitor-server/client/core" pb "github.com/fengdu/risk-monitor-server/pb" log "github.com/sirupsen/logrus" ) type TunnelRealFundRtnDto struct { ActionKey string `json:"ActionKey"` ActionFlag uint32 `json:...
0d47e88d931d67e27c06f6a9896d351270664006
ba5c2e2f3d3f11d06aacee6cd93028af4b6bb1ba
golang/gofrontend
/libgo/go/sort/slice.go
Go
go
1,423
permissive
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sort // Slice sorts the slice x given the provided less function. // It panics if x is not a slice. // // The sort is not guaranteed to be stable: equa...
ef9ecbbffb1f73063f76cd29c51f06aa6a49770a
21737a47c9fb614bfb39f93b5a87898cf436e097
rickb777/sqlapi
/driver/dialect_test.go
Go
go
3,279
permissive
package driver import ( "bytes" "testing" . "github.com/onsi/gomega" "github.com/rickb777/sqlapi/schema" "github.com/rickb777/where/quote" ) // assertion of conformance var _ StringWriter = &bytes.Buffer{} func TestQuote(t *testing.T) { g := NewGomegaWithT(t) cases := []struct { q quote.Quoter ex...
a279052dd796890ffae1a88d878bda060215b0cd
a3809dd6dd1e3dc76afcc492d83d9168071aa5bb
till213/back-to-school
/apps/array/oneaway/oneaway_test.go
Go
go
642
permissive
package main import ( "testing" ) const n = 1024 func TestOneDelete(t *testing.T) { str1 := "pale" str2 := "ple" if !oneAway(str1, str2) { t.Errorf("%v, %v, expected true", str1, str2) } } func TestOneInsert(t *testing.T) { str1 := "pale" str2 := "pales" if !oneAway(str1, str2) { t.Errorf("%v, %v, expec...
6732165c891a26994ccfbf1b48372f92454d8315
b907c69bd55872371933a362b1d101d8ec2dc591
iuouiyiuty/bitshares
/operations/proposalcreateoperation_test.go
Go
go
597
permissive
package operations import ( "github.com/iuouiyiuty/bitshares/gen/data" "github.com/iuouiyiuty/bitshares/types" ) func (suite *operationsAPITest) Test_ProposalCreateOperation() { op := ProposalCreateOperation{ Extensions: types.Extensions{}, } sample, err := data.GetSampleByType(op.Type()) if err != nil { s...
73e01aca4ab882b9c53212d6a96d058b4bd9ea93
c6337a92ed003004647d7bbdd6fde287223f4b1a
stungkit/cadence
/service/history/failover/marker_notifier_test.go
Go
go
4,865
permissive
// The MIT License (MIT) // // Copyright (c) 2017-2020 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 right...
7b533c18c63b0deaa86cc085ceda42b20da67a27
3366cba3de8fe5da3f1aa5a69d52797aeec30a9a
kenwang815/shopping
/rest/content/content.go
Go
go
429
no_license
package content type Content interface { Code(int) Content Msg(string) Content Data(interface{}) Content } type content map[string]interface{} func (c content) Code(code int) Content { c["code"] = code return c } func (c content) Msg(msg string) Content { c["msg"] = msg return c } func (c content) Data(d in...