Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"time"
)
func sender(out chan<- int) {
for {
time.After(1 * time.Second)
package main
import (
"fmt"
"math/rand"
"time"
)
func worker(pipeline chan<- int, counter int) {
t := rand.Intn(10)
package main
import (
"fmt"
"runtime"
"time"
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/os/gproc"
"github.com/gogf/gf/text/gstr"
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"time"
)
package main
import (
"fmt"
"log"
"os/exec"
"time"
"github.com/robfig/cron"
)
package main
import (
"fmt"
"log"
"time"
"github.com/nats-io/nats.go"
)
// Copyright 2012-2019 The NATS 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, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/***
enjoy you time,happy coding.
***/
@dtest11
dtest11 / bolt_loop.go
Created July 14, 2021 15:25
boltdb loop cursor
package main
import (
"fmt"
"log"
"sort"
"strconv"
"github.com/boltdb/bolt"
)
@dtest11
dtest11 / pg.go
Last active August 25, 2021 15:19
https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart
sudo -i -u postgres
createuser --interactive
createdb test
在电脑本机商:
sudo adduser sammy
sudo -i -u sammy