Add linefilter

This commit is contained in:
Sangeeth Sudheer 2024-05-03 17:02:30 +05:30
parent ff58a428ff
commit 8625fc2d5e
Signed by: x
GPG Key ID: F6D06ECE734C57D1
2 changed files with 25 additions and 2 deletions

21
linefilter/linefilter.go Normal file
View File

@ -0,0 +1,21 @@
package linefilter
import (
"bufio"
"fmt"
"os"
"strings"
)
func LineFilter() {
sc := bufio.NewScanner(os.Stdin)
for sc.Scan() {
cap := strings.ToUpper(sc.Text())
fmt.Println(cap)
}
if err := sc.Err(); err != nil {
panic(err)
}
}

View File

@ -34,7 +34,8 @@ package main
// import "git.sangeeth.dev/gobyexample/url" // import "git.sangeeth.dev/gobyexample/url"
// import "git.sangeeth.dev/gobyexample/sha" // import "git.sangeeth.dev/gobyexample/sha"
// import "git.sangeeth.dev/gobyexample/base64" // import "git.sangeeth.dev/gobyexample/base64"
import "git.sangeeth.dev/gobyexample/files" // import "git.sangeeth.dev/gobyexample/files"
import "git.sangeeth.dev/gobyexample/linefilter"
func main() { func main() {
// runes.Runes() // runes.Runes()
@ -71,5 +72,6 @@ func main() {
// url.Url() // url.Url()
// sha.Sha() // sha.Sha()
// base64.Base64() // base64.Base64()
files.Files() // files.Files()
linefilter.LineFilter()
} }