Initial commit
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
arg := os.Args[1]
|
||||
|
||||
// feet is a float64 now
|
||||
feet, _ := strconv.ParseFloat(arg, 64)
|
||||
|
||||
meters := feet * 0.3048
|
||||
|
||||
fmt.Printf("%f feet is %f meters.\n", feet, meters)
|
||||
|
||||
// pretty print it:
|
||||
|
||||
// fmt.Printf("%g feet is %g meters.\n", feet, meters)
|
||||
}
|
Reference in New Issue
Block a user