I've been reviewing the contributions documentation for Google new language, and was curious about the idea of contributing a new package. It states that this should be included at the top of contributed source code:
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license ...
I am using a Vector type to store arrays of bytes (variable sizes)
store := vector.New(200);
...
rbuf := make([]byte, size);
...
store.Push(rbuf);
That all works well, but when I try to retrieve the values, the compiler tells me I need to use type assertions. So I add those in, and try
for i := 0; i < store.Len(); i++ {
el := sto...
Ever since I heard about google's new language Go I wanted to use it for microcontroller programming. In particular Atmel AVR micro-controllers like the Atmega series. Is there a Go port for this architecture?
...
Can anyone explain flags in Go?
flag.Parse()
var omitNewline = flag.Bool("n", false, "don't print final newline")
...
What is your opinion of this design decision? What advantages does it have and what disadvantages?
Links:
Embedding description
...
One of Go's slogans is Do not communicate by sharing memory; instead, share memory by communicating.
I am wondering whether Go allows two different Go-compiled binaries running on the same machine to communicate with one another (i.e. client-server), and how fast that would be in comparison to boost::interprocess in C++? All the example...
All the examples I've seen so far involve blocking to get the result (via the <-chan operator).
My current approach involves passing a pointer to a struct:
type goresult struct {
result resultType;
finished bool;
}
which the goroutine writes upon completion. Then it's a simple matter of checking finished whenever convenient. ...
I know its a bit too early, but I've been trying out Go (Google's Programming Language) and its kindof annoying to write code in gedit.
So, my question: What do you use to experiment with Go?
...
Seems like Go is designed as a replacement for problems you previously would have solved with C++. Is this an accurate statement? What kind of solutions is Golang (Google Go) designed for?
...
http://golang.org/doc/effective_go.html#initialization describes a way to attach methods to arbitrary object in the Go programming language. As an example, they site the string method for a newly defined ByteSize type:
type ByteSize float64
const (
_ = iota; // ignore first value by assigning to blank identifier
KB ByteSize = 1...
I noticed that garbage collection is not yet implemented in gccgo.
http://golang.org/doc/gccgo%5Finstall.html#Unimplemented
Does the standard Go compiler (gc) support garbage collection yet?
...
After a quick look at the documentation, I immediately started to think about integration with existing languages and applications and was wondering whether support would be provided for Protocol Buffers?
...
How do I get the terminal size in Go. In C it would look like this:
struct ttysize ts;
ioctl(0, TIOCGWINSZ, &ts);
But how to i access TIOCGWINSZ in Go
...
Does anyone know approximately what the minimum work size is needed in order for a goroutine to be beneficial (assuming that there are free cores for the work to be offloaded to)?
...
I found an interesting blog post about Go. I am trying to understand the concept of interfaces, but I find it very hard to do so from the code fragment in the blog post, and nearly impossible from the language specification. Can anyone point out a simple example of Go's interfaces in a working program?
...
So, the big buzz in the last few days is Go, the new language from Google. Assuming you're all obsessive programming language geeks like me, you've all downloaded it, built it, and run your "Hello, 世界" program (isn't it nice using a language written by the inventors of UTF-8?). You've all read the tutorial, Effective Go, and some of the ...
I know that the Go source comes with a Makefile (It's in $GOROOT/doc) which I am using right now, but have other popular build systems added support for Go yet? Has anyone written build scripts for scons, waf etc...
What do you use to build your Go programs?
...
i have a map:
var sessions = map[string] chan int{}
How do i delete sessions[key] ?
tried:
sessions[key] = nil,false;
That did'nt work.
...
if i try to access key in array which does not exist i get
throw: index out of range with a stacktrace.
How do i check if tmp[key] "is set" ?
...
Where can I file bug reports for the Go language? I mean reports about a crashing compiler or something else about Go that does not work as advertised. It would also be interesting to just read through them.
...