How to stop a program in Go

1 Answer

0 votes
package main

import (
    "fmt"
    "os"
)

func main() {
    fmt.Println("abc")
    
    os.Exit(0)  
    
    fmt.Println("xyz")
}



/*
run:

abc

*/

 



answered May 19, 2025 by avibootz

Related questions

2 answers 106 views
2 answers 221 views
1 answer 200 views
1 answer 211 views
1 answer 151 views
151 views asked May 19, 2025 by avibootz
...