Add linefilter
This commit is contained in:
parent
ff58a428ff
commit
8625fc2d5e
21
linefilter/linefilter.go
Normal file
21
linefilter/linefilter.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
6
main.go
6
main.go
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user