And what exactly is the problem ? Well, If you have to access n and d in the Nunm struct you have to specify them in uppercase.
HTH, Yamil El martes, 4 de septiembre de 2018, 10:32:40 (UTC-5), Sayan Shankhari escribió: > > Hello Masters, > Probably I am making some nonsense post here and disturbing you but as a > beginner, I want to know how in Go I can implement the following. If I can > not, please suggest me suitable solution: > 1. Create a package "myNum" > 2. containing data type like: > type Num struct { > n, d int // numerator, denominator > } > 3. and a function to print like > func printMyNum(x Num) { > fmt.Println("the fractional number is: %d/%d", x.n, x.d) > } > 4. access and use it from "main" both the datatype as well as function > I think for masters, to solve this is a matter of minute. So please help > me. > Thank You. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.