[go-nuts] Re: beginner question about chanels

2018-05-04 Thread k1attila1
Thank you Sir now i understand the difference 2018. május 4., péntek 15:21:49 UTC+2 időpontban k1at...@gmail.com a következőt írta: > > Hi > > i dont' understn what is the difference between : > > ch := make(chan bool,1) vs. ch := make(chan bool) > > this sample works well : > > packag

[go-nuts] beginner question about chanels

2018-05-04 Thread k1attila1
Hi i dont' understn what is the difference between : ch := make(chan bool,1) vs. ch := make(chan bool) this sample works well : package main import ( "fmt" "sync" ) var x = 0 func increment(wg *sync.WaitGroup, ch chan bool) { ch <- true x = x + 1 <-ch wg.Done() } func main() { var

Re: [go-nuts] Beginner question about interface

2018-04-28 Thread k1attila1
Thank you But how do you know which types has this method ? Thank you Attila (Én voltam az aki már irt neked egyszer, de még mindig csak küzdök ezzel a Goval - szerencse csak hobbi.) 2018. április 28., szombat 9:00:27 UTC+2 időpontban Tamás Gulácsi a következőt írta: > > See what an io.Read

Re: [go-nuts] Beginner question about interface

2018-04-27 Thread k1attila1
I want to search in all library (which have source code) Maybe i don't understand the concept of Golang (I have delphi,c++,c background) for exmaple : I see this. This function need an interface type : r func NewScanner(r io .Reader

[go-nuts] Beginner question about interface

2018-04-27 Thread k1attila1
Hi How can i get a list of types which implement a particular interface ? ( for exmaple io.Reader) Thank you in advance Attila -- 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, s

[go-nuts] interface question

2018-03-02 Thread k1attila1
Hi Beginner question I want to use this : func Open(name string) (*File, error) I would like to us *File as return value. File is declared as : type File struct { *file // os specific } I understand it. BUT How can i get a list about which interface is implemented by this struct method

[go-nuts] Interface ????

2018-02-27 Thread k1attila1
*Hello* *A beginner question :* *Why doesn't work this :* package main import ( "fmt" ) func PrintAll(vals []interface{}) { for _, val := range vals { fmt.Println(val) } } func main() { names := []string{"stanley", "david", "oscar"} <-error

[go-nuts] Re: Cannot take the adress of.....

2018-02-26 Thread k1attila1
Thank you Sir 2018. február 27., kedd 5:56:57 UTC+1 időpontban k1at...@gmail.com a következőt írta: > > Hi > > I have seen this example somewhere but i modified it : > > package main > > import "fmt" > > type notifier interface { > notify() > } > > type duration int > > func (d *duration) notif

[go-nuts] Re: Cannot take the adress of.....

2018-02-26 Thread k1attila1
or similar simpler example : this works : var j int = 42 var p *int p=&j // this works fmt.Println(*p) var j int = 42 var p *int p=&int(j) //this doesn't work fmt.Println(*p) 2018. február 27., kedd 5:56:57 UTC+1 időpontban k1at..

[go-nuts] Cannot take the adress of.....

2018-02-26 Thread k1attila1
Hi I have seen this example somewhere but i modified it : package main import "fmt" type notifier interface { notify() } type duration int func (d *duration) notify() { fmt.Println("Sending Notification in", *d) } func main() { var n notifier var i int = 42 n = &duration(i) n.notify() } b

[go-nuts] Golang capacity

2017-11-12 Thread k1attila1
Hello I have tried (and modified) from Golang Tour : package main import "fmt" func main() { var s []int printSlice(s) s = append(s, 1) printSlice(s) s = append(s, 2) printSlice(s) s = append(s, 3) printSlice(s) s = append(s, 4) printSlice(s) s = append(s, 5) printSlice(s) } func printSli

[go-nuts] %T question

2017-11-08 Thread k1attila1
Hello, i'm absolute beginner Could you help me ? package main import "fmt" const ( // Create a huge number by shifting a 1 bit left 100 places. // In other words, the binary number that is 1 followed by 100 zeroes. Big = 1 << 100 // Shift it right again 99 places, so we end up with 1<<1, or 2.