Exemple #1
0
func Id(nuc string) (Nuc, error) {
	cs := C.CString(nuc)
	defer C.free(unsafe.Pointer(cs))
	n := Nuc(C.id_str(cs))
	if n < 0 {
		return 0, fmt.Errorf("'%v' is not a valid nuclide", nuc)
	}
	return n, nil
}
Exemple #2
0
func Id(nuc string) Nuc {
	cs := C.CString(nuc)
	defer C.free(unsafe.Pointer(cs))
	return Nuc(C.id_str(cs))
}