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
cdea369e4d1e1f349ea5ac4fe0bc358da0a06f2f
0bcd852098bc5c8fc5dfa6d34d49202449770ac4
sevico/jsonIter
/value_tests/float_test.go
Go
go
4,248
permissive
package test import ( "bytes" "encoding/json" "fmt" "github.com/sevico/jsonIter" "github.com/stretchr/testify/require" "strconv" "testing" ) func Test_read_float(t *testing.T) { inputs := []string{ `1.1`, `1000`, `9223372036854775807`, `12.3`, `-12.3`, `720368.54775807`, `720368.547758075`, `1e1`, `1e+1`,...
ddf1d4f78842bf9b9dcc665c472ad8bd4d89a8fb
985d4e160299072f182e26fec9558d650f8f6d19
splace/signals
/combiners_test.go
Go
go
1,148
permissive
package signals import ( "fmt" "strings" ) func PrintGraph2(s Signal, start, end, step x) { for t := start; t < end; t += step { fmt.Println(s.property(t), strings.Repeat(" ", int(s.property(t)/(unitY/33))+33)+"X") } } func ExampleCombinersSequenced() { PrintGraph2(NewSequence(Pulse{unitX},Pulse{unitX}), 0, 3...
91525c7a83e4611b2d45609f28ee7f60f9b443ef
69882fa21cba80c215070c3d30a2452fc1b3c6a4
Legion2/flux2
/cmd/flux/create_secret_tls.go
Go
go
3,038
permissive
/* Copyright 2020, 2021 The Flux 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, s...
fc14b9ff7039e053a437817a2b829abb2e4f1532
f50b8c8a6bb493998728b29cb9fbca5cff91af0c
apostrophedottilde/zenfighter-api
/providers/database/knight.go
Go
go
2,794
no_license
package database import ( "database/sql" "fmt" "os" "strconv" "bitcrunchy.com/zenfighter-api/domain" ) var ( dbName = os.Getenv("dbName") dbHost = os.Getenv("dbHost") dbPort = os.Getenv("dbPort") dbUser = os.Getenv("dbUser") dbPass = os.Getenv("dbPass") dbType = "mysql" ) type knightRepository struct { }...
db6d738a4056fcd9242f2b937783e3826f56bb87
9b003b66eb42171ebc0be9897ca1ff5166e65aec
sshyran/runtime
/virtcontainers/container_test.go
Go
go
12,755
permissive
// Copyright (c) 2017 Intel Corporation // // SPDX-License-Identifier: Apache-2.0 // package virtcontainers import ( "context" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "syscall" "testing" ktu "github.com/kata-containers/runtime/pkg/katatestutils" "github.com/kata-containers/runtime/virtcontaine...
df08d25810b6c708d6a52ccdd9ecd6107d4bc66a
8f65e23d55a823eaf4c8bf94e56a15f4aa4b6c83
lucassabreu/clockify-cli
/pkg/cmd/time-entry/show/show.go
Go
go
2,237
permissive
package show import ( "github.com/MakeNowJust/heredoc" "github.com/lucassabreu/clockify-cli/pkg/cmd/time-entry/util" "github.com/lucassabreu/clockify-cli/pkg/cmdcompl" "github.com/lucassabreu/clockify-cli/pkg/cmdutil" "github.com/lucassabreu/clockify-cli/pkg/timeentryhlp" "github.com/lucassabreu/clockify-cli/pkg...
b8008fb6f5f07f88a216765e9373178a65cd0dc2
075cded70ee6e95cf9f6eef5ae242011c3e52c4e
earlgreyz/dhcp
/iana/hwtypes.go
Go
go
2,376
permissive
package iana type HwTypeType uint8 const ( _ HwTypeType = iota // skip 0 HwTypeEthernet HwTypeExperimentalEthernet HwTypeAmateurRadioAX25 HwTypeProteonTokenRing HwTypeChaos HwTypeIEEE802 HwTypeARCNET HwTypeHyperchannel HwTypeLanstar HwTypeAutonet HwTypeLocalTalk HwTypeLocalNet HwTypeUltraLink HwTypeSMD...
d96065f2b657552a4752d4d7bbacfce5384d495c
40b43dd49a8e58d9690df5ff44069f06da1444d0
ipfs/go-log
/core_test.go
Go
go
4,454
permissive
package log import ( "bytes" "testing" "time" "go.uber.org/zap/zapcore" ) func TestNewCoreFormat(t *testing.T) { entry := zapcore.Entry{ LoggerName: "main", Level: zapcore.InfoLevel, Message: "scooby", Time: time.Date(2010, 5, 23, 15, 14, 0, 0, time.UTC), } testCases := []struct { for...
1f094fc3ccaef1b8d0b5ca07be099ea14c51f049
563a8955a2ee3c4a596b3755220022a792e58473
zhangwei188393/beegoblog
/routers/router.go
Go
go
836
permissive
package routers import ( "beegoblog/controllers" "github.com/astaxie/beego" ) func init() { beego.Router("/", &controllers.HomeController{}) beego.Router("/register", &controllers.RegisterController{}) beego.Router("/login", &controllers.LoginController{}) beego.Router("/exit", &controllers.ExitController...
1180fa1bbbfe12fb495a9070bf88e3e30d2a1b49
f713947326fd1603e16b382d3bb69ab7a448568d
Azure/aad-pod-identity
/pkg/crd/crd.go
Go
go
29,770
permissive
package crd import ( "context" "encoding/json" "fmt" "reflect" "strings" "time" aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity" aadpodv1 "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1" "github.com/Azure/aad-pod-identity/pkg/metrics" "github.com/Azure/aad-pod-identity/pkg/...
2a1c6e00d1bfe0dbaea040a68106476cd9357008
f328860ae4cfcc50eb82ba1165a267f05d2238ce
CPT-Jack-A-Castle/istio
/pkg/istio-agent/grpcxds/grpc_bootstrap.go
Go
go
5,268
permissive
// Copyright Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...
a7dc38ef8537d0433e313e8d4045600e39cadeb7
3cd41b2b7a07e6f7343993ca4fdfc4ec9c3f644b
insionng/qor
/admin/meta.go
Go
go
11,072
permissive
package admin import ( "bytes" "database/sql" "encoding/json" "fmt" "reflect" "regexp" "strconv" "strings" "time" "github.com/jinzhu/gorm" "github.com/jinzhu/now" "github.com/qor/qor" "github.com/qor/qor/media_library" "github.com/qor/qor/resource" "github.com/qor/qor/roles" "github.com/qor/qor/utils"...
dd253418cc806bc6b14b07e0dd6dc8eb2fe1b2d3
a1ba63144dad6f9005c5151df6536aec1a762922
machmum/gorest
/utl/mock/mockrds/refresh.go
Go
go
569
no_license
package mockrds import ( "github.com/go-redis/redis" ) // Refresh database mock type Refresh struct { SaveFn func(rdb *redis.Client, data interface{}, key, index string, lifetime uint) error DeleteFn func(rdb *redis.Client, key, index string) error } // FindByUsername mock func (r *Refresh) Delete(rdb *redis.Cl...
3f4459ff54965f459c3df487a9f75cd27902f5de
996cd00d7acdb167271eb81c912ba6ffaa7940a5
allthatjazzleo/ethermint
/ethereum/rpc/pubsub/pubsub_test.go
Go
go
1,450
permissive
package pubsub import ( "log" "sync" "testing" "time" "github.com/stretchr/testify/require" coretypes "github.com/tendermint/tendermint/rpc/core/types" ) func TestAddTopic(t *testing.T) { q := NewEventBus() err := q.AddTopic("kek", make(<-chan coretypes.ResultEvent)) require.NoError(t, err) err = q.AddTop...
adadb5d5a709e130447594a704caa4f94dddc7ee
1062bd8be8ab8c259a59ace2a812d911c3f2cfea
changsongyang/mongocli
/internal/cli/atlas/onlinearchive/update.go
Go
go
2,634
permissive
// Copyright 2020 MongoDB 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...
efc1349c4babb45acdd68cc3ad2e78537ea39e72
048d0e4d60cd31ddf1da7574db6b659a11ac4828
lirm/aeron-go
/aeron/const.go
Go
go
840
permissive
// +build darwin freebsd // Copyright 2016 Stanislav Liberman // // 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...
5696e079c731ba4a6545ad93ac2c8ad31d123930
1fe09bd8ae0070418d7ebbc323cbd1f24acbe06c
bybit-exchange/api-connectors
/swagger-gen/go/model_linear_search_stop_order_result.go
Go
go
1,111
no_license
/* * Bybit API * * ## REST API for the Bybit Exchange. Base URI: [https://api.bybit.com] * * API version: 0.2.10 * Contact: support@bybit.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package swagger type LinearSearchStopOrderResult struct { StopOrderId string ...
a529a59dbdead8f3c72e575e1e1d2f0f9b3025e5
7da2fc74dae12b0b4adb5b24dccb4ff16a3a7d4c
bigrocs/micro
/new/new.go
Go
go
9,736
permissive
// Package new generates micro service templates package new import ( "fmt" "go/build" "os" "path" "path/filepath" "runtime" "strings" "text/template" "time" "github.com/micro/cli/v2" tmpl "github.com/micro/micro/v2/internal/template" "github.com/micro/micro/v2/internal/usage" "github.com/xlab/treeprint"...
0cff01ec6e8a5e52a7e09be275094825ade18623
5c49bbf130f60756c53f90256cd0087985aa8703
NaveenPantra/Golang
/constants/04.go
Go
go
986
no_license
package main import "fmt" const ( _ = iota //iota = 0 (This is a blank identifier just throw away the iota = 0) KB = 1 << (iota * 10) //iota = 1 MB = 1 << (iota * 10) //iota = 2 GB = 1 << (iota * 10) //iota = 3 TB = 1 << (iota * 10) //iota = 4 ) func main() { fmt.Printf("The cosntants: ") fmt.Pri...
e1110f9490069899e8b097faf37d4ed7d28e263d
85070283eafc243977faae01a135b6c0a35bfec7
GoogleCloudPlatform/declarative-resource-client-library
/unstructured/google/gkehub/alpha/membership.go
Go
go
24,947
permissive
// Copyright 2023 Google LLC. 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 applica...
f4303da99f578ea262fe5e3f0fa0481b0bdb0638
c72c3d4aca34a51ffabd6a661213e51a8d8bbb17
stpolar/extendingress-controller
/vendor/golang.org/x/sys/unix/syscall_bsd.go
Go
go
17,280
permissive
// Copyright 2009 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 darwin dragonfly freebsd netbsd openbsd // BSD system call wrappers shared by *BSD based systems // including OS X (Darwin) and FreeBSD. Like...
38a6c5ee7e4cf5f44d0595010429e024873833e3
683f8716dfe20cb940b442258ef0e6ed1625144e
mattermost/mattermost-cloud
/internal/tools/aws/route53_test.go
Go
go
3,334
permissive
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. // package aws import ( "context" "github.com/aws/aws-sdk-go-v2/service/route53" "github.com/golang/mock/gomock" testlib "github.com/mattermost/mattermost-cloud/internal/testlib" "github.com/pkg/error...
d5eb0c71ddd8dfe105419310c999e89504c0923d
b027eb724f031dc71659d71a6f6b4473ec52efba
itirnil/insolar
/network/interfaces.go
Go
go
13,627
permissive
// // Modified BSD 3-Clause Clear License // // Copyright (c) 2019 Insolar Technologies GmbH // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted (subject to the limitations in the disclaimer below) provided that // the following conditions a...
8b8a6e691776ffcc0f28b95c860aaa410f844ac7
6639d0c4c9af19dc36916335e46883506ce7ef3e
amckinney/fx
/config/yaml_test.go
Go
go
20,448
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...
f357977231c3cc9cdc7e9f95ce7de29b74f3ef61
858072bde56fcd97cb560981c8d2200ce9c4debe
jmptrader/go-charset
/charset/iconv/iconv.go
Go
go
4,483
no_license
// The iconv package provides an interface to the GNU iconv character set // conversion library (see http://www.gnu.org/software/libiconv/). // It automatically registers all the character sets with the charset package, // so it is usually used simply for the side effects of importing it. // Example: // import ( // ...
455fbcf79efb43469063f88ca0333fef79a92d20
26b99a2f4fe84e7110bde6d7b3c3ba3e37b3bf6b
munnerz/kubernetes
/pkg/registry/persistentvolumeclaim/strategy.go
Go
go
4,497
permissive
/* Copyright 2014 The Kubernetes 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 applicable law or ag...
5a34f2c4b43cad794b9f83355858bf7bdbb7519d
b0571c618138094a762f7c348ee8b5f2717626fc
ysoftman/codingtest
/leetcode/minimum_index_sum_of_two_lists.go
Go
go
3,363
no_license
/* https://leetcode.com/problems/minimum-index-sum-of-two-lists/ 599. Minimum Index Sum of Two Lists Easy Given two arrays of strings list1 and list2, find the common strings with the least index sum. A common string is a string that appeared in both list1 and list2. A common string with the least index sum is a comm...
9323ad68e7d2afe806f2e2967f5b3c25f6197319
8acfc02d5972f0d5e1e4a92c68796f51799867b3
AccelByte/accelbyte-go-sdk
/samples/cli/cmd/achievement/globalAchievements/claimGlobalAchievementReward.go
Go
go
2,167
permissive
// Copyright (c) 2021 AccelByte Inc. All Rights Reserved. // This is licensed software from AccelByte Inc, for limitations // and restrictions contact your company contract manager. // Code generated. DO NOT EDIT. package globalAchievements import ( "github.com/AccelByte/accelbyte-go-sdk/achievement-sdk/pkg/achieve...
d1ebe98c0bce24f7a58b9fd49bace76f0b01f74b
17df327d90c73e986a4daf20cb0215ffd86a9676
hdac-io/friday
/x/genaccounts/legacy/v0_36/types.go
Go
go
1,713
permissive
// DONTCOVER // nolint package v0_36 import ( sdk "github.com/hdac-io/friday/types" ) const ( ModuleName = "accounts" ) type ( GenesisAccount struct { Address sdk.AccAddress `json:"address" yaml:"address"` Coins sdk.Coins `json:"coins" yaml:"coins"` Sequence uint64 `json:"seq...
699f8eeddb81bce642443e28ce47ba4686b7263a
45ab59dd78ca8ad516562b60d82d967a57cdd7b0
rbouikila/gitea
/models/login/oauth2.go
Go
go
2,172
permissive
// Copyright 2017 The Gitea 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 login import ( "fmt" "code.gitea.io/gitea/models/db" ) // ________ _____ __ .__ // \_____ \ / _ \ __ ___/ |_| |__ // ...
c69fce2b5628621f5b5cfd5eecd46c628efb6647
4e2ec1a7b2bf826d9accd094d4fd6238fefdec7a
liaoliaopro/surgemq
/service/client.go
Go
go
6,135
permissive
// Copyright (c) 2014 The SurgeMQ 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 ...
09042014a94a445c51147e469ad3c9633017347d
65887295c4dd3b76c321397b8f9afdd51c77aac1
equinor/radix-api
/api/jobs/job_controller_test.go
Go
go
8,106
permissive
package jobs_test import ( "context" "fmt" "testing" secretsstorevclient "sigs.k8s.io/secrets-store-csi-driver/pkg/client/clientset/versioned" secretproviderfake "sigs.k8s.io/secrets-store-csi-driver/pkg/client/clientset/versioned/fake" "github.com/equinor/radix-operator/pkg/apis/pipeline" v1 "github.com/equi...
cb0f243406cf953518785b0f906040185b1b8fda
9dd2ea8b86baa98a3a68c58cbfa931d65ad01718
senghoo/exercism
/go/secret-handshake/secret_handshake.go
Go
go
622
no_license
package secret var secretCode = []struct { code int h string }{ {1, "wink"}, {2, "double blink"}, {4, "close your eyes"}, {8, "jump"}, } var ( secretLen int = len(secretCode) reverse int = 1 << uint(secretLen) allCode int = reverse - 1 ) func Handshake(val int) []string { res := make([]string, 0, 4)...
c1e107fd1da715ce995abebb7fc005a14d41975f
448c42304b030db2ed021dcc81d5f58bf1bd9836
chroblert/Z0SecT00ls
/main.go
Go
go
222
no_license
package main import ( "github.com/chroblert/Z0SecT00ls/jcmd" "github.com/chroblert/Z0SecT00ls/jvendor/github.com/desertbit/grumble" ) func main() { //jcmd.RootCmd.Execute() //jcmd.Execute() grumble.Main(jcmd.App) }
afc9faaedf5bdeb06ebdf1cfee0c3f3fce026172
f279c37d5b1bb1c4e00b67fd6345d23af89247d7
chadit/GoSamples
/selenium/selenium.go
Go
go
7,919
no_license
package main import ( "fmt" "math" "os/exec" "regexp" "sort" "strconv" "strings" "time" "github.com/tebeka/selenium" ) var code = ` package main import "fmt" func main() { fmt.Println("Hello111 WebDriver!\n") } ` func main() { fmt.Println("start") isServiceUp := isSeleniumServiceRunning() if isServic...
0b9c2ddb9130999f0ffcae151aa8d9a374232618
5b3fb1d1abeefb06245de2e61eaf4809509b5621
leaddevops/kubernetes
/pkg/registry/core/service/rest.go
Go
go
21,708
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, ...
286072f8a1faca3bc81057be65f5505c58d23b16
860dcb28008835f2e9c3ba7de1d8a20ffd019a44
shengjun1985/milvus
/internal/util/retry/retry_test.go
Go
go
2,373
permissive
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
2ef06fd3ae773a8caadbea6df402661c42a58eb9
c615efaeaf30382f1b85effcadba237c2213b920
itsubaki/gostruct
/builder_test.go
Go
go
485
permissive
package gostruct_test import ( "fmt" "github.com/itsubaki/gostruct" ) func Example() { person := gostruct.New(). AddString("Name"). AddInt64("Age"). Build() p := person.New() p.SetString("Name", "gopher") p.SetInt64("Age", 11) fmt.Printf(" %T: %+v\n", p.Interface(), p.Interface()) fmt.Printf("%T: %+...
fa80d25acd91b5c1f216d4620fb21b5bb2e0f623
13d758d8c050940ae1cfff2f47b782dcaeaa3977
thecharge/iso20022
/tsin/InvoiceAssignmentNotificationV01.go
Go
go
3,316
permissive
package tsin import ( "encoding/xml" "github.com/fgrid/iso20022" ) type Document00800101 struct { XMLName xml.Name `xml:"urn:iso:std:iso:20022:tech:xsd:tsin.008.001.01 Document"` Message *InvoiceAssignmentNotificationV01 `xml:"InvcAssgnmtNtfctn"` } func (d *Document00800101) AddMessage(...
159dfc00751e375c3764d2c870585436dd55e2eb
600fc21328d2798d115d57a71c245f68ca228d76
tomahawk28/cell
/restful/cell_server.go
Go
go
7,124
permissive
// Package restful provides RESTful API features to CellAdvisor package restful import ( "encoding/json" "expvar" "fmt" "log" "sync" "time" "net/http" "net/url" "github.com/gorilla/mux" "github.com/tomahawk28/cell" ) var ( sendSuccessCount = expvar.NewInt("sendSuccessCount") receiveSucessCount = exp...
e047fb9670a5fe78def01ca1e0e3f34d76cbb4bb
5fbaf46d74701d3de6c2e6b02930648b4d18ac5e
insighio/mainflux
/internal/clients/jaeger/tracer.go
Go
go
854
permissive
// Copyright (c) Mainflux // SPDX-License-Identifier: Apache-2.0 package jaeger import ( "errors" "io" "io/ioutil" "github.com/opentracing/opentracing-go" jconfig "github.com/uber/jaeger-client-go/config" ) var ( errNoUrl = errors.New("URL is empty") errNoSvcName = errors.New("Service Name is empty") ) ...
fef42f18c1c59c0124fd3e1aafa8aa5e52819475
edb37f9c7b7b52e7d81e9ca2c1220280ebe665de
rudyredhat/go_GetProgrammingWithGo
/17-Pointers/02/pointers_for_pointing.go
Go
go
289
no_license
package main import "fmt" func main() { var admin *string a1 := "rudy" admin = &a1 fmt.Println(*admin) a2 := "rudra" admin = &a2 fmt.Println(*admin) a2 = "abc" fmt.Println(*admin) *admin = "xyz" fmt.Println(*admin) fmt.Println(a2) } // rudy // rudra // abc // xyz // xyz
02395b685fbd41fd46500ffd894ff8a7c13a4780
119a10626cb9cdd361ebdba11b69700d90166b11
MaxStalker/cadence
/runtime/sema/type_tags.go
Go
go
24,969
permissive
/* * Cadence - The resource-oriented smart contract programming language * * Copyright Dapper 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/l...
7ee44b3fb56caf2a50122ecf1868ee7627e35c6d
0c941c66b45f47328e422f5cf36dbf739d4af571
sitedata/kato
/builder/api/router.go
Go
go
2,574
permissive
// Copyright (C) 2021 Gridworkz Co., Ltd. // KATO, Application Management Platform // 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 r...
e291e1ff94cd131bb0e5e30fd8a1e285d1f5b4c4
b39bc115b78a9a6be3fc79fcad2d5bd5e4b02b13
shiqinfeng1/lite-ethereum
/p2p/protocol.go
Go
go
2,761
no_license
// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License...
a928419c10373dd853e5b8c67e082428712679a6
fc7260fc51f17b4dd67dfc4b48204b30d7348f7f
yusufyilmazfr/tasarim-desenleri-turkce-kaynak
/facade/go/customer.go
Go
go
209
no_license
package main type Customer struct { firstName string lastName string } func NewCustomer(firstName string, lastName string) Customer { return Customer{ firstName: firstName, lastName: lastName, } }
66f6e5a9121e0925bc1ae69e92606e02310ca5a3
dbecd0b9739c537649c100c2a73cc1c949ea15c2
masnnuller/incubator-openwhisk-wskdeploy
/parsers/deploy_parser.go
Go
go
2,008
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 ...
17f9cd6abb327e1936f51ad4b4c7f427e0766c55
5a4043012b34be065855f57837814078b04cd30f
usamabinshahid97/golang-gin-api-template
/src/models/user/user.go
Go
go
1,851
no_license
package user import ( "time" "github.com/dgrijalva/jwt-go" "golang.org/x/crypto/bcrypt" ) // PublicUser data type type PublicUser struct { ID string `form:"id" json:"id"` FirstName string `form:"firstName" json:"firstName"` LastName string `form:"lastName" json:"lastName"` Email string...
79508474bcb3a4ec5556c3410c34b292da84f4bb
7adc27f919819534e91594da055baf6373e5f1df
frankegoesdown/chatkit-server-go
/internal/core/types.go
Go
go
6,577
permissive
package core import ( "io" "time" ) // User represents a chatkit user. type User struct { ID string `json:"id"` // ID of the user Name string `json:"name"` // Name associated with the user AvatarURL string `json:"a...
4970dc6704231bd1b50d6fdf040fca8a8235a114
5a0c9d0e875497bf158d03ab547966c4198039e3
tiborvass/docker
/client/request_test.go
Go
go
2,879
no_license
package client // import "github.com/tiborvass/docker/client" import ( "bytes" "context" "fmt" "io/ioutil" "math/rand" "net/http" "strings" "testing" "github.com/tiborvass/docker/api/types" "github.com/tiborvass/docker/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) // TestSetHostHead...
4a541d94ca853c58ffe00e797b3b6fd128fe5014
d8a2a3e4cd3074d4c1fecc898ed40fc7cb282564
sisatech/goapi
/pkg/file/lazy.go
Go
go
1,594
permissive
package file import ( "errors" "io" "os" ) // LazyReadCloser is an implementation of io.ReadCloser // that defers its own initialization until the first // attempted read. func LazyReadCloser(openFunc func() (io.Reader, error), closeFunc func() error) io.ReadCloser { return &lazyReadCloser{ openFunc: openFunc...
842861464c570e5d78556597c42746658aab7ca9
a38b1db0e0a52731f7abd6562a82b8b96e72accd
microsoftgraph/msgraph-sdk-go
/devicemanagement/user_experience_analytics_device_scores_request_builder.go
Go
go
10,498
permissive
package devicemanagement import ( "context" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242 "github.com/microsoftgraph/msgraph-sdk-go/models" ia572726a95efa92ddd544552cd95065...
179b6353e25354e514019550670bce0476600be6
f8657b22ed18f8a050fd8c708183051975ed3134
ondrejbudai/osbuild-composer
/internal/osbuild/oscap_remediation_stage_test.go
Go
go
2,001
permissive
package osbuild import ( "testing" "github.com/stretchr/testify/assert" ) func TestNewOscapRemediationStage(t *testing.T) { stageOptions := &OscapRemediationStageOptions{DataDir: "/var/tmp", Config: OscapConfig{ Datastream: "test_stream", ProfileID: "test_profile", }} expectedStage := &Stage{ Type: "o...
ed69c30e2168018737fe882869e1f7abe9540b6c
0867ff321ad619c691cc261210b1c4fc116dfda7
kamurp/acs-engine
/cmd/generate.go
Go
go
6,837
permissive
package cmd import ( "fmt" "io/ioutil" "os" "path" "github.com/Azure/acs-engine/pkg/acsengine" "github.com/Azure/acs-engine/pkg/acsengine/transform" "github.com/Azure/acs-engine/pkg/api" "github.com/Azure/acs-engine/pkg/i18n" "github.com/leonelquinteros/gotext" "github.com/pkg/errors" log "github.com/sirup...
1059638d5b41b86152e1ceeb1052769995dcbec8
fbdff19aa93c834e3d2e85ae98576a4c00d4fa0d
ABMatrix/bee
/pkg/pss/pss.go
Go
go
4,289
permissive
// Copyright 2020 The Swarm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package pss exposes functionalities needed to communicate // with other peers on the network. Pss uses pushsync and // pullsync for message delivery and m...
46637d7904bf90a7a1f38843e3394fc8db03f524
814028837cc572631cb81d634463d94df7cbb125
mongsuk007/go
/txnbuild/transaction.go
Go
go
43,817
permissive
/* Package txnbuild implements transactions and operations on the Stellar network. This library provides an interface to the Stellar transaction model. It supports the building of Go applications on top of the Stellar network (https://www.stellar.org/). Transactions constructed by this library may be submitted to any H...
b7f056a3b72422a57a28a8f08823a028c0c56e72
2b07fe4bc15beca0a2b3bf15eccbfbfc17f68cb1
jusosa/go-react-twitter
/bd/user.go
Go
go
3,586
no_license
package bd import ( "context" "fmt" "github.com/jusosa/go-react-twitter/models" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo/options" "golang.org/x/crypto/bcrypt" ) func CreateUser(user models.User) (string, bool, error) { user.Password, _ ...
5296431565ddf3b10dd5f9e37b82a0406c04325c
bf940491862a7db74e48335ceab63e592f355d48
gansidui/cofile
/main.go
Go
go
2,897
permissive
package main import ( "errors" "log" "net/http" "os" "strconv" "github.com/gansidui/cofile/filestore" ) var ( ErrInvalidParam = errors.New("invalid param") ErrStatusCodes = map[error]int{ ErrInvalidParam: http.StatusBadRequest, } ) // retcode: 0:继续上传,1:上传成功,2:上传失败 const ( RetContinue = 0 RetSucceed =...
0c4d4e22076bef67fcd16e6f2b5a2ae118a67a6c
d4370d7d0de4d0b8b5a485b0edcbf1a15b5220e3
suxiangdong/go-design-patterns
/template_method/template_method_test.go
Go
go
378
no_license
package template_method import "testing" func TestEmailNotification_Send(t *testing.T) { temp := NewEmailNotification() if r := temp.Send(); r != "email:content" { t.Fatal("EmailNotification test fail") } } func TestSmsNotification_Send(t *testing.T) { temp := NewSmsNotification() if r := temp.Send(); r != "s...
f810d4f1afed82fc4af92f7958225869e93694a2
be53a1c43cffc78eeee754f9a436d42db0861617
MikeAustin71/pathfileopsgo
/pathfileops/v2/xt_filemgrcollection_01_test.go
Go
go
32,901
permissive
package pathfileops import ( "fmt" "strings" "testing" "time" ) func TestFileMgrCollection_AddFileMgrCollection_01(t *testing.T) { var fileNameExt string fMgrs1 := FileMgrCollection{} for i := 0; i < 10; i++ { fileNameExt = fmt.Sprintf("testAddFile_%03d.txt", i+1) fmgr, err := fileMgrCollect...
008bc3412a3da2119ee99b1d954d217d4cec3953
e744a7f120291e9f52ed84b1a1a44d2114193b7b
kv4sha/golang-mongodb-docker
/clients/repositories/destinations-repository.go
Go
go
831
no_license
package repositories import ( "encoding/json" "errors" "net/http" "github.com/kv4sha/golang-mongodb-docker/clients/models" ) type destinationsRepository struct { destinationsServiceURL string } func GetDestinationsRepository(destinationsServiceURL string) *destinationsRepository { return &destinationsReposito...
4d64e7a4836634622dba4e1f941e022fb328a44d
b119ec99310fa795e58c512acd5d885e66578a5e
infinity-oj/actuator
/cmd/executor/py/main.go
Go
go
1,877
no_license
package main import ( "fmt" "github.com/infinity-oj/server-v2/pkg/models" "log" "time" "github.com/infinity-oj/actuator/internal/taskManager" ) func work(taskManager taskManager.TaskManager) { task, err := taskManager.Fetch("executor/py") if task == nil { return } fmt.Println(task.TaskId) fmt.Println(e...
8358db246d18b790988560bb3f8848113a1fbe69
0194650eee14b041c1648615f7ae03d05bb0fd4d
Yoshinaz/codeforce
/ProblemSet/solved/lv1/1006A/main.go
Go
go
225
no_license
package main import ( "bufio" "fmt" "os" ) func main() { var n, a int in := bufio.NewReader(os.Stdin) fmt.Fscan(in, &n) for i := 0; i < n; i++ { fmt.Fscan(in, &a) fmt.Printf("%d ", a-(a+1)%2) } fmt.Println() }
c8581169e455d1ea5b958e3fb8631e5704098fb4
1a28a4e96735c42d889e78983b8d7e4406f9425d
mickymiek/go-odoo
/types/portal_wizard.go
Go
go
1,623
no_license
package types import ( "time" ) type PortalWizard struct { LastUpdate time.Time `xmlrpc:"__last_update"` CreateDate time.Time `xmlrpc:"create_date"` CreateUid Many2One `xmlrpc:"create_uid"` DisplayName string `xmlrpc:"display_name"` Id int64 `xmlrpc:"id"` PortalId Many...
4e5d0d3e8caeb008e5e532f027344a335d918f25
97c66072946a17c10dadef71e73554289d2e6240
HoHoSoft/netcup-go
/netcup.go
Go
go
4,667
permissive
package netcup import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) const endpoint = "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON" // The Client is the entrypoint to the Netcup API type Client struct { customerNumber int apiKey string sessionID string endpoint ...
fd433b2e2f869b6aa81a8a0a4d78131ab53a13a2
a71ea6967eb3e5823c2f01b158bbf331ae5012d4
jensg-st/vinitd
/pkg/vorteil/log.go
Go
go
3,172
permissive
/** * SPDX-License-Identifier: Apache-2.0 * Copyright 2020 vorteil.io Pty Ltd */ package vorteil import ( "fmt" "io/ioutil" "os" "strings" "syscall" "unsafe" "github.com/vorteil/vorteil/pkg/vcfg" "golang.org/x/sys/unix" ) var ( vlog logFn ) const ( msgIOCTLOutput = 0x40042101 ) func logAlways(format ...
1d54c3fc03a596a7b90073619e2cb1bef9fde4a1
8224b3bc28285cc049b98183c33271a80d45e2e0
heikipikker/yago
/grammar/grammar.funcs.go
Go
go
2,129
permissive
package grammar import ( "fmt" "github.com/Yara-Rules/yago/lexic" ) // String returns a string representation of the Parser func (p *Parser) String() string { r := "" for _, imp := range p.Imports { r += fmt.Sprintf("import \"%s\"\n", imp) } if len(p.Imports) > 0 { r += fmt.Sprintf("\n") } for _, rule ...
cc9d324f2a8aff215f8b92f7e0252745ea5548ce
5ecc05e01d5d4330d3c6d8da398c49f387de6c78
pwei1018/jaeger-operator
/pkg/deployment/all-in-one_test.go
Go
go
8,498
permissive
package deployment import ( "testing" "github.com/spf13/viper" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1" ) func init() { viper.SetDefault("jaeger-version", "1.6") viper.SetDefau...
ece1001143b63927b0b4499a058d7f96e464831b
2d629bd7450dbed18d69beae33ca8700533638e0
windbaggary/bhchain
/x/openswap/types/expected_keepers.go
Go
go
2,148
permissive
package types import ( sdk "github.com/bluehelix-chain/bhchain/types" supplyI "github.com/bluehelix-chain/bhchain/x/supply/exported" ) type TokenKeeper interface { GetToken(ctx sdk.Context, symbol sdk.Symbol) sdk.Token } type ReceiptKeeper interface { NewReceipt(category sdk.CategoryType, flows []sdk.Flow) *sdk....
28cc228b5b79adf202a476b7ad263bd073324240
302d4ac0439f36cf367112fa377126f6786cef65
black-adder/m3
/src/dbnode/client/errors.go
Go
go
5,106
permissive
// Copyright (c) 2016 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...
d74476175c699e90678a457fd57b2fc9e0a4206d
55d5259dac70f1f84f445f4e0d3f7962338c9aa8
timtadh/Tecellate
/src/logflow/source.go
Go
go
3,654
no_license
package logflow import ( "fmt" "os" ) /* Types and stuff */ type LogLevel string const ( INFO LogLevel = "info" DEBUG = "debug" WARN = "warn" ERROR = "error" FATAL = "fatal" ) type Source interface { Log(LogLevel, ...interface{}) Logf(LogLevel, string, ...interface{}) Log...
a8b2d1321747dae2e998347f14d997ef20b3f542
c1c3ab35d2c0e8ef2078f34f18a759a7a60204bd
d11wtq/bijou
/src/github.com/d11wtq/bijou/core/nativefunc.go
Go
go
924
no_license
package core import ( "github.com/d11wtq/bijou/runtime" ) // Signature of a runtime-compatible go func type CallableFunc (func(runtime.Env, runtime.Sequence) (runtime.Value, error)) // Wrapper for a runtime-compatible go func type FuncWrapper struct { Func CallableFunc } // Create a runtime-compatible go func fun...
9cec83516a6510d199959d2e1e8c24ee16395650
3cf86a927cf5d17f95ccd71ce213de5ef8663694
azenk/iputils
/iputils.go
Go
go
1,132
no_license
package iputils import ( "errors" "net" ) var ( ErrOutOfRange = errors.New("specified offset and/or width are invalid") ) // SetBits sets the bits starting at startOffset and ending at startOffset + setWidth // to the bits specified. func SetBits(ip net.IP, bits uint64, startOffset, setWidth uint) (net.IP, error)...
e4411f25512f4ec020bc04069c344dd375d6b265
03f5595b234469f7376449e0f8f96f750fc59c5e
barakmich/torus
/cmd/torusctl/config.go
Go
go
2,547
permissive
package main import ( "encoding/json" "fmt" "io/ioutil" "os" "os/user" "path/filepath" cli "github.com/coreos/torus/cliconfig" "github.com/coreos/torus/internal/flagconfig" "github.com/spf13/cobra" _ "github.com/coreos/torus/metadata/etcd" ) const ( defaultTorusConfigDir = "/.torus" defaultTorusConfigF...
a367e328d0c470dc481a3095d89f123ded53c757
f86a59f9c78eb7d50586ce1f021252b0c870ab34
klasrak/data-integration
/api/middlewares/token.go
Go
go
394
permissive
package middlewares import ( "net/http" "github.com/gin-gonic/gin" "github.com/klasrak/data-integration/jwt" ) func TokenAuthMiddleware(jwtSecret string) gin.HandlerFunc { return func(c *gin.Context) { err := jwt.TokenValid(c.Request, jwtSecret) if err != nil { c.JSON(http.StatusUnauthorized, gin.H{ ...
952822fde2635c64befdb7ca8dfaf92ea5a892be
0139896bc072b79e8340ab4c0068f911ba99b9a9
cclauss/perf-tests
/clusterloader2/pkg/measurement/common/slos/network_programming_test.go
Go
go
2,444
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, ...
9bae0e455740ee2faaac82910c3ad2f0764b5bf6
14b7fcc8da0f065b2f8dddd12855519b7126808e
PincongBot/2049BBS
/controller/article.go
Go
go
19,624
permissive
package controller import ( "crypto/md5" "encoding/hex" "encoding/json" "html/template" "net/http" "strconv" "strings" "time" "github.com/ego008/youdb" "github.com/rs/xid" "github.com/terminus2049/2049bbs/model" "github.com/terminus2049/2049bbs/util" "goji.io/pat" ) func (h *BaseHandler) ArticleAdd(w ht...
a8e939d61eb29f8bf155d35e4d7aec25fb952cb1
0bdee2a60a7c41dc59b25e4a5d0af5fd5feb05b6
shd123456789/algorithm008-class01
/Week_07/解数独.go
Go
go
1,355
no_license
var col,row,box [][9]bool func solveSudoku(board [][]byte) { col,row,box = make([][9]bool, 9),make([][9]bool, 9),make([][9]bool, 9) for i := 0; i < len(board); i++ { for j := 0; j < len(board[0]); j++ { if board[i][j] != '.' { v := board[i][j] - '1' boxIdx :=...
4efe6d870f6ebd486aed8fe95dfc8363d990bedd
774f3da867d25faa408e7ccb8f575fe64df3846f
morlay/tempo
/cmd/tempo-cli/main.go
Go
go
3,390
permissive
package main import ( "flag" "fmt" "io/ioutil" "github.com/grafana/tempo/cmd/tempo/app" "github.com/grafana/tempo/tempodb/backend" "github.com/grafana/tempo/tempodb/backend/local" "gopkg.in/yaml.v2" "github.com/alecthomas/kong" "github.com/grafana/tempo/tempodb/backend/azure" "github.com/grafana/tempo/temp...
2ff942d96f5bd249460b772dde8338971ec28dec
2d61c393bdcbd56c7ac13b7080e3dd47191be292
yqylovy/go-message
/multipart.go
Go
go
1,845
permissive
package message import ( "io" "mime/multipart" ) // MultipartReader is an iterator over parts in a MIME multipart body. type MultipartReader interface { io.Closer // NextPart returns the next part in the multipart or an error. When there are // no more parts, the error io.EOF is returned. NextPart() (*Entity, ...
ab7dd30b341e2ae0fcd1cc8b90b117378f511a8d
a3511cb9dff10902e0db04ee44f8d797d721c539
hasancelik/kibosh
/pkg/repository/repository.go
Go
go
4,674
permissive
// kibosh // // Copyright (c) 2017-Present Pivotal Software, Inc. All Rights Reserved. // // This program and the accompanying materials are made available under the terms of the under the Apache License, // Version 2.0 (the "License”); you may not use this file except in compliance with the License. You may // obtain ...
642a671bf145511ffb1dadf8cdfd7595ffad0689
34a386b473cdf6631b0067b42f75aabfed122ad7
tpisntgod/Service_Calculation
/cloudgo-io/server.go
Go
go
232
no_license
package main import ( "github.com/tpisntgod/Service_Calculation/cloudgo-io/model" "github.com/tpisntgod/Service_Calculation/cloudgo-io/service" ) func main() { n := service.NewServer() defer model.Db.Close() n.Run(":8080") }
cf3c6e9315ee0de80e36029be2ad912f730f0b97
ce36a3e293a4ea37e69ac16b4350c9744ddace8e
DrGo/csl
/tests/tester/main.go
Go
go
1,924
no_license
// Package tester processes test fixtures for the CSL test suite https://github.com/citation-style-language/test-suite package tester import ( "bufio" "fmt" "os" "strings" ) const ( startBlockLeft = ">>=====" startBlockRight = "=====>>" endBlock = "<<=====" tagLength = 7 // len(">>=====") m...
eaf9b63ebf0d4b5e6e85f85a02967af58a7d8ea3
62c887532713eb1f6b7ed1ca3bc8986a483d6760
ClearLoveH/Go
/CloudGo/service/server.go
Go
go
978
no_license
package service import ( "net/http" "os" "github.com/codegangsta/negroni" "github.com/gorilla/mux" "github.com/unrolled/render" ) // NewServer configures and returns a Server. func NewServer() *negroni.Negroni { formatter := render.New() n := negroni.Classic() mx := mux.NewRouter() initRoutes(mx, formatte...
101243c49761b3a45f211293b6448467265888ca
e0b0f0b2a394b246e3b7c1881168f964d4717a09
freenetdigital/promxy
/cmd/remote_write_exporter/main.go
Go
go
3,466
permissive
// Copyright 2016 The Prometheus 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...
edb42634caec5b764af8e7b0aea1036ce82f6fa9
c50ecea6988ca29714d50c0884beb78ab5a7d610
xandlom/emgo
/egroot/src/pkg/cortexm/exce/exce.go
Go
go
5,144
permissive
package exce import ( "mmio" "unsafe" ) // Exce represents Cortex-M exception. Its value is equal to Exception Number // (not IRQ number) as defined by ARM in Cortex-M documentation. Lowest Exc // value is 1 (Reset), highes value is 255 (externel interrupt #239). type Exce byte // Cortex-M system exceptions (with ...
e609877eb57a2b4dcd725b73a99032fd26603625
873e59de883b157f5d6b5905f0f0d142fa2bba00
halysl/helloGo
/main.go
Go
go
1,198
no_license
package main import ( "fmt" "github.com/halysl/hellogo/basis" "github.com/halysl/hellogo/experience" "github.com/halysl/hellogo/tlotus" log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) func initViper() { configPath := "conf/config.toml" viper.SetConfigType("toml") viper.SetConfigFile(configPath)...
674a61e9fa972438cc26ff76a3e085266a142e63
fd1e20742a634c86d6d6351ef3c56f02a4ab920b
akula410/crypto
/rsa.go
Go
go
2,774
no_license
package crypto import ( "crypto/rand" "crypto/rsa" "crypto/sha256" "crypto/x509" "encoding/pem" ) type RSA struct { PrivateKey []byte PublicKey []byte Private *rsa.PrivateKey Public *rsa.PublicKey } var DefByte = 2048 func (r *RSA)Init(bits int) (*rsa.PrivateKey, *rsa.PublicKey) { if r.Private == nil && l...
72716ad41d4358a68a95e6def6fe3e53208c7110
d0475edc99ba203a7bcc380cf6bd8208b5b4381d
island-devs/misc
/main.go
Go
go
1,800
no_license
package main import ( "finanzas/misc/app" "os" "github.com/urfave/cli" ) // TODO: Define config structure // var ( // config *models.Config // ) func main() { app := cli.NewApp() // config = &models.Config{} // app.Flags = getFlags() app.Name = "Finanzas Miscellaneous service" // app.Version = config.Ve...
b27a4226a49ed75b97d91e22fd6347a484ee144e
6d3000364049cc0191927d78c117d35a25c3e7cb
apache/pulsar-client-go
/pulsar/dlq_router.go
Go
go
5,162
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...
b72986381ea6a03f9bb45baf7edd0f8d8594de43
6cd21189d81c3da4b11394226a0b8a9345e88ccb
flowpub/r2-streamer-go
/parser/epub/ncx.go
Go
go
937
permissive
package epub //Ncx OPS/toc.ncx type Ncx struct { Points []NavPoint `xml:"navMap>navPoint"` PageList PageList `xml:"pageList"` } //NavPoint nav point type NavPoint struct { ID string `xml:"id,attr"` Text string `xml:"navLabel>text"` Content Content `xml:"content"` Points [...
4163f83db2a8d243b7d5df7bba41a60b3656f750
12ba7af664e4317b4c3ab68b1989422bd2dea988
EricHripko/dipod
/vendor/github.com/docker/swarmkit/cmd/swarmctl/service/logs.go
Go
go
1,884
permissive
package service import ( "context" "fmt" "io" "os" "github.com/docker/swarmkit/api" "github.com/docker/swarmkit/cmd/swarmctl/common" "github.com/pkg/errors" "github.com/spf13/cobra" ) var ( logsCmd = &cobra.Command{ Use: "logs <service ID...>", Short: "Obtain log output from a service", Aliases:...
3e536e2b632699e2abaa23ea1c7a395caae40090
47ee3524d8c302bb50998e593dd299481530dead
knut0815/ndsemu
/divisor.go
Go
go
3,531
no_license
package main import ( "fmt" "ndsemu/emu/hwio" log "ndsemu/emu/logger" ) var modDiv = log.NewModule("divisor") type HwDivisor struct { DivCnt hwio.Reg32 `hwio:"offset=0x00,rwmask=0x3,wcb,rcb"` Numer hwio.Reg64 `hwio:"offset=0x10,wcb=WriteIN"` Denom hwio.Reg64 `hwio:"offset=0x18,wcb=WriteIN"` Res h...
35d2a49c1c2c21761f3919b3dc3dc3692ce86443
442ed951e408c149cc79a05fc085851893d356d0
SyntropyDev/mms-api
/Godeps/_workspace/src/github.com/huandu/facebook/api.go
Go
go
5,855
permissive
// A facebook graph api client in go. // https://github.com/huandu/facebook/ // // Copyright 2012 - 2014, Huan Du // Licensed under the MIT license // https://github.com/huandu/facebook/blob/master/LICENSE // This is a Go library fully supports Facebook Graph API (both 1.0 and 2.0) with // file upload, batch request, ...
2c5fcb8b29f2190a853f80a43e2089389d3dfaf9
685ca0553fb41f2070f4902eca996cfd8b01507a
Patagonicus/suijin
/message.go
Go
go
559
permissive
package suijin // Message describes a single event that has been logged. type Message struct { // The level associated with this message. Sinks can use this to decicede if and how to log this message. Level Level // A text describing the event. This should be a static text, all information that is not known at comp...
547321443a7709747fa58e8438c41128bc3e1014
5fe10726f1238d250d42019d31081e0cefe9ac88
SAKaNa567/exercise-gopl.io
/ch04/ex09/wordfreq.go
Go
go
477
no_license
package main import ( "bufio" "fmt" "os" ) func main() { for _, arg := range os.Args[1:] { fmt.Println(arg) for k, v := range wordfreq(arg) { fmt.Printf("%q\t%d\n", k, v) } } } func wordfreq(fname string) map[string]int { f, err := os.Open(fname) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) ...
ed86cbed0e37354a084cfdf65f0694efe566102b
3d0cf616270ae40a6655ebec2a731ec5a466b5ac
openshift/openshift-tests
/vendor/k8s.io/kubernetes/pkg/master/controller/clusterauthenticationtrust/cluster_authentication_trust_controller.go
Go
go
18,315
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, ...
425e2dd8519f940340d178f66fabf2f023d9e87a
939de0925672662736481bc603ae66a644822a23
danigunawan/gotutorial
/map1/main.go
Go
go
376
no_license
package main import ( "fmt" ) func main() { var mapPerson map[int]string mapPerson = make(map[int]string) mapPerson[1] = "Alex" mapPerson[2] = "Ben" mapPerson[3] = "Den" mapPerson[4] = "Wury" for k, v := range mapPerson { fmt.Println(k, v) } wury, ok := mapPerson[4] if !ok { fmt.Println("Wury tidak...
b8038670e37efb89a9f216896f7c5600b4840223
7fb4dd50e0e45c215b6d63ccd69f2c75e94dfe04
shaohongv5/go-admin
/modules/language/cn.go
Go
go
16,736
permissive
// Copyright 2019 GoAdmin Core Team. All rights reserved. // Use of this source code is governed by a Apache-2.0 style // license that can be found in the LICENSE file. package language import "strings" var cn = LangSet{ "managers": "管理员管理", "name": "用户名", "nickname": "昵称", "role": "角色", "createdat"...
5e828fad32108617cfb5d8b532c79f075c7c7f0a
d7562652dd65e3093ae4fbfa633cd0089c6a2125
continusec/safeadmin
/cmd/safedump/safedump-main.go
Go
go
1,549
permissive
/* Copyright 2017 Continusec Pty Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...