Skip to content

Instantly share code, notes, and snippets.

@Ozoniuss
Ozoniuss / main_test.go
Last active December 9, 2023 06:22
Comparing all string vs first letter
package main
import (
"bufio"
"os"
"testing"
)
var ret = ""
@Ozoniuss
Ozoniuss / main_test.go
Last active December 10, 2023 16:26
bufio.Scanner benchmark
package main
import (
"bufio"
"os"
"testing"
)
var ret = ""
@Ozoniuss
Ozoniuss / prompter.go
Created September 30, 2023 11:30
4- capture with channels
package main
import (
"bufio"
"fmt"
"os"
"os/signal"
"strconv"
"syscall"
)
@Ozoniuss
Ozoniuss / prompter.go
Created September 30, 2023 11:25
3-span a goroutine to capture sigint
package main
import (
"bufio"
"fmt"
"os"
"os/signal"
"strconv"
"syscall"
)
@Ozoniuss
Ozoniuss / prompter.go
Created September 30, 2023 11:21
2-prompter, new scanner in each function
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
// scanStringUntilValid is a helper provided to get a string input from the
@Ozoniuss
Ozoniuss / prompter.go
Created September 30, 2023 11:20
1-prompter, first attempt
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
// scanStringUntilValid is a helper provided to get a string input from the
@Ozoniuss
Ozoniuss / abc.def
Last active November 14, 2021 06:57
hello how are you
print('hello world')
print('hello world 2')
@Ozoniuss
Ozoniuss / file2.txt
Created November 13, 2021 17:47 — forked from iuliailies/file2.txt
bro
print('hello world')