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 |
|---|---|---|---|---|---|---|---|---|
be0129553f015ee5b7137953f4ed53b3926cd480 | 9595bd69eebde524ac90984da0b25ebd246171e7 | 8tomat8/GoCourse | /27.CRUD/main.go | Go | go | 1,005 | no_license | package main
import (
"flag"
"net"
"log"
"net/http"
_ "github.com/mattn/go-sqlite3"
"database/sql"
)
var dbInst *sql.DB
type handler struct{}
type Book struct {
Id int `json:"id"`
Name string `json:"name"`
Author string `json:"author"`
Pages int `json:"pages"`
}
type books []Book
func main() {... |
52708a1d676a54389898d13b594716ece333f94b | 14a97dcfd91a97a2fd67ba56990380a45eb0186d | gitter-badger/antlr4 | /runtime/Go/antlr/atn_config_set.go | Go | go | 9,379 | permissive | package antlr
import (
"fmt"
)
type ATNConfigSet interface {
Hasher
Add(ATNConfig, *DoubleDict) bool
AddAll([]ATNConfig) bool
GetStates() *Set
GetPredicates() []SemanticContext
GetItems() []ATNConfig
OptimizeConfigs(interpreter *BaseATNSimulator)
Equals(other interface{}) bool
Length() int
IsEmpty() b... |
f5abfaf1acdf146275723759dab74fa23c3ffdf6 | aeb180ee6b420793da58054f2ac8157b50bedd2b | andreiv05/metal-cloud-sdk-go | /drive_snapshot.go | Go | go | 2,465 | permissive | package metalcloud
import (
"fmt"
)
//Snapshot A snapshot of a drive created at a specific time.
type Snapshot struct {
DriveSnapshotID int `json:"drive_snapshot_id,omitempty"`
DriveSnapshotLabel string `json:"drive_snapshot_label,omitempty"`
DriveID int `json:... |
c4daada19a87a41426e9fee7f445b6035a38f98c | 0227115f3abf3e4f664a5513333cc77ee641546d | markotikvic/webutility | /list_config.go | Go | go | 14,578 | no_license | package webutility
import (
"database/sql"
"fmt"
)
// ListOptions ...
type ListOptions struct {
GlobalFilter bool `json:"globalFilter"`
LocalFilters bool `json:"localFilters"`
RemoteFilters bool `json:"remoteFilters"`
Pagination bool `json:"pagination"`
PageSize uint32 `json:"pageSize"`
Pivo... |
ff18028ca658a2894c2479a7f655abcee114b35d | 1a62e9d8086c177429e0e05eab3b76c0e6db2d89 | kashifsoofi/beetools | /cmd/beetools/main.go | Go | go | 2,436 | permissive | package main
import (
"fmt"
"io"
"os"
"github.com/spf13/cobra"
)
func main() {
encodeCmd := &cobra.Command{
Use: "encode",
Short: "Encode data from JSON",
Long: "Encode data from JSON to bencode format.",
Args: cobra.RangeArgs(0, 2),
RunE: func(cmd *cobra.Command, args []string) error {
var (
... |
f60802f759d8536ae6747d81db58d3ba2fb0c321 | 8e5a4eef75ca142993992be19d64210c491cb851 | CISCO-METZ-GROUP/vpp | /plugins/ksr/model/policy/key.go | Go | go | 1,372 | permissive | // Copyright (c) 2017 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
e14fda69ab7efa61dd0d62c58bd72bba1e169fb0 | b39b774d7036a3743050edd51c763fefb821c6f4 | sugyan/peco | /ctx.go | Go | go | 4,385 | permissive | package peco
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"sync"
)
type Selection []int
func (s Selection) Has(v int) bool {
for _, i := range []int(s) {
if i == v {
return true
}
}
return false
}
func (s *Selection) Add(v int) {
if s.Has(v) {
return
}
*s = Selection(append([]int(*s), v))
sort.Sort... |
b9f9806fddbd7d32d8d9b5c8dd402a89c01ec897 | 41f78f50e97d699988b9532b21c35b96df65479c | abitduck/auklet | /common/fs/mount_monitor.go | Go | go | 1,584 | permissive | package fs
import (
"os"
"sync"
"syscall"
"time"
)
type MountMonitor struct {
stop chan bool
callbacks map[string]func()
lock sync.RWMutex
}
func (m *MountMonitor) monitor() {
mf, err := os.Open("/proc/self/mounts")
if err != nil {
panic(err)
}
defer mf.Close()
mfd := int(mf.Fd())
epfd, err... |
575650a86af039ca3e6b2ceb13d47b96f09b3bfe | e81da00fe056dde07fdaebb9b1a89c546769a106 | DataDog/datadog-agent | /pkg/security/security_profile/activity_tree/metadata/metadata_proto_dec_v1.go | Go | go | 1,223 | permissive | // Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:build linux
package metadata
import (
adproto "github.com/DataDog... |
2c820a7507d9627bb0c22ac9a9b3222135d914f6 | bbbdb45fde9d07a7dee70f49f83ee3b62f1cee66 | banch0/security | /files/Zip.go | Go | go | 835 | no_license | package main
import (
"archive/zip"
"log"
"os"
)
func main() {
// Create a file to write the archive buffer to
// Could also use an in memory buffer
outFile, err := os.Create("test.zip")
if err != nil {
log.Fatal(err)
}
defer outFile.Close()
// Creates a zip writer on top of the file writer
zipWriter :=... |
0efcad872757fbf6f75046b7da5505ccfea7460d | b7bf042e0ff2c2f9d51a3063776ecf63d0fb5e28 | BondAnthony/influxdb | /task/mock/scheduler.go | Go | go | 11,739 | permissive | // Package mock contains mock implementations of different task interfaces.
package mock
import (
"context"
"errors"
"fmt"
"github.com/influxdata/flux"
"strings"
"sync"
"time"
platform "github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/task/backend"
scheduler "github.com/influxdata/influxdb/ta... |
3fb5acdd4307f6c9513307805890446d3850d5b6 | 87f42eabc86d63a4123f2294b7e50334b1d212bd | banzaicloud/pipeline | /internal/integratedservices/services/logging/kubernetes.go | Go | go | 1,470 | permissive | // Copyright © 2019 Banzai Cloud
//
// 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 ... |
bc593217f02964a47302d0c8b9dea956f59f6475 | 399c421b94f140c8048c0e8f79d32f49ac4673bd | kpn/pion | /vendor/github.com/minio/minio/pkg/iam/policy/actionset.go | Go | go | 2,680 | permissive | /*
* Minio Cloud Storage, (C) 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
335ca0170774757343b4005bd550986cd6444ba1 | 9ec607fd4efe4078dee79e9218b731ea40d2f228 | camelpunch/on-demand-service-broker | /integration_tests/delete_all_service_instances_and_deregister_broker/delete_all_service_instances_and_deregister_broker_test.go | Go | go | 6,324 | permissive | package delete_all_service_instances_and_deregister_broker_test
import (
yaml "gopkg.in/yaml.v2"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
"github.com/pivotal-cf/on-demand-service-broker/config"
"github.com/pivotal-cf/on-demand... |
d376ab3a11b9ccff0c32e287adb79e06f24d668e | 434ba4298b1655fa617bd588c69a7e74d8a2c640 | xuziyan001/marketing-api-go-sdk | /pkg/api/api_dynamic_ad_video.go | Go | go | 4,036 | permissive | /*
* Marketing API
*
* Marketing API
*
* API version: 1.3
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package api
import (
"context"
"github.com/tencentad/marketing-api-go-sdk/pkg/errors"
. "github.com/tencentad/marketing-api-go-sdk/pkg/model"
"io/ioutil"
"net/h... |
533fd7c8bb3b5e29976d2b8fdf0133b7020ebbca | 241868a84ec2807bea833ea5d11b18fd0e6b3252 | usk81/go-aura | /middleware/zap_logger.go | Go | go | 2,100 | permissive | package middleware
import (
"net/http"
"strings"
"time"
"github.com/go-chi/chi/v5/middleware"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
// UserAgent is the key
const UserAgent = "User-Agent"
// BuildLogger sets up zap logger config
func BuildLogger() (logger *zap.Logger, err error) {
config := zap.NewPro... |
39b4916020663041965375dbb3c78bebda610f8e | cb12bc911e8488f71969eeb893cca660efbddb6c | go-magma/magma | /modules/feg/gateway/services/eap/providers/aka/provider/linked_client_api.go | Go | go | 2,234 | permissive | // +build !stand_alone_eap_service
/*
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an ... |
5119b36839b98318909874b8050c13329423d2fc | cc8c6a9d0cc9ea00a860aa9d199d1a7c6932b599 | josephwinston/weave | /router/gossip_test.go | Go | go | 5,144 | permissive | package router
import (
wt "github.com/zettio/weave/testing"
"testing"
"time"
)
// TODO test gossip unicast and broadcast; atm we only test topology
// gossip, which does not employ unicast or broadcast.
type mockChannelConnection struct {
RemoteConnection
dest *Router
}
// Construct a "passive" Router, i.e. w... |
22feac0fa73caf728a9e5bcc4260dba030d59974 | ac52a5f1d11e02025b19a67b51d2a2fef224d89e | waterschen/awgo | /update/github_test.go | Go | go | 7,025 | permissive | // Copyright (c) 2018 Dean Jackson <deanishe@deanishe.net>
// MIT Licence - http://opensource.org/licenses/MIT
package update
import (
"fmt"
"io/ioutil"
"reflect"
"testing"
aw "github.com/deanishe/awgo"
)
// 4 valid releases, including one prerelease
// v1.0, v2.0, v6.0, v9.0 (Alfred 4 only) and v10.0.1-beta
/... |
27e92e572ad8c05c7b7a48de78cc818518911d5f | c60489a1abfbdb79139493707e2d552c1ca3ec5f | gmurdoko/hotelAPI | /main/masters/repositories/roomRepositoryImpl.go | Go | go | 4,518 | no_license | package repositories
import (
"database/sql"
"hotelAPI/main/masters/models"
"log"
"time"
)
//RoomRepoImpl app
type RoomRepoImpl struct {
db *sql.DB
}
//SelectAvailableRoom app
func (s RoomRepoImpl) SelectAvailableRoom() ([]*models.Rooms, error) {
data, err := s.db.Query("select mr.id, mr.room_name, p.price, mr... |
fe2a4f108e180ca5377d0f6a392ba0cbcf139e12 | 13a4e54e0eb8a66f816519ef0da478b9194fc51e | MieYua/Aliyun-OSS-Go-SDK | /oss/types/Client.go | Go | go | 729 | no_license | /*
* Copyright (C) Mie Yua <mieyua@aliyun.com>, 2015.
* All rights reserved.
*/
package types
import (
"net/http"
"sync"
)
// Client's struct.
// 客户端属性。
type Client struct {
AccessKeyId string // 访问Id
AccessKeySecret string // 访问密钥
Host string // 主机节点
HttpClient *http.C... |
b77db079446221bdf73432518e90ce34f55152f9 | 453470a8ae64a4a7168291ee31c68e7cbec3ac0e | phpyandong/opentaobao | /model/iot/TmallDeviceCarturlGetRequest.go | Go | go | 1,665 | permissive | package iot
import (
"net/url"
"github.com/bububa/opentaobao/model"
)
/*
添加商品到购物车 APIRequest
tmall.device.carturl.get
获取二维码,支持添加商品到购物车
*/
type TmallDeviceCarturlGetRequest struct {
model.Params
// 商品信息,格式为 商品ID_SKU ID_数量,多条记录以逗号(,)分割
itemIds []string
// 设备业务编码
deviceCode string
... |
bedd8910c3e43b0199bc71d9b7a03334eac3c4e0 | 2f4a1477cb7d0bb0b0f434d1e88be1613818bc33 | google/gvisor | /pkg/sentry/loader/vdso.go | Go | go | 11,662 | permissive | // Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
df0f36fb47578e53601b1a3c6879f43f1ddde024 | 4bc3cc70e96bf865bd6c5f609344a9b6d31a205b | bolutife-lawrence/inbucket | /pkg/stringutil/utils_test.go | Go | go | 854 | permissive | package stringutil_test
import (
"net/mail"
"testing"
"github.com/jhillyerd/inbucket/pkg/stringutil"
)
func TestHashMailboxName(t *testing.T) {
want := "1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e"
got := stringutil.HashMailboxName("mail")
if got != want {
t.Errorf("Got %q, want %q", got, want)
}
}
func TestS... |
e4fe38bff986b1e8df34852ff7a4a05c8c892028 | 16ca09168006f0b13de5c3c097f53ce3acaf0ef1 | a07061625/gompf | /mpf/api/mppush/jpush/schedules/schedulelist.go | Go | go | 1,065 | permissive | /**
* Created by GoLand.
* User: 姜伟
* Date: 2020/2/4 0004
* Time: 16:50
*/
package schedules
import (
"strconv"
"github.com/a07061625/gompf/mpf"
"github.com/a07061625/gompf/mpf/api/mppush"
"github.com/a07061625/gompf/mpf/mpconstant/errorcode"
"github.com/a07061625/gompf/mpf/mperr"
"github... |
9845d96909ed621a37ad2ade8a3bf04764f3faaa | 591e4b876d6ad4b5246531be65d29c917f49dff4 | stardog-union/stardog-graviton | /vendor/github.com/mitchellh/packer/packer/post_processor_mock.go | Go | go | 743 | permissive | package packer
// MockPostProcessor is an implementation of PostProcessor that can be
// used for tests.
type MockPostProcessor struct {
ArtifactId string
Keep bool
Error error
ConfigureCalled bool
ConfigureConfigs []interface{}
ConfigureError error
PostProcessCalled bool
PostProcessArtifact ... |
faae644cfef5794ee9a98704bb6ec92d2f3224cb | efd04ee3584134203835c58c8a721b30dde36e5a | wenzuochao/aliyun-cli | /oss/lib/symlink_test.go | Go | go | 6,492 | permissive | package lib
import (
"fmt"
"net/url"
. "gopkg.in/check.v1"
)
func (s *OssutilCommandSuite) TestCreateSymlink(c *C) {
bucketName := bucketNamePrefix + randLowStr(10)
notExistBucketName := bucketNamePrefix + randLowStr(10)
symObject := bucketNamePrefix + randStr(5) + "符号链接"
targetObject := bucketNamePrefix + r... |
39cf856e5d6fee0d8eb1825ff732e04dd2927d95 | 2ad192cc4b4eca4b180100b15396666754ca517f | lintanghui/gotool | /panic.go | Go | go | 932 | no_license | // recover panic and write panic information to file
package gotool
import (
"bytes"
"fmt"
"os"
"runtime"
"time"
)
var defFile string = "Crash.log"
func Crash() {
if err := recover(); err != nil {
fd, err := os.OpenFile(defFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
if e... |
3e84b98ae5fcae7bffe1408e61c795b73490f024 | 7bb306f75e17d126b6cef7faec9264f0cb61b587 | whiter4bbit/imdb-datasets | /db/metrics.go | Go | go | 1,756 | no_license | package db
import (
"fmt"
"log"
"strings"
"time"
)
type timerUpdate struct {
name string
t time.Duration
}
type avgUpdate struct {
name string
v int
}
type timerM struct {
t time.Duration
c int
}
type avgM struct {
v int
m int
c int
}
var (
Metrics = &metrics{}
)
func init() {
//Metrics.star... |
80b3f0a460295b800fd230246d3bcb0019923ea1 | 96fbcd77054b269310e7268d5340767b0d3361ed | laudarch/iso20022 | /CancelledReason3Choice.go | Go | go | 712 | permissive | package iso20022
// Choice between a standard code or proprietary code to specify the reason why the instruction or cancellation request is cancelled.
type CancelledReason3Choice struct {
// Standard code to specify the reason why the instruction is cancelled.
Code *CancelledStatusReason11Code `xml:"Cd"`
// Propr... |
96683d0f14568c8fca6fe006103ff6ba4ef1bd73 | 48a01d8fca81822d20c38b7b366c8fd98c66750f | stiangrindvoll/benthos | /internal/impl/pulsar/integration_test.go | Go | go | 2,404 | permissive | package pulsar
import (
"fmt"
"testing"
"time"
"github.com/apache/pulsar-client-go/pulsar"
"github.com/ory/dockertest/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/benthosdev/benthos/v4/internal/integration"
)
func TestIntegrationPulsar(t *testing.T) {
integrati... |
9e44c9ab910a40e4ebe1227400df67fc9faf1120 | e42c815298b174443dacbcb25a80e0c4b69c53ed | prateekpandey14/orchestrator | /go/inst/maintenance_dao.go | Go | go | 7,217 | permissive | /*
Copyright 2014 Outbrain 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 w... |
5ef24440974f296d3d4e3a84e9172c65ee23a421 | 735276478c9ab4c4e40c391658098e91e01178b0 | konjoot/reeky | /test/mocks/resource.go | Go | go | 1,424 | permissive | package mocks
import (
"fmt"
"reflect"
"github.com/konjoot/reeky/errors"
i "github.com/konjoot/reeky/interfaces"
)
type ResourceMock struct {
F interface{}
V interface{}
Invalid bool
NotFound bool
created bool
findedBy string
}
func (r *ResourceMock) Created() bool {
return r.created
}
... |
67da75cd9db4607960cd87a4c557c2afcfb5c880 | 4c3dec23a9975ba3e7759f548a23a7eb1062715a | coderbradlee/p2p-discovery | /bloombits.go | Go | go | 5,100 | no_license | // Copyright 2017 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... |
5f4f870cc144490b92b4b2d3f9914258a6055af8 | 418b9f1c0fc9c5b3f2a99289841de0327aa5f8e8 | sbueringer/kubebuilder | /pkg/plugins/common/kustomize/v2/init.go | Go | go | 3,080 | permissive | /*
Copyright 2022 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, ... |
fd2ce8a6954e385bdd2b175f9f8b9c33bb1fbaf2 | 3532bdb3f2fa42c9ca23ca9b3dcc1dd088488b92 | prateekpandey14/gobot | /platforms/raspi/raspi_adaptor_test.go | Go | go | 3,831 | permissive | package raspi
import (
"errors"
"strings"
"testing"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/drivers/i2c"
"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/sysfs"
)
// make sure that this Adaptor fullfills all the required interfaces
var _ gobot.Adaptor = (*Adaptor)(nil)
var _ gpio.D... |
6e10769f4c10b0b217458841c64e2ac47fb9ecd4 | 1db2afd787cc9985f5f15998bde735bce19ca14c | jsa4000/Getting-Started-Golang | /src/webapp/core/store/mongo/config.go | Go | go | 304 | no_license | package mongo
import "webapp/core/config"
// Config main app configuration
type Config struct {
URL string `config:"repository.mongodb.url:mongodb://root:root@localhost:27017/admin"`
}
// LoadConfig Load config from file
func LoadConfig() *Config {
c := Config{}
config.ReadFields(&c)
return &c
}
|
2d3fd6b49eac99e27e737c390fa0cec9be99f645 | edb6dac5ab1cfb3f34c4acfb98cfdaeb34ee7854 | IanVzs/lightAPI | /rds/rds.go | Go | go | 4,094 | permissive | package rds
import (
"context"
"fmt"
"strconv"
"time"
"github.com/IanVzs/lightAPI/flag_parse"
"github.com/IanVzs/lightAPI/log"
"github.com/go-redis/redis/v8"
)
var ctx = context.Background()
func getRds() *redis.Client {
rdb := redis.NewClient(&redis.Options{
Addr: *flag_parse.RedisIP,
Password: *fl... |
7b293f5815116dfd5045ffc1ab4b36e53659a4b0 | 6fe6db55b92658656b7f71fcd0e22208017d156e | albshin/tutescrew | /main.go | Go | go | 2,287 | no_license | package main
import (
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"github.com/albshin/tutescrew/commands"
"github.com/albshin/tutescrew/config"
"github.com/albshin/tutescrew/route"
"github.com/bwmarrin/discordgo"
"github.com/kelseyhightower/envconfig"
)
// Configuration holds environment ... |
7bf14d1b7e41da44d8fd733ca1599011c5a872fa | bfdf1abd0925b9648f311c6b44dcaa28563e2078 | wujinderead/MyGoProjects | /gotest/leetcode/Leet556_NextGreaterElementIII.go | Go | go | 1,651 | no_license | package main
import (
"fmt"
)
// https://leetcode.com/problems/next-greater-element-iii/
// Given a positive integer n, find the smallest integer which has exactly the same digits existing in
// the integer n and is greater in value than n. If no such positive integer exists, return -1.
// Note that the returned in... |
30bcb71e8d3caa3b54987799d1d1935f72d45182 | 600b64186675034c3dfa0b9b07003d4e42108e2f | infinivision/badger | /table/iterator.go | Go | go | 12,827 | permissive | /*
* Copyright 2017 Dgraph Labs, Inc. and Contributors
*
* 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 appli... |
62992abee14f817f3689d752fde72ec23c62f808 | d7aeb5d4e6ba5716075f1ff3fbb4d4143c8273bc | Kingsley-maker/google-api-go-client | /recommender/v1beta1/recommender-gen.go | Go | go | 101,457 | permissive | // Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package recommender provides access to the Recommender API.
//
// For product documentation, see: https://cloud.google.com/recommender/docs/
//
... |
af00c247243a119e5aa622052f29aeaf2d32287b | 7733ec5a8f3e33aeb28134782269795bb75e3566 | mehulsbhatt/emgo | /egpath/src/stm32/examples/f4-discovery/fmt/main.go | Go | go | 682 | permissive | package main
import (
"fmt"
"stm32/f4/setup"
)
func init() {
setup.Performance168(8)
initConsole()
}
func main() {
con.WriteString("fmt test:\n")
end := fmt.Str("$\n")
s := fmt.Str("abcd")
i := fmt.Int64(15)
i.Format(con, 5, 10)
end.Format(con)
i.Format(con, -5, 10)
end.Format(con)
i.Format(con, 5, -1... |
e1f6236585b18a689de60c7d4761a4295081493a | 2b73f384e0fe452d304f78acc7ec1621206c9296 | j4nu5/cryptopals | /solutions/set1ch1_test.go | Go | go | 437 | no_license | package solutions
import (
"testing"
)
func TestHexToBase64(t *testing.T) {
in := "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"
out, err := HexToBase64(in)
if err != nil {
t.Error("For", in, "unexpected", err)
}
expected := "SSdtIGtpbGxpbmcgeW91ciBicmFpbiB... |
e6946f5661dc4871469f8bd15f860b904e9e790d | 7d4196b7bf0d5add58ee62ae8136e465c1df72c2 | rodkeys/openbazaar-go | /repo/message_test.go | Go | go | 797 | permissive | package repo_test
import (
"bytes"
"testing"
"github.com/golang/protobuf/ptypes/any"
"github.com/OpenBazaar/openbazaar-go/pb"
"github.com/OpenBazaar/openbazaar-go/repo"
)
func TestMessage(t *testing.T) {
var (
mType = pb.Message_ORDER
payload = "sample message"
)
msg := pb.Message{
MessageType: mTy... |
3d2188e078d464ad51601de242e6d4170a7738df | 449f3016b412b60779e0b565023c77268eb36f89 | lookso/go-notes | /assembly/rpc/grpc/helloworld/greeter_client/main.go | Go | go | 1,714 | no_license | package main
import (
"context"
"fmt"
"log"
"time"
pb "github.com/lixd/grpc-go-example/features/proto/echo"
"google.golang.org/grpc"
)
const (
exampleScheme = "example"
exampleServiceName = "lb.example.grpc.lixueduan.com"
)
var addrs = []string{"localhost:50051", "localhost:50052"}
func callUnaryEcho(... |
3d27b0ac9e19da929f6dc0ca0dd35bd4b07b6f9a | 622e799056c338bbb9478488ddb5e94d5df2da63 | luci/luci-go | /grpc/prpc/metadata.go | Go | go | 2,996 | permissive | // Copyright 2019 The LUCI 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... |
3fd594d4409d044c8921b78b48c8ad921e5e8705 | 947e4a0c558dccc4aa1052ecb7cf5bbf42c4a34d | laurent22/tablewriter | /table_test.go | Go | go | 1,558 | permissive | // Copyright 2014 Oleku Konko All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// This module is a Table Writer API for the Go Programming Language.
// The protocols were written in pure Go and works on windows and unix systems
package tablewriter... |
24740099eedfb25ee4b69e17b443133e23df98b5 | 9cc2e5330797102fdd643b0c0d60bda51632c33b | apache/beam | /sdks/go/pkg/beam/core/runtime/harness/worker_status_test.go | Go | go | 2,849 | permissive | // Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not... |
d83938df3ed48728a11fd4676bd5e5aed0b6f958 | 478ee5872760a3d10ab72efb7b2a20ae59b177fb | continuum-irfan-shaikh/SharedFolder | /vendor/gitlab.connectwisedev.com/platform/platform-api-model/clients/model/Golang/resourceModel/agent/scheduleMessage.go | Go | go | 1,467 | no_license | package agent
import "time"
const (
//CRON for cron schedule message type
CRON = "cron"
//EVENT for event schedule message type
EVENT = "event"
)
//ScheduleTask is a struct defining the actual schedule task
type ScheduleTask struct {
Task string `json:"task,omitempty"`
TaskInput string... |
bfe14058f265c993f3b17b2a48e218a82cbab616 | f8803125e3b9bc36a6e6e2fabe8bd2f758cb2dbb | YuJuncen/ticdc | /cdc/entry/codec.go | Go | go | 9,372 | 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... |
87fec284b185f598e1ec0993f22da3fa20ad3a97 | d25820436303ebeec28b9f61175772dcfa661868 | erikcai/oci-go-sdk | /batch/compute_environment.go | Go | go | 6,155 | permissive | // Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
0ded46a60fb28ef6034ff2776bf6001aaedd8345 | 07ea6ea7c2e17bf90ffe50f7f77a1a6c9836e448 | trumanwong/leetcode | /algorithms/0017.LetterCombinationsofaPhoneNumber/letterCombinations_test.go | Go | go | 546 | permissive | package main
import (
"leetcode/algorithms/0017.LetterCombinationsofaPhoneNumber/letterCombinations"
"testing"
)
func TestLetterCombinations(t *testing.T) {
tests := []struct {
digits string
output []string
}{
{"23", []string{"bd", "be", "bf", "ce", "cf", "ad", "ae", "af", "cd"}},
}
for _, test := range ... |
81518342ceaad523feb46bed9068e8a421b86d38 | 04f1368003215e2e3bcfb942ebfc2ad25cb0d665 | JordanSussman/server | /secret/native/update.go | Go | go | 1,613 | permissive | // Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package native
import (
"strings"
"github.com/go-vela/types/constants"
"github.com/go-vela/types/library"
"github.com/sirupsen/logrus"
)
// Update updates an existing ... |
169a391af034768babccce10da4216f87958f1af | 15da8e3a5684ebb2321b9f7aeaba3bc63818e464 | test-wiz-sec/pulumi-azure-nextgen | /sdk/go/azure/apimanagement/v20180101/getOpenIdConnectProvider.go | Go | go | 1,614 | permissive | // *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20180101
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func LookupOpenIdConnectProvider(ctx *pulumi.Context, args *LookupOpenIdConnectProviderA... |
59e6693e468222e529222eccf2437f0974499e7a | ffc4b5b8cf9a28d3437dbba0452ef8195d84401b | Curricane/corm | /session/raw.go | Go | go | 2,181 | no_license | package session
import (
"database/sql"
"strings"
"github.com/Curricane/corm/clause"
"github.com/Curricane/corm/dialect"
"github.com/Curricane/corm/log"
"github.com/Curricane/corm/schema"
)
// Session 与数据库交互
type Session struct {
db *sql.DB
dialect dialect.Dialect
tx *sql.Tx
refTable *schema.S... |
97c162b4c5f83df19783b004b1a08009a16a62ae | 116d89adfb7361818ccc409194e91acd3f65a525 | mlmhl/goutil | /container/trie.go | Go | go | 3,466 | no_license | package container
type node struct {
value interface{}
table map[rune]*node
}
func newNode(value interface{}) *node {
return &node{
value: value,
table: map[rune]*node{},
}
}
func (node *node) hasValue() bool {
return node.value != nil
}
type Entry struct {
key string
value interface{}
}
func newEntry(k... |
88010e4b478db88ddcb30779dca2e8c0caacbf42 | f71fbbd4618e58eccc2411a4d4081b22b5ab3bc9 | isgasho/neutron-1 | /server.go | Go | go | 318 | no_license | package main
import (
"log"
"./routes"
"github.com/pulsar-go/pulsar"
"github.com/pulsar-go/pulsar/config"
)
func main() {
// Get the settings from the configuration files.
config.Set("./server.toml")
// Set the application routes.
routes.Register()
// Serve the HTTP server.
log.Fatalln(pulsar.Serve())
}
|
373a190de116052334a403fd423e432abf04ed10 | e946866bc7cad3b45a9eca931a04835ad7d901e3 | MichailSmith/AdventOfCode2020 | /day4/main.go | Go | go | 2,599 | no_license | package main
import (
"fmt"
"regexp"
"strconv"
"strings"
"adventofcode.com/misha/shared"
)
func main() {
passportLines := shared.ReadFileLines("day4/input.txt")
passports := []passport{}
currentPassport := passport{
fields: make(map[string]string),
}
for i := range passportLines {
if len(passportLine... |
0ba9ac8ae6133cf14c0c4573ccff043267a604cd | 08aa5595f5454e61fe5d78b04bffaa31a9743fb3 | gosemver/aws_aws-sdk-go_v1.4.3-1-g1f24fa1 | /service/machinelearning/examples_test.go | Go | go | 22,231 | permissive | // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package machinelearning_test
import (
"bytes"
"fmt"
"time"
"github.com/gosemver/aws_aws-sdk-go_v1.4.3-1-g1f24fa1/aws"
"github.com/gosemver/aws_aws-sdk-go_v1.4.3-1-g1f24fa1/aws/session"
"github.com/gosemver/aws_aws-sdk-go_v1.4.3-1-g1f24fa1/service/machinelea... |
71a525e9a190bf50b423edbb046de85d358b8ba1 | 7b4c3d782ed79415b591032092c74f633c4ef50e | xuntame/nomscs1 | /go/types/mapMutator.go | Go | go | 1,235 | no_license | // Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package types
import "github.com/stormasm/noms/go/d"
type mapMutator struct {
oc opCache
vrw ValueReadWriter
}
func newMapMutator(vrw ValueReadWriter) *mapMutat... |
ba3d08d17aafe6eb80f1a1d24b6eeee1455577a7 | c88c2a6ce6fe0acdf5f92514dc9829873d1b5197 | sillyhatxu/crawler-service | /common/download/download_test.go | Go | go | 310 | no_license | package download
import (
"testing"
)
func TestFile_Download(t *testing.T) {
file := File{
FileURL: "http://s0.lgstatic.com/i/image2/M01/9D/32/CgoB5l2td9qAf2VuAABerHKNze4736.png",
}
err := file.Download()
if err != nil {
t.Fatalf("download file error: %v", err)
}
t.Log("download file success")
}
|
407029715c9a8c76689abeaad4e979742991a241 | f8960aac0fd8d0ab8134c34d6889f6677aab8b41 | deathbeam/vpp-agent | /plugins/vpp/ifplugin/vppcalls/vpp2106/rx_mode_vppcalls_test.go | Go | go | 2,767 | permissive | // Copyright (c) 2021 Cisco and/or its affiliates.
//
// 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 app... |
ddc92937edd0d881aceca855aecb9fd2986b956f | 0cf73a91cf79fb85009e377174e476d28ad76b46 | GenjiLuo/search_engine_included | /channels/domain_task_chan.go | Go | go | 266 | permissive | package channels
import (
"app/databases/entities"
"app/structs/models/logics"
)
var DomainTaskSendingChan chan *entities.DomainIncludeTask
func init() {
DomainTaskSendingChan = make(chan *entities.DomainIncludeTask, logics.TASK_发送下载缓冲区大小)
}
|
8a0a8e7bd4e11c0172042b0ef5e511f5832b148b | 12f6d7f60b3344cbe745c8f249835324051aa8c6 | GracepointMinistries/hub | /sync/serialize.go | Go | go | 5,146 | permissive | package sync
import (
"errors"
"fmt"
"reflect"
"strconv"
sheets "google.golang.org/api/sheets/v4"
)
type typeToCell struct {
offset int64
name string
}
const headerStart int64 = 1
func dataRangeFor(col typeToCell) string {
column := col.name
// skip the header
return column + strconv.Itoa(int(headerSta... |
1d8ce0b7569c70cfd2556ec8cb8f1ccfea2a0b69 | bf51e8611abd333d21c4d4476a84d47064f5f8d8 | EndlessCheng/codeforces-go | /leetcode/weekly/229/a/a.go | Go | go | 301 | permissive | package main
// github.com/EndlessCheng/codeforces-go
func mergeAlternately(x, y string) (ans string) {
s := make([]byte, 0, len(x)+len(y))
for x != "" || y != "" {
if x != "" {
s = append(s, x[0])
x = x[1:]
}
if y != "" {
s = append(s, y[0])
y = y[1:]
}
}
return string(s)
}
|
8575c66e05c2a3cef81503aed493323658c26611 | a1563e3d5136c9372285bf22fbb4bd0e4929f139 | balazsprehoda/blockchain-analyzer-intermediary | /agent/fabricbeat/vendor/github.com/elastic/beats/heartbeat/monitors/monitor_test.go | Go | go | 3,585 | permissive | // Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
74f54df50c981e47b94b91c5dea3e8e0d709606b | 8cbad4adfc61df626b60496f230be91c340d99b4 | intercom/intercom-go | /event.go | Go | go | 866 | permissive | package intercom
import "fmt"
// EventService handles interactions with the API through an EventRepository.
type EventService struct {
Repository EventRepository
}
// An Event represents a new event that happens to a User.
type Event struct {
ID string `json:"id,omitempty"`
Email string... |
628c64cdeb4bb5031e00ec880d5611d6e79db60c | 377bc7a11f2d6c0e9353022ed11d866a8904e19c | matsutake-eg/atcoder | /go/arc038/a/main.go | Go | go | 453 | no_license | package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
func scanInt() int {
sc.Scan()
iv, _ := strconv.Atoi(sc.Text())
return iv
}
func init() {
sc.Split(bufio.ScanWords)
}
func main() {
n := scanInt()
a := make([]int, n)
for i := range a {
a[i] = scanInt()
}... |
8852ae763f6ffbd430578716228696efaaa8c1f9 | 32b88d0abf6beddb91d3aedf5533c15ccd82827e | Bitspark/slang | /pkg/daemon/sharing_service.go | Go | go | 2,928 | permissive | package daemon
import (
"archive/zip"
"bytes"
"fmt"
"io"
"net/http"
"time"
"github.com/Bitspark/go-version"
"github.com/google/uuid"
"gopkg.in/yaml.v2"
)
type manifest struct {
SlangVersion string `yaml:"slangVersion"`
TimeUnix int64 `yaml:"timeUnix"`
}
/* TODO re-implements this service
*/
var Sh... |
cf297623662748601e341e12116ee0dfa812404b | 6f0d4587a31886f0007e73295ee274610a5f76ce | RealGeeks/bombbomb-go | /bombbomb.go | Go | go | 5,556 | permissive | // Package bombbomb is client to the BombBomb API
//
// http://bombbomb.com/api/
package bombbomb
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
)
var ErrNoSubscription = errors.New("This account does not have an active subscription. Please contact support")
var htt... |
f45d7d454114d3c4e4e6cf0be1af253aefe8fb87 | a491b09515fe126f402f0eda422d5071fc85ebd8 | munnerz/kubernetes | /pkg/client/unversioned/services_test.go | Go | go | 5,305 | permissive | /*
Copyright 2015 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... |
e092c0a6268240ddb18be3b08a83d95cc5478b53 | 3891f2249e22f00123a3733febd785ec7cba5ce8 | jon-shanks/aws_usersync | /vendor/src/github.com/aws/aws-sdk-go/service/kinesis/api.go | Go | go | 62,072 | permissive | // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package kinesis provides a client for Amazon Kinesis.
package kinesis
import (
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/service"
)
const opAddTagsToStream = "AddTagsToStream"
// AddTagsToStreamRequest generates a request for th... |
ba31da42f46cd257fd9b58d3b90f3481d93e7f89 | 5963a24e48266a0dd817d12883741358cbe52b82 | agungdwiprasetyo/agungdpcms | /src/resume/repository/repository_resume.go | Go | go | 1,380 | no_license | package repository
import (
"github.com/agungdwiprasetyo/agungdpcms/shared"
"github.com/agungdwiprasetyo/agungdpcms/shared/filter"
"github.com/agungdwiprasetyo/agungdpcms/src/resume/domain"
"github.com/jinzhu/gorm"
)
type resumeRepo struct {
db *gorm.DB
}
// NewResumeRepository construct new resume repo
func Ne... |
04b9a429fd155afdecd79e1978c63f221cba469b | 3daeac6cb5131d4462a652f05d8877d9b156aa17 | ethsana/sana | /pkg/netstore/netstore.go | Go | go | 2,760 | 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 netstore provides an abstraction layer over the
// Swarm local storage layer that leverages connectivity
// with other peers in order to retrieve ... |
a77af15385e9dd5500360cf5d32facf22e8514e4 | b0407e46f7fb021b61108751e4dffc16af709b08 | exustash/acyl | /vendor/github.com/hashicorp/vault/vault/rekey_test.go | Go | go | 11,282 | permissive | package vault
import (
"context"
"fmt"
"reflect"
"testing"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/helper/logging"
"github.com/hashicorp/vault/physical"
"github.com/hashicorp/vault/physical/inmem"
)
func TestCore_Rekey_Lifecycle(t *testing.T) {
bc, _ := TestSealDefConfigs()
bc.Secr... |
0841233e001a137f3978521c39c09ab5a179327f | 9dd0b9c65d1d00133b4fc0e3af5630e412a2f9b4 | openshift/installer | /terraform/providers/azurerm/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2022-10-01/cognitiveservicesaccounts/id_location.go | Go | go | 3,671 | permissive | package cognitiveservicesaccounts
import (
"fmt"
"strings"
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)
var _ resourceids.ResourceId = LocationId{}
// LocationId is a struct representing the Resource ID for a Location
type LocationId struct {
SubscriptionId string
LocationName string... |
cd6b5f67c4f42c4e06c24305b730b0a34cded466 | c33b3747e0c325fc613b8cfbb8869a1f64092c61 | dekklabs/crudgolang | /src/router/routers.go | Go | go | 1,366 | no_license | package router
import (
api "github.com/dekklabs/restaurantes/src/apirestaurante"
apimart "github.com/dekklabs/restaurantes/src/apirestaurante/marketsapi"
"github.com/dekklabs/restaurantes/src/middlew"
"github.com/gorilla/mux"
)
func Routers(router *mux.Router) {
// Usuarios
router.HandleFunc("/api/v1/registro"... |
20f95500bdcc95cd90acaae0b074648cd1f4898b | 8ae0fd03c1071c1afc3faecfa261d28ded9faca7 | displague/linodego | /nodebalancer_config_nodes_test.go | Go | go | 5,289 | permissive | package linodego_test
import (
"context"
"testing"
"github.com/linode/linodego"
)
var (
testNodeAddress = "192.168.128.1"
testNodePort = "8080"
testNodeLabel = "test-label"
testNodeWeight = 10
testNodeBalancerNodeCreateOpts = linodego.NodeBala... |
e063706dac3929b6d031fa296360a799a4455f47 | 49a25ccf7e2ca49166dc5ab4516cd61091e8da2d | GregorReimling/hugo | /helpers/language.go | Go | go | 6,250 | permissive | // Copyright 2016-present The Hugo 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 app... |
4090403b3bb6c5ecac88ac7f88915bc08df903dd | 12ca7a90cbc74bb26cbd52ab6f8206f55d75908b | aledbf/choices | /storage/mongo/example_data.go | Go | go | 2,567 | permissive | // Copyright 2016 Andrew O'Neill
// 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... |
75f05a6c6eb865bf1834ce6010baa29520af766e | 10bb610616c5c299e38301263d23f56cb453cac0 | nimakaviani/kapp | /pkg/kapp/cmd/appgroup/delete.go | Go | go | 2,161 | permissive | package appgroup
import (
"github.com/cppforlife/go-cli-ui/ui"
ctlapp "github.com/k14s/kapp/pkg/kapp/app"
cmdapp "github.com/k14s/kapp/pkg/kapp/cmd/app"
cmdcore "github.com/k14s/kapp/pkg/kapp/cmd/core"
cmdtools "github.com/k14s/kapp/pkg/kapp/cmd/tools"
"github.com/spf13/cobra"
)
const (
appGroupAnnKey = "kapp.... |
d9a343bcaaeec1e4d3e353cbb418702590e855e2 | cbd7a40cc589a1feba5eafe6469bae0710601d3f | github/codeql | /go/ql/test/library-tests/semmle/go/dataflow/CallGraph/test.go | Go | go | 1,080 | permissive | package main
import (
"fmt"
"hash"
"io"
)
type Resetter struct{}
func (_ Resetter) Reset() {} // name: Resetter.Reset
type MockHash struct {
Resetter
}
func (_ MockHash) Write(p []byte) (n int, err error) { // name: MockHash.Write
fmt.Println("MockHash.Write")
return 0, nil
}
func (_ MockHash) Sum(b []byte)... |
5d07ba047356ba9712e45d0ade38e8f3aa6e7874 | 2cbe5903d98afc320caac2e4f75c782b9997076e | chezearth/udemy-golang-training-new | /exercises-jedi-4/exercise-04/main.go | Go | go | 269 | no_license | package main
import "fmt"
func main() {
x := []int{42, 43, 44, 45, 46, 47, 48, 49, 50, 51}
fmt.Println(x)
x = append(x, 52)
fmt.Println(x)
x = append(x, 53, 54, 55)
fmt.Println(x)
y := []int{56, 57, 58, 59, 60}
x = append(x, y...)
fmt.Println(x)
}
|
8b9d8039d7a3c0d31a0b9b14f769cb4280ceb54f | 950c9948dad1a81beab350b8c8f2d3b0fd0f1f88 | andres-torres-dev/canastto | /main.go | Go | go | 442 | no_license | package main
import (
"encoding/json"
"io/ioutil"
"log"
"github.com/canastto/api"
)
const (
// RESPONSE is the output file name for the data
RESPONSE = "./output.json"
)
var (
service = api.New()
)
func main() {
data, err := service.GetData()
if err != nil {
log.Fatal(err)
}
b, err := json.Marshal(dat... |
dbcd94e30dee749f573b09f7da0609cfe599bbba | e4d4a8fe68eddbf243ca428c70981d6880e50b1a | CamelJong/tidb | /planner/core/integration_test.go | Go | go | 20,386 | permissive | // Copyright 2019 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... |
f8b4919868ab7e075ae00ddb2cdcbcb227e5c90f | d5e5dc2141e72f5fe29c48957a0f26c36f2e7d1b | dgsbl/bsn | /bsn-irita-fabric-relayer/core/handler.go | Go | go | 948 | no_license | package core
// HandleInterchainRequest handles the interchain request
func (r *Relayer) HandleInterchainRequest(chainID string, request InterchainRequest, txHash string) error {
r.Logger.Infof("got the interchain request on %s: %+v", chainID, request)
callback := func(icRequestID string, response ResponseI) {
r.... |
b93055cf7bf981f33ecdf616ae0e7960e651863f | 1f8b830bb6e4b56ca50b0812c3eaaafb12afcb57 | tobernguyen/karina | /pkg/api/kiosk/config/v1alpha1/templateinstance_types.go | Go | go | 3,717 | permissive | /*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
bd592a19f71c030182d6f98c597243fa94f276af | 611aa82ff9d8470cb9644f11e6ed614ce1f352ad | mamemomonga/notebook-go | /datafile/yamljson/yaml.go | Go | go | 585 | no_license | package main
import (
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
)
// YAML書出
func writeYAML(filename string, data *MyData) error {
buf, err := yaml.Marshal(data)
if err != nil {
return err
}
err = ioutil.WriteFile(filename, buf, 0644)
if err != nil {
return err
}
log.Printf("Write: %s", filename)
return nil
... |
ddc01b4f666feb61f1e63c5b402ed730736e1828 | 8c746119d8d923b34a6f078d9a983177b0e66224 | hypnoglow/durcheck | /main_test.go | Go | go | 739 | permissive | package main
import (
"bytes"
"os"
"strings"
"testing"
)
func TestLintPackage(t *testing.T) {
// buffer to send output to
buf := &bytes.Buffer{}
// exit code to capture
exitCode := -1
exitFunc := func(code int) {
exitCode = code
}
stderr = buf
exit = exitFunc
os.Args = []string{"", "./testdata/foo"}
... |
e07c0a797a437315dccc34cc4df363793aaad367 | 59323f5dd8830f65e35e9497d805d92e5077b5b4 | menehune23/jam | /internal/file_bundler_test.go | Go | go | 3,075 | no_license | package internal_test
import (
"io"
"os"
"path/filepath"
"testing"
"github.com/paketo-buildpacks/jam/internal"
"github.com/paketo-buildpacks/packit/cargo"
"github.com/sclevine/spec"
. "github.com/onsi/gomega"
. "github.com/paketo-buildpacks/packit/matchers"
)
func testFileBundler(t *testing.T, context spec... |
8af9923ed18878f90e3508c7c3a72588cca9af9a | 218a2f9c958b323339024462867641174facd264 | bergwolf/hypernetes | /pkg/kubectl/cmd/util/helpers.go | Go | go | 19,463 | 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... |
9d7c6b6773c6de2fcd97fe4294c4337fc174d421 | d55e27998110f25adb11edbadf65c46d0f8f7b27 | carryon/debugLotus | /cmd/lotus-seal-worker/main.go | Go | go | 2,527 | permissive | package main
import (
"os"
"github.com/mitchellh/go-homedir"
logging "github.com/ipfs/go-log"
"golang.org/x/xerrors"
"gopkg.in/urfave/cli.v2"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/nod... |
2b547d6a99a8ead7a88bba2883c8c3ee913ec2d4 | 11809fd50b6339c98683438d6a928d0d3ae6e852 | kernight/huobi_golang | /pkg/client/orderwebsocketclient/subscribetradeclearwebsocketv2client.go | Go | go | 2,006 | permissive | package orderwebsocketclient
import (
"encoding/json"
"fmt"
"github.com/kernight/huobi_golang/logging/applogger"
"github.com/kernight/huobi_golang/pkg/client/websocketclientbase"
"github.com/kernight/huobi_golang/pkg/model/order"
)
// Responsible to handle trade clear from WebSocket
// This need authentication v... |
55ea717f0d1c5bbc6eee3bef21a6568974fd0f78 | f0b139f51f15a6b720460698770c5e7674f5872d | mikeroySoft/buildkit-cli-for-kubectl | /pkg/driver/manager.go | Go | go | 2,405 | permissive | // Portions Copyright (C) 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package driver
import (
"context"
"sort"
"github.com/pkg/errors"
"k8s.io/client-go/tools/clientcmd"
)
type Factory interface {
Name() string
Usage() string
Priority(context.Context) int
New(ctx context.Context, cfg InitConfig)... |
ba9cdb78c9852fa16afac58a1c3e211f46d18ff7 | 4000aacd2d6d2c767f7f6e8259cfd9fed16bd4bc | openshift/installer | /terraform/providers/google/vendor/github.com/hashicorp/terraform-provider-google/google/services/identityplatform/resource_identity_platform_oauth_idp_config.go | Go | go | 15,958 | permissive | // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
// This file ... |
3ab9e26016f1324bcc28f8583dbaed5b9486e7be | 2887f0b51dc0d9ed1d8d0e1638f9161f7eac2c8d | cuisongliu/libpod | /pkg/domain/entities/engine_container.go | Go | go | 1,411 | permissive | package entities
import (
"context"
)
type ContainerEngine interface {
ContainerPrune(ctx context.Context) (*ContainerPruneReport, error)
ContainerExists(ctx context.Context, nameOrId string) (*BoolReport, error)
ContainerKill(ctx context.Context, namesOrIds []string, options KillOptions) ([]*KillReport, error)
... |
e2f947cc3ecfe7556d78c215e95776350d945d70 | a3e41ce5daeb2014c7afa2ad4d775dd323275672 | simonhayward/gkeepassxreader | /format/Entry.go | Go | go | 4,396 | permissive | package format
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
//EntryValue represents an individual entry value
type EntryValue struct {
Data string
Protected bool
PlainText string
RandomOffset int
CipherText []byte
}
// Entry represents a single Entry
type Entry struct {
Group str... |
afa9a652f4255652d836c750962f3de5831940c5 | aba2a1019dec222b6b79b1eada078f35f35414c0 | yxzhan/footloose | /config_get.go | Go | go | 1,090 | permissive | package main
import (
"encoding/json"
"fmt"
"log"
"reflect"
"github.com/weaveworks/footloose/pkg/config"
"github.com/spf13/cobra"
)
var getConfigCmd = &cobra.Command{
Use: "get",
Short: "Get config file information",
RunE: getConfig,
}
var getOptions struct {
config string
}
func init() {
getConfigC... |
5b1fc3e862e07ae44c6420ce23063c0848e342aa | ff89abdcb2271bff227427e2e839619b1d1bc5d3 | guangminglion/semaphore | /classic/example_test.go | Go | go | 1,266 | permissive | package classic_test
import (
"fmt"
"time"
"github.com/kamilsk/semaphore/classic"
)
// This example shows how to work with locking semaphore.
func Example_lockingSemaphore() {
sem := classic.NewLocking(2)
for i := 0; i < 2; i++ {
go func() {
defer sem.P(1)
fmt.Println("work is done")
}()
}
sem.V(2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.