text stringlengths 3.08k 10.4k |
|---|
package weberr
import (
"fmt"
"io"
"testing"
)
// TestGetStackTrace tests that the stack always starts with the root cause
func TestGetStackTrace(t *testing.T) {
fmt.Printf("trace:%s\n", GetStackTrace(nil))
err := NoType.UserErrorf("user error")
fmt.Printf("trace:%s\n", GetStackTrace(err))
err = UserWrapf(er... |
package acsengine
import (
"encoding/base64"
"fmt"
"log"
"testing"
"github.com/Azure/terraform-provider-acsengine/internal/resource"
"github.com/Azure/terraform-provider-acsengine/internal/utils"
"github.com/hashicorp/terraform/terraform"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/api/erro... |
package main
import (
"crypto/tls"
"crypto/x509"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"github.com/google/uuid"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/target"
"github.com/osbuild/osbuild-composer/internal/upload/awsupload"
... |
// Copyright 2019 dfuse Platform 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 agre... |
// 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... |
// @File: jd_city_cash.go
// @Time: 2022/1/11 22:34
// @Author: ClassmateLin
// @Email: <EMAIL>
// @Site: https://www.classmatelin.top
// @Description: 京东饭粒
// @Cron: 0 4 * * *
package main
import (
"fmt"
"github.com/go-resty/resty/v2"
"github.com/tidwall/gjson"
"scripts/config/jd"
"scripts/constracts"
"scrip... |
// 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... |
package views
import (
"context"
"errors"
"fmt"
"strings"
"github.com/derailed/k9s/internal/k8s"
"github.com/derailed/k9s/internal/resource"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/k9s/internal/ui/dialog"
"github.com/gdamore/tcell"
"github.com/rs/zerolog/log"
"k8s.io/client-go/tools/port... |
package goethx
import (
"context"
"errors"
"log"
"math/big"
"testing"
"time"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/sirupsen/logrus"
)
func TestNewTxMgr(t *testing.T) {
tests := []struct {
name string... |
package pistol
import (
"io"
"fmt"
"math"
"regexp"
"archive/tar"
"archive/zip"
"github.com/nwaples/rardecode"
"github.com/mholt/archiver/v3"
log "github.com/sirupsen/logrus"
"github.com/dustin/go-humanize"
)
type archiveFileInfo struct {
Permissions string
Size string
ModifiedTime string
FileName strin... |
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2019-present, Jet.com, 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
//
... |
package ext
import (
"fmt"
"xelf.org/xelf/cor"
"xelf.org/xelf/exp"
"xelf.org/xelf/lit"
"xelf.org/xelf/typ"
)
// Rule is a configurable helper for assigning tags to nodes.
type Rule struct {
Prepper KeyPrepper
Setter KeySetter
}
// KeyPrepper resolves el and returns a value to be assigned to key or an error.... |
/*
* Copyright 2017 <NAME>
*
* 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... |
/*
* Copyright 2020 EPAM Systems.
*
* 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... |
package main
import (
"context"
"fmt"
"runtime/debug"
"sync"
"time"
"github.com/rsms/go-log"
"github.com/rsms/memex/extension"
)
// —————————————————————————————————————————————————————————————————————————————————————
// implementation of extension.Extension
type Extension struct {
name string
version s... |
package docs_demo
// package gce
import (
"context"
"os"
"time"
v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2"
v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
"github.com/solo-io/gloo/projects/gloo/pkg/discovery"
"github.com/solo-io/gloo/projects/gloo/pkg/plugins"
"github.com/solo-io/solo-kit... |
package api
import (
"crypto/sha512"
"encoding/json"
"fmt"
"github.com/moio/booster/gzip"
"github.com/moio/booster/wharf"
"github.com/pkg/errors"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"path"
"regexp"
"sort"
"strings"
)
// Serve serves the HTTP API
func Serve(basedir string, port int, primar... |
package http_logrus_test
import (
"fmt"
"net/http"
"runtime"
"strings"
"testing"
"github.com/improbable-eng/go-httpwares"
"github.com/improbable-eng/go-httpwares/logging/logrus"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
func customMiddlewareCode... |
package connpool
import (
"context"
"errors"
"testing"
"time"
assert "github.com/stretchr/testify/assert"
grpc "google.golang.org/grpc"
)
// Test 0:
// Create a pool with 0 capacity, ensure it is set to 1 capaicity
// Close an empty pool
// Call Get on an empty pool
func TestPool0(t *testing.T) {
assert := as... |
// CodeGenerationWarning
package shortw
import (
"crypto/elliptic"
"math/big"
)
// References:
//
// [msrecclibpaper] <NAME>, <NAME>, <NAME> and <NAME>. Selecting
// Elliptic Curves for Cryptography: An Efficiency and Security Analysis.
// Cryptology ePrint Archive, Report 2014... |
package ftdc
import (
"fmt"
"math"
"sort"
"strings"
)
// CmpThreshold is the threshold for comparison of metrics used by the
// Proximal function.
var CmpThreshold float64 = 0.2
var cmpMetrics = map[string]bool{
"end": true,
"start": ... |
// Copyright 2018 <NAME>.A.S. Atos Technologies - Bull, R<NAME> Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
//
// 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.... |
package api
import (
"bytes"
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"strings"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/rancher/norman/types"
)
type ServerContext... |
// Copyright 2021 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
// Copyright 2019 Andrew 'Diddymus' Rolfe. All rights reserved.
//
// Use of this source code is governed by the license in the LICENSE file
// included with the source code.
package cmd
import (
"code.wolfmud.org/WolfMUD.git/attr"
"code.wolfmud.org/WolfMUD.git/has"
"code.wolfmud.org/WolfMUD.git/text"
)
// Syntax... |
package cartridge
import (
"fmt"
"github.com/dobyrch/termboy-go/types"
"github.com/dobyrch/termboy-go/utils"
"strings"
)
//Represents MBC3
type MBC3 struct {
Name string
romBank0 []byte
romBanks [][]byte
ramBanks [][]byte
selectedROMBank int
selectedRAMBank int
hasRAM ... |
/*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the followin... |
package meta
import (
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/printer"
"go/token"
"go/types"
"io"
"os"
"strings"
)
type Package struct {
pkg *types.Package
fset *token.FileSet
info types.Info
files []*ast.File
qual types.Qualifier
}
func (p *Package) Name() string {
return p.pkg.Name()
}
fu... |
package alert
import (
"bytes"
"github.com/guanaitong/crab/gconf"
"github.com/guanaitong/crab/hc"
"github.com/guanaitong/crab/json"
"github.com/guanaitong/crab/system"
"github.com/guanaitong/crab/util/runtime"
"log"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
// way = 0
byAppNameUrl = "/v2... |
package collector
import (
"github.com/tietang/props/kvs"
"time"
"math"
"strconv"
"net/url"
"io/ioutil"
"net/http"
"encoding/json"
"github.com/rcrowley/go-metrics"
"github.com/tietang/go-eureka-client/eureka"
log "github.com/sirupsen/logrus"
"strings"
"reflect"
"... |
package themekit
import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"sync"
"time"
)
const CreateThemeMaxRetries int = 3
type ThemeClient struct {
config Configuration
client *http.Client
}
type Theme struct {
Name string `json:"name"`
Source strin... |
package block_test
import (
"encoding/json"
"testing"
"github.com/ipfs/go-cid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
blk "github.com/filecoin-project/go-filecoin/internal/pkg/block"
"github.com/filecoin-project/go-filecoin/internal/pkg/encoding"
tf "github.com/filecoin-pr... |
// Package seqmgr
// Created by Teocci.
// Author: <EMAIL> on 2021-Aug-28
package seqmgr
import (
"context"
"fmt"
"sort"
"strings"
"sync"
"golang.org/x/sync/errgroup"
)
// Agent represents the execution of a sequence of Services.
// For any sequence, there will be two agents in play: one for
// the startup se... |
package xgrpc
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/brian-god/brian-go/pkg/xcodec"
"google.golang.org/grpc"
"net/http"
"reflect"
"strings"
)
/**
* grpc handler
* Copyright (C) @2020 hugo network Co. Ltd
* @description
* @updateRemark
* @author hugo
* @updateUser
*... |
package service
import (
"encoding/json"
"errors"
"fmt"
"github.com/gin-gonic/gin"
"github.com/snowlyg/go-tenancy/g"
"github.com/snowlyg/go-tenancy/model"
"github.com/snowlyg/go-tenancy/model/request"
"github.com/snowlyg/go-tenancy/utils"
"go.uber.org/zap"
"gorm.io/gorm"
)
// GetMqttMap
func GetMqttMap(id ... |
/*
Copyright 2020 waveywaves
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... |
// Package reminders holds the application logic to manage reminders (tasks one seeks to remember).
//
// Copyright 2015-2019 VMware, Inc. All Rights Reserved.
// Author: <NAME> (<EMAIL>)
//
// SPDX-License-Identifier: https://spdx.org/licenses/MIT.html
//
package reminders
import (
"crypto/md5"
"crypto/rand"
"data... |
package server
import (
"sync"
"time"
"github.com/pkg/errors"
"fastlive/pkg/av"
"fastlive/pkg/rtmp/chunk"
)
type session struct {
id string //推流会话ID
vhost string
appName string
streamName string
publisher *conn //收流端
players sync.Map //播流端 <player地址>
offline chan bool //流会话下线
... |
package keeper
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/iov-one/starnamed/x/escrow/types"
)
// RegisterInvariants registers all escrow invariants
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) {
ir.RegisterRoute(types.ModuleName, "attributes", AttributeInvariant(k))
ir.R... |
// Copyright 2017 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or a... |
package user
import (
"fmt"
"strings"
"strconv"
"github.com/haisum/smpp-app/pkg/db"
"github.com/haisum/smpp-app/pkg/entities/user"
"github.com/haisum/smpp-app/pkg/logger"
"github.com/pkg/errors"
"gopkg.in/doug-martin/goqu.v3"
)
const (
// defaultConnectionGroup is set for each user who doesn't specifically... |
package fmp4parser
import (
"errors"
"sync/atomic"
)
// bufferCache is a simple queue for mp4Buffer used for fmp4parser
const SlotEntry = 1024
const SlotSize = 4096
// internal mp4Buffer size is 4M == SlotEntry*SlotSize bytes
// bufferCache.b is a consecutive bytes
// How it works: Slice b is divided into 1024 su... |
// 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 2017 Datadog, Inc.
package config
import (
"fmt"
"io/ioutil"
"path/filepath"
"regexp"
"github... |
package buffer
import (
"context"
"fmt"
"runtime/debug"
"sync"
"sync/atomic"
"time"
log "github.com/sirupsen/logrus"
cmn "github.com/thetatoken/theta/p2pl/common"
"github.com/thetatoken/theta/p2pl/transport/buffer/flowrate"
)
//
// SendBuffer
//
const MaxErrorInARow = 3
type SendBuffer struct {
workspace... |
package main
import (
"context"
"flag"
"log"
"net/http"
"time"
secretmanager "cloud.google.com/go/secretmanager/apiv1"
"github.com/justinas/alice"
"gopkg.in/square/go-jose.v2/jwt"
"github.com/m-lab/access/controller"
"github.com/m-lab/go/content"
"github.com/m-lab/go/flagx"
"github.com/m-lab/go/httpx"
"... |
/*
Package auth provides ability to verify API Keys,
that brings an abstraction layer between
applications that require API Key authentication
and authentication providers.
*/
package auth
import (
"context"
"encoding/hex"
"errors"
"fmt"
"io"
"strings"
"sync"
"github.com/google/uuid"
"gocloud.dev/docstore"
)... |
// Copyright 2021 Andrew 'Diddymus' Rolfe. All rights reserved.
//
// Use of this source code is governed by the license in the LICENSE file
// included with the source code.
package main
import (
"bytes"
"fmt"
"log"
"math/rand"
"net"
"time"
)
// btoi maps a boolean to an integer
var btoi = map[bool]int{false:... |
package slash_command
// https://discord.com/developers/docs/interactions/slash-commands
import (
"bytes"
"context"
"crypto/ed25519"
"encoding/hex"
"encoding/json"
"github.com/virtual-vgo/vvgo/pkg/clients/discord"
"github.com/virtual-vgo/vvgo/pkg/logger"
"github.com/virtual-vgo/vvgo/pkg/server/http_helpers"
... |
package streamxlsx
import (
"encoding/xml"
"io"
)
const DefaultDatetimeFormat = "m/d/yy h:mm"
// A Stylesheet has all used formats and styles. There is exactly one per document.
// It's recommended to use `Format()` to work with styles, since that hides all the details.
//
// note: this could have support for font... |
package stringutils
import (
"math/bits"
)
// WriteInt appends the string form of the integer i,
// as generated by FormatInt, to dst and returns the extended buffer.
func (sb *Builder) WriteInt(i int64, base int) {
// if 0 <= i && i < nSmalls && base == 10 {
// sb.WriteString(smallInt(int(i)))
// }
sb.formatBi... |
//go:generate mockgen -destination ./mock/client.go . Client
package castai
import (
"bytes"
"compress/gzip"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"time"
"github.com/go-resty/resty/v2"
"github.com/sirupsen/logrus"
"castai-agent/internal/config"
)
const (
defaultRetryCount = 3
defau... |
package rome
import (
"sync/atomic"
"time"
"github.com/gorilla/websocket"
)
var (
playerAutoID uint64
)
// IPlayerConn 用户
type IPlayerConn interface {
LoginInput() (b []byte, err error)
Login(b []byte) (ok bool)
SendManager(pchan chan IPlayerConn, np IPlayerConn) (ok bool)
SetRoom(r IRoom)
GetWorldID() int... |
// Copyright © 2019 Bitgrip <<EMAIL>>
//
// 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... |
package memoise
import (
"context"
"errors"
"time"
)
var (
// ErrValueExpired - error returned when RefreshExplicit is set
ErrValueExpired = errors.New("the cache value has expired")
// ErrDuplicateEntry - error returned by CAS (or when default is to check duplicates)
ErrDuplicateEntry = errors.New("cache alre... |
package root
import (
"bytes"
"errors"
"io"
"github.com/iotaledger/goshimmer/packages/ledgerstate"
"github.com/iotaledger/wasp/packages/hashing"
"github.com/iotaledger/wasp/packages/iscp"
"github.com/iotaledger/wasp/packages/iscp/coreutil"
"github.com/iotaledger/wasp/packages/util"
)
var (
Contract ... |
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"regexp"
"strconv"
"strings"
"github.com/kentquirk/stringset/v2"
)
// ValidRange has a min and max and can check for containment
// of an int within the range.
type ValidRange struct {
min int
max int
}
// In returns true if the argument is in range.
func... |
/*
Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
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 ... |
/*
Copyright (c) 2016 IBM Corporation and other 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 applicable law or ag... |
package promread
import (
"context"
"net/url"
"path"
"github.com/go-kit/kit/log"
"github.com/pkg/errors"
config_util "github.com/prometheus/common/config"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/timestamp"
"github.com/prometheu... |
package ciscoise
import (
"context"
"reflect"
"log"
isegosdk "github.com/CiscoISE/ciscoise-go-sdk/sdk"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
// dataSourceAction
func dataSourceBackupConfig() *schema.Resource {
return &schema.Resou... |
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2019-2022 Intel Corporation
package main
// TODO Need to extend for multi CNDP container support as more than one
// may run in the pod
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"sort"
"strings"
"time"
"github.com/CloudNativeDataPla... |
package sat
import (
"crypto/rand"
"flag"
"fmt"
"math/big"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/suborbital/atmo/atmo/appsource"
"github.com/suborbital/atmo/atmo/coordinator/capabilities"
"github.com/suborbital/atmo/atmo/options"
"github.co... |
// Code generated by protoc-gen-go.
// source: popcount.proto
// DO NOT EDIT!
package Spotify
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type Pop... |
/*
* Ory Kratos API
*
* Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the adminis... |
package gb
import (
"fmt"
"go/build"
"os"
"path/filepath"
"runtime"
"github.com/constabulary/gb/log"
)
// gc toolchain
type gcToolchain struct {
gc, cc, ld, as, pack string
}
func GcToolchain() func(c *Context) error {
return func(c *Context) error {
// TODO(dfc) this should come from the context, not th... |
package docker
import (
"context"
"fmt"
"io"
"log"
"os"
"strconv"
"testing"
"github.com/docker/go-connections/nat"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/swarm"
"github.com/docke... |
package config
import (
"errors"
"fmt"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"io/ioutil"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
certutil "k8s.io/client-go/util/cert"
"k8s.io/client-go/util/homedir"
"net"
"os"
"os/user"
"path"
)
const (
// DefaultConfigurationName is the d... |
//go:build !nocgo
// +build !nocgo
package fathom
// #cgo CFLAGS: -O3 -std=gnu11 -w -mavx
// #include "tbprobe.h"
// #include <stdlib.h>
import "C"
import (
"fmt"
"math/bits"
"strings"
"unsafe"
. "github.com/amanjpro/zahak/engine"
)
const DefaultProbeDepth = 0
var MinProbeDepth int8 = DefaultProbeDepth
var Ma... |
package conf
import (
"errors"
"flag"
"github.com/BurntSushi/toml"
"go-common/library/conf"
"go-common/library/database/sql"
ecode "go-common/library/ecode/tip"
"go-common/library/log"
"go-common/library/log/infoc"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/rpc"
"go-common/library/... |
package handlers
import (
"archive/tar"
"archive/zip"
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"path"
"regexp"
"strconv"
"strings"
"github.com/julienschmidt/httprouter"
"github.com/suyashkumar/bin/releases"
)
// OS is an enum representing an operating system variant
t... |
package main
import (
"fmt"
"github.com/goccy/go-yaml"
log "github.com/sirupsen/logrus"
"io/fs"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// a tray represents all the contents
// (config, fs, and post-processed) of
// one directory path
type Tray interface {
Name() string // just the dir... |
package gruby
import (
"go/ast"
"go/token"
)
func (p *Printer) expr1(exp ast.Expr, prec1, depth int) {
p.print(exp.Pos())
switch x := exp.(type) {
case *ast.BadExpr:
panicf("print: got a bad expression %v", x)
// case *ast.Ellipsis:
case *ast.BasicLit:
p.print(x)
// case *ast.FuncLit:
// case *ast.Compo... |
/*
* Copyright 2020 The Dragonfly 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 la... |
package main
import (
"sync"
"syscall/js"
fmfm "github.com/but80/fmfm.core"
"github.com/but80/fmfm.core/sim"
"gopkg.in/but80/go-smaf.v1/pb/smaf"
)
var (
lib smaf.VM5VoiceLib
chip *sim.Chip
ctrl *fmfm.Controller
initOnce sync.Once
wait = make(chan struct{})
)
// // fmfmLoadLibrary は、ライブラリを... |
package main
import (
"bytes"
"fmt"
"github.com/jawher/mow.cli"
"github.com/rjeczalik/notify"
"log"
"os"
"os/exec"
"regexp"
"strings"
)
// Constants to get app name and description
const (
AppName = "fswatcher"
AppDesc = "Watch filesystem events using inotify"
AppDescOther = "Use %f for file/dir... |
/*
Copyright 2019 Comcast Cable Communications Management, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: prime/prime.proto
package prime
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a comp... |
package executor
import (
"fmt"
"sync"
"time"
"github.com/funkygao/fae/servant/mysql"
"github.com/funkygao/gafka/cmd/kateway/hh"
"github.com/funkygao/gafka/cmd/kateway/job"
jm "github.com/funkygao/gafka/cmd/kateway/job/mysql"
"github.com/funkygao/gafka/cmd/kateway/manager"
"github.com/funkygao/gafka/cmd/kate... |
package api
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
log "github.com/sirupsen/logrus"
)
// PollenReport represents the report of pollen data
type PollenReport struct {
Location string `json:"location"` // The location for the report
Zipcode string `json:"zip... |
/*
* Copyright (c) 2018, <NAME> (<<EMAIL>>)
*
* 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 o... |
package alarm
import (
"github.com/tidepool-org/platform/data"
"github.com/tidepool-org/platform/data/types"
"github.com/tidepool-org/platform/data/types/device"
dataTypesDeviceStatus "github.com/tidepool-org/platform/data/types/device/status"
"github.com/tidepool-org/platform/structure"
structureValidator "gith... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: pb/class.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-ti... |
// Copyright 2014 <NAME>. All rights reserved.
// This package implements a simple HTTP server providing a REST API to a tennis camp reservation system.
//
// It provides four methods:
//
// GET /camp/ Retrieves all reservations.
// POST /camp/ Creates a new camp given details.
// GET /camp/{campID... |
package main
import (
"bytes"
"flag"
"go/format"
"io/ioutil"
"log"
"text/template"
yaml "gopkg.in/yaml.v2"
)
var program = `package main
import (
// Import the entire framework
_ "github.com/ReconfigureIO/sdaccel"
aximemory "github.com/ReconfigureIO/sdac... |
package main
import (
"flag"
"fmt"
"log"
"net/url"
"os"
"strconv"
"strings"
"github.com/st3v/runtime-configurator/bosh"
"github.com/st3v/runtime-configurator/configurator"
"github.com/st3v/runtime-configurator/deployer"
)
var (
dirTarget string
dirUser string
dirPassword string
... |
/*
Package elev implements a simple elevator controller that directs the elevator
to a goal floor and handles arrival at goal floor.
*/
package elev
import (
"errors"
"fmt"
"github.com/sigtot/elevio"
"github.com/sigtot/sanntid/types"
"github.com/sigtot/sanntid/utils"
"github.com/sirupsen/logrus"
"sync"
"time"
... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package gentle
import (
"context"
"errors"
"github.com/opentracing/opentracing-go"
tlog "github.com/opentracing/opentracing-go/log"
"time"
)
// TracingRef is opentracing tracing causal reference, currently either a
// ChildOf or a FollowsFrom.
type TracingRef int
const (
// TracingDisabled indicates that traci... |
package gnuplot
import (
"fmt"
"github.com/ViaQ/logerr/log"
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/config"
"github.com/openshift/cluster-logging-operator/internal/cmd/functional-benchmarker/stats"
htmllib "html"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"strings"
"t... |
package reconciler
import (
"context"
"encoding/json"
"fmt"
"strconv"
"github.com/go-logr/logr"
"github.com/valyala/fasttemplate"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/... |
package apidiff
import (
"bytes"
"encoding/json"
"fmt"
"io"
"strconv"
"github.com/dnaeon/go-vcr/cassette"
"github.com/olekukonko/tablewriter"
)
// UI contains helpers for drawing CLI interface
type UI struct {
out io.Writer
}
// NewUI returns instance
func NewUI(w io.Writer) *UI {
return &UI{
out: w,
}
... |
package txmpg
import (
"context"
"database/sql"
"errors"
"fmt"
"log"
"runtime"
"time"
"github.com/google/uuid"
"github.com/lib/pq"
"github.com/williammoran/txmanager/v2"
)
// NewFinalizer2P is a constructor for a Postgres
// transaction driver that uses 2-phase commit.
// This finalizer provides the highes... |
package main
import (
"database/sql"
"encoding/json"
"fmt"
"math"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"time"
"unicode"
_ "github.com/lib/pq"
"golang.org/x/text/language"
"golang.org/x/text/runes"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
)
var nameFixReplace = regexp.Must... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
)
// This module implements a module to handle communications
// with the tecthulhu device. These devices appear to provide a WiFi
// like capability but the documentation appears to indicate a serial
// like communi... |
package flamingo
// Form is the way to post complex structures with the bot.
// Forms can have title, text, color, footer, several Fields
// (buttons, text fields, images, ...), etc.
type Form struct {
// Title is the title of the form.
Title string
// AuthorIconURL sets the icon of the form author to the given one... |
package main
import (
"fmt"
"log"
"math/rand"
"strconv"
"sync"
"time"
"encoding/base64"
"encoding/hex"
"github.com/chilts/sid"
guuid "github.com/google/uuid"
"github.com/kjk/betterguid"
"github.com/lithammer/shortuuid"
"github.com/oklog/ulid"
"github.com/rs/xid"
uuid "github.com/satori/go.uuid"
"gith... |
package main
import (
"encoding/json"
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"testing"
"time"
)
func TestAllPipelinesHandler(t *testing.T) {
var pipelines []Pipeline
err := json.Unmarshal(ca... |
/*
Copyright SUSE LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... |
// Copyright (c) 2015 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, ... |
package loghook
import (
"encoding/json"
"errors"
"fmt"
"github.com/Sirupsen/logrus"
sls "github.com/aliyun/aliyun-log-go-sdk"
"os"
"time"
)
const (
defaultBatchInterval = 5 * time.Second
defaultBatchSize = 1000
defaultMaxAttempts = 10
defaultBufferSize = 32768
)
var defaultLevels = []logrus.Leve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.