Browse Source

README

pull/1/head
dewjjj 8 months ago
parent
commit
cbc5139687
  1. 2
      README.md
  2. 23
      flag0/flag0.go

2
README.md

@ -11,4 +11,6 @@
|7|boiling0|温度转换案例一|
|8|boiling1|温度转换案例二|
|9|index0|指针案例一|
|10|flag0|flag包案例一|
|11|new|new函数案例一|
||||

23
flag0/flag0.go

@ -0,0 +1,23 @@
package main
import (
"flag"
"fmt"
"strings"
)
var n = flag.Bool("n", false, "omit trailing newline")
var sep = flag.String("s", "/", "separator")
func main() {
flag.Parse()
for k, v := range flag.Args() {
fmt.Println(k, v)
}
fmt.Print(strings.Join(flag.Args(), *sep))
if !*n {
fmt.Println()
}
fmt.Println("~")
}
Loading…
Cancel
Save