Go program used for Delve
This commit is contained in:
parent
81fe5cf253
commit
98f8a77e8d
1 changed files with 26 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func function(i int) int {
|
||||
return i * i
|
||||
}
|
||||
|
||||
func main() {
|
||||
if len(os.Args) == 1 {
|
||||
fmt.Println("Need at least one argument.")
|
||||
return
|
||||
}
|
||||
|
||||
i := 5
|
||||
fmt.Println("Debugging with Delve")
|
||||
fmt.Println(i)
|
||||
fmt.Println(function(i))
|
||||
|
||||
for arg, _ := range os.Args[1:] {
|
||||
fmt.Println(arg)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue