Guest User

Untitled

a guest
Jul 17th, 2018
1,821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import "fmt"
  2. import "os"
  3. import "strconv"
  4. import "time"
  5.  
  6. const iName string = "Iein"
  7.  
  8. type person struct {
  9. age int;
  10. firstName string;
  11. }
  12.  
  13. func nfact(n int) (r int) {
  14.  
  15. if n == 1 {
  16. r = 1
  17. } else {
  18. r = n * nfact(n-1)
  19. }
  20.  
  21. return r;
  22.  
  23. }
  24.  
  25. func main() {
  26.  
  27. var p = new(person);
  28.  
  29. p.age = 34;
  30. p.firstName = "iein valdez";
  31.  
  32. fmt.Println("Hello world");
  33. fmt.Println("from " + iName);
  34. fmt.Println(os.Geteuid);
  35. fmt.Println("Page size is: " + strconv.Itoa(os.Getpagesize()));
  36.  
  37. fmt.Println("Time is: " + time.LocalTime().String());
  38.  
  39. fmt.Println("Person is " + p.firstName + " age is " + strconv.Itoa(p.age));
  40.  
  41. fmt.Println(strconv.Itoa(nfact(4)));
  42.  
  43. }
Add Comment
Please, Sign In to add comment