import ( "regexp" "fmt" ) func main () { exactDate () } func exactDate () { str1 := "If I am 20 years 10 months and 14 days old as of August 17,2016 then my DOB would be 1995-10-03" re := regexp. MustCompile ( `\d{4}-\d{2}-\d{2}` ) b := re. MatchString (str1) if b { val := re. FindAllString (str1, 1 ) fmt. Println (val[ 0 ]) } } more details
Factorial of number using recursive using golang program package main import ( "fmt" ) func main () { recursive ( 10 ) } func recursive (n int ) int { if n == 1 { return 1 } return (n * recursive (n - 1 )) }