Nan Xiao | 23 Apr 08:03 2014

The issue of building go1.3beta1 in Solaris

Since go1.3beta1 supports Solaris, I try to build it myself.

I have downloaded the source code, and uncompressed it, then execute "./all.bash". It outputs:
# Building C bootstrap tool.
cmd/dist
cmd/dist/unix.c: In function `xworkdir':
cmd/dist/unix.c:474: warning: implicit declaration of function `mkdtemp'
cmd/dist/unix.c:474: warning: comparison between pointer and integer

Then the build process is end, and no other outputs. Is there any wrong?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
davy zhang | 23 Apr 06:04 2014
Picon

LiteIDE sublime theme

https://gist.github.com/davyzhang/11202345#file-sublime_dark-xml

quick match for sublime text

works for me for now

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Oscar Parker | 23 Apr 04:33 2014
Picon

WaitGroup - wait until only X goroutines still running

I have used WaitGroups and wg.Wait() to wait for all child goroutines to finish. However I wondered if there might be a way to wait until there are only X children still running. This would be useful for downloading or processing files, where you may have hundreds of jobs, but want up to 4 running at once (i.e. 1 per core of CPU).

My first instinct was to subclass the pkg/sync/WaitGroup Wait() to take an integer argument for number to wait for, but all the mutex code is way above my current understanding. Is there perhaps a different way to achieve this effect?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Michael MacInnis | 23 Apr 03:20 2014
Picon

Job control and Go

Hi,

I've been writing a Unix shell in Go (https://github.com/michaelmacinnis/oh). My experience with Go has been very positive but I think I may have run into my first major roadblock.

I started adding job control. To do this (the way other shells do), I need to create a new process group when running a command interactively and place the one or more processes for this command in the new process group. This process group then needs to become the foreground process group, etc. One way to implement this is documented at http://www.gnu.org/software/libc/manual/html_node/Implementing-a-Shell.html

Much of what is required is possible but some things require co-ordination between parent and child or must be done in the child post-fork but pre-exec. This could be accomplished by adding to SysProcAttr and modifying ForkExec but SysProcAttr looks like it's getting pretty crowded.

Alternatively, I'd love to know if there is a way to stop the terminal from sending signals to the foreground process _group_ and instead send them to a single process. Possibly with some sort of shim. Or, is there a way for a parent to call setpgid and move a child, after a successful exec, to a new process group? POSIX doesn't seem to allow this and I assume that they have their reasons and that those reasons aren't just to irritate me.

Would a change to SysProcAttr/ForkExec to support job control be accepted? Is there another way to accomplish this with Go?

Thanks,

Michael.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
fredtotham | 23 Apr 02:31 2014
Picon

Garbage

Screening critiques of the languages shows insecurities of the go dev community.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
daruptek | 23 Apr 02:29 2014
Picon

What is the best flag package ?

Friends,
        I am a newbie to GO and it is going to be my go to language.
I would like to know if there is a better package than inbuilt flag package http://golang.org/pkg/flag/

I see people using several modified packages, please let me know which has the most number of features ?

There is one package Docker is using, looks like it has more features.
https://github.com/dotcloud/docker/tree/master/pkg/mflag

Do I need to go ahead and use the inbuilt one or any better package existing ? 

I am so used to python argparse and would like to start using something like that in GO.
Please direct me in the right direction.


Darup 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Andrew Gerrand | 23 Apr 00:34 2014

Go 1.3 Beta 1 Released

Hi Go nuts,

We have just released go1.3beta1, a beta version of Go 1.3.
It is cut from the default branch at revision f8b50ad4cac4.

Please help us by testing your Go programs with the new tool chain and libraries, and report any problems using the issue tracker:

You can download binary and source distributions from this page:
Note this is different to the usual location.

To find out what has changed, read the release notes for Go 1.3:

Documentation for Go 1.3 is available at:

Our goal is to release the official version of Go 1.3 on June 1, 2014.

Andrew

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Dmitri S | 22 Apr 23:09 2014
Picon

raw * in the URL's Path of client's http request

I'm working on a crawler for a website where the server treats differently characters * (literal star) and %2A (URL-escaped equivalent) in the Path portion of a URL, therefore I need to be able to request URLs like http://example.com/rd*http://www.iana.org/domains/reserved "as is" - with * in the Path and not %2A.  I was not able to do it with net/http client since it uses net/url's (*URL) String function which escapes Path:
http://golang.org/src/pkg/net/url/url.go?s=11532:11561#L465

What would be the recommended way to customize this behavior or possible work-arounds? I would appreciate your suggestions and ideas.

Dmitri

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Brad Heller | 22 Apr 21:21 2014
Picon

Strategies for building memory-sensitive systems?

I've got an application I'm working on that's essentially a database with strongly-typed, variable-length pages. I'd like to guarantee that the app won't take up move than X amount of memory, e.g. 3/4 of main memory. In a system with generic pages of well-known lengths, this is super easy: Allocate n buffers of size page_length, if no buffer is free use some strategy (LRU, for instance) to find one to overwrite.

When your buffers are of variable length, this gets more complicated. When your buffers are actually strongly typed (e.g. the buffer has variable-length fields), that makes it more complicated. And then when your language has GC, it seems to me it'd be even *more* complicated--you can't explicitly deallocate and/or don't have a lot of control over how you use memory.

Has anyone worked on anything in golang like this? It's totally possible I'm just thinking about the problem the wrong way, too. Anyone have tips/ideas?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Mike Appenzellar | 22 Apr 20:58 2014
Picon

SQLite - Unable to open database file

I am having an issue where after approx 20 page refreshes (web application), I am getting “unable to open database file”, exit status 1. Any thoughts? I am using go-sqlite3. 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Christopher Tiwald | 22 Apr 20:55 2014
Picon

How can I use the same MarshalJSON() method for multiple structs?

I'm trying to build a complicated, deeply-nested JSON payload. The total number of structs in it numbers in the hundreds, but they can all be sorted into three or four different classifications, each of which need to be marshaled a little bit differently. Specifically, I need to add an arbitrary field to their json encodings, but each classification requires a different field.

I asked a question on StackOverflow last week about adding arbitrary fields, and it got a solid response: http://stackoverflow.com/q/23045884/877115. Playground example here: http://play.golang.org/p/21YXhB6OyC.

The problem is I can't reuse the MarshalJSON() method for anything that isn't a Book:

func (b Book) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
FakeBook
Genre string
}{
FakeBook: FakeBook(b),
Genre:    "Satire",
})
}

I tried pulling the logic in MarshalJSON out to its own function, then letting MarshalJSON() call that function, but it ends up being infinitely recursive (http://play.golang.org/p/ImRmt5V3hd), which makes sense once you poke at the source code of encoding/json/encode.go.

Is there any other way to share the same MarshalJSON() implementation between structs, or perhaps another way to hook into "encoding/json" for this purpose?

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane