相当于ansi c raise()的golang

What is the golang equivalent of the ANSI C raise() function?

See here for an example usage of raise():

You can do it using the os package:

p, err := os.FindProcess(os.Getpid())
p.Signal(os.Interrupt)

Additionally, you can catch signals sent to your process using the os/signal package, which allows you to specify a channel on which to receive signals:

c := make(chan os.Signal)
signal.Notify(c, os.Interrupt)
sig := <-c
fmt.Printf("Got %s!
", sig.String())

This implementation won't work on the go playground because it won't let you import os/signal, but if you run the code locally, it should work fine (does on my machine): http://play.golang.org/p/QcrRl2BeNS

Something like this?

process,_ := os.FindProcess(os.Getpid())
process.Signal(os.Kill)

...where os.Kill is one of the (sadly few) standard signals defined here or UNIX platform signals here.