Skip to content

Instantly share code, notes, and snippets.

View nicewook's full-sized avatar

Jeong Hyunseok nicewook

View GitHub Profile
package main
import (
"fmt"
"time"
)
// local time calculation
func main() {
currentTime := time.Now()
package main
import (
"fmt"
"time"
)
// local time calculation
func main() {
currentTime := time.Now()
@nicewook
nicewook / mygist.go
Last active September 21, 2020 10:15
my gist test code
package main
import "fmt"
func main() {
fmt.Println("I will upload this file to GitHub by using GitHub CLI")
fmt.Println("I edit this for thet gist edit feature")
}
package main
import (
"fmt"
"time"
)
func main() {
doneOrDone := make(chan interface{})
doneRepeat := make(chan interface{})
package main
import (
"fmt"
"time"
)
func main() {
doneOrDone := make(chan interface{})
doneRepeat := make(chan interface{})
package main
import (
"fmt"
"time"
)
func main() {
doneOrDone := make(chan interface{})
doneRepeat := make(chan interface{})
orDone := func(done, c <-chan interface{}) <-chan interface{} {
valStream := make(chan interface{})
go func() {
defer close(valStream)
for {
select {
case <-done:
return
case v, ok := <-c:
if ok == false {
package main
import (
"encoding/binary"
"encoding/json"
"fmt"
"log"
"github.com/timshannon/bolthold"
bolt "go.etcd.io/bbolt"
package main
import (
"sync"
"testing"
)
func BenchmarkContextSwitch(b *testing.B) {
var wg sync.WaitGroup
begin := make(chan struct{})
@nicewook
nicewook / namedpipe-loop.go
Created March 5, 2020 06:30
named pipe with go - infinite loop of write and read
package main
import (
"bufio"
"fmt"
"log"
"os"
"syscall"
)