go-examples/converter-main/main.go

21 lines
324 B
Go
Raw Normal View History

2017-07-09 08:28:56 +00:00
package main
import "fmt"
import "log"
import "os"
2017-07-09 15:00:24 +00:00
import . "meutel.net/meutel/go-examples/converter"
2017-07-09 08:28:56 +00:00
func main() {
if len(os.Args) < 3 {
log.Fatalln("Needs 2 arguments")
}
input := os.Args[1]
convTo := os.Args[2]
2017-07-09 15:00:24 +00:00
result, err := Convert(input, convTo)
2017-07-09 08:48:34 +00:00
if err != nil {
log.Fatalln(err)
}
fmt.Println(result)
2017-07-09 08:28:56 +00:00
}