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 120 views
2 answers 265 views
1 answer 215 views
1 answer 231 views
1 answer 178 views
178 views asked May 19, 2025 by avibootz
...