D | 3 Mar 06:51 2015
Picon

HTTP Server Working in GOLang

Hi,


Can some one point me to some good resources of

1) How http package (web server) works in golang starting from when the http server is started and a request lands in a go http server?
2) What are some common optimizations when writing a go web server?

I have looked into the below links.

http://stackoverflow.com/a/17759381
https://groups.google.com/forum/#!searchin/golang-nuts/http$20server/golang-nuts/qI2VsYBw7jg/jsv7q0h6KF0J

But I could not find any detailed resource.

Thanks,

--
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.
Lucio M. Tato | 3 Mar 04:29 2015
Picon

rationale for "func main must have no arguments and no return values"

I guess there must be a rationale for: "func main must have no arguments and no return values"

i.e. why the departure from C?

why not:

func main ( args []string ) int {
 
...
 
return 0 // SUCCESS
}


I'm sure there's a rationale, but I've googled and can't find it.
Can someone point me to it?
Thxs.

--
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.
Liang Ding | 3 Mar 02:29 2015
Picon

Wide 1.2.0 Released!

Wide is a Web-based IDE for Teams using Golang. In this version we introduced the followings features:

  • Similar to http://play.golang.org
  • With syntax highlight, autocomplete
  • Real-time output via websocket
  • Can embeded via iframe in other web site easily (?embed=true)
  • Disqus integration (?disqus=true)
2. Outline
Display some ast info about declarations of current file:
  • function
  • struct
  • interface
  • type
  • variable
  • constant

Have a try first, then download and setup it on your local area network, enjoy yourself!

--
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.
Karan Misra | 3 Mar 01:51 2015
Picon

Should this escape?

Moving this here, as per <at> adg:

Should this also escape:

package main
import (
"io"
"os"
)
func main() {
buf := make([]byte, 6)
io.ReadFull(os.Stdin, buf)
}

# command-line-arguments
./test.go:9: make([]byte, 6) escapes to heap

https://github.com/golang/go/issues/10060

--
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.
Pierre Durand | 2 Mar 23:59 2015
Picon

[ANN] githubhook: GitHub webhook HTTP Handler

Hi,

It's a simple GitHub webhook library.

Features:
  • simple HTTP Handler (no server or main package/command)
  • Secret validation
  • JSON or form content type
  • Customizable payload decoding (JSON unmarshal by default)


I use it in my imageserver advanced example:
The Go process kills itself, and a boostrap script (while true) updates/restarts it.

Similar projects:

https://github.com/phayes/hookserve
https://github.com/mikespook/ghoko
  • + LUA scripts
  • - LUA scripts...

--
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.
dwwoelfel | 2 Mar 21:07 2015
Picon

ANN: Om-i, instrumentation helper for optimizing Om apps

Om-i (pronounced "Oh, my!") provides useful aggregate info about the rendering performance of your Om components.


With a few lines of code, you can add meaningful performance instrumentation to your Om app.


Setup information is in the README: https://github.com/PrecursorApp/om-i


You can see it live on Precursor (https://precursorapp.com) if you hit Ctrl+Alt+Shift+J.


Feedback welcome.

--
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.
Garrett D'Amore | 2 Mar 19:03 2015

branch prediction revisited

So, I’m revisiting a topic first asked about here: https://groups.google.com/forum/#!topic/golang-nuts/lOMvhVkGPXU

I have an application (mangos) where I would like to be able to tune to very low latencies (sub-usec in some cases).  Therefore pipeline stalls caused by mis-predicted branches can be fairly tragic.   I’m not normally a fan of hand coding branch prediction (it feels too much like premature optimization to me), but in a few cases I know that I can tell which path is likely and which is not, perhaps in ways that the compiler cannot.

Therefore, it would be nice to have one, or both of, the following:

a) ways to hint the compiler about likeliness (which path is hot)

b) a list of the rules that the compiler uses when deciding which path is likely (in the absence of other information)

This information would be useful for both ordinary ‘if’ branches, but also for other potential branch statements (switch, select, for). 

Thanks!

- Garrett

--
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 Tiller | 2 Mar 20:18 2015
Picon

Type in one file, method in another?

Earlier today, I posted about a problem I was having.  The problem was very odd because the code compiled for one set of values for GOOS and GOARCH but would complain about so much as a a "go get" using different values of GOOS and GOARCH.  In other words, it seemed that whether a program was legal or not was a function of GOOS and GOARCH.

Well, I found the solution.  But it raises some interesting questions.  So I'm making this new post to discuss it.

The issue turned out to be that within a single package, I defined a type, let us call it "T", in one file and a method where T was the receiver in a different file.

I remember when I first tried this, I was surprised it worked across files.  But I liked it because it helped me to keep some things organized.  Of course, I assumed that since the compiler accepted it, this construct was allowed.

When I came across this problem with cross compilation, one of the things I tried was to put the method in the same file as the type it was operating on.  Magically, the compiler was happy.  So then I went through all the relevant sections of the language specification to figure out what was going on.  Clearly somewhere there is a bug since the legality of the program depends on environment variables.  But in order to report it, I really need to figure out which case is correct and which case isn't.

The problem is, I couldn't find any mention in the specification about a restriction on methods having to be declared in the same file.  I looked through every mention of "file" in the specification and there didn't seem to be any mention of methods anywhere.  I also looked in the section on method declarations and it explicitly states "it must be declared in the same package as the method".

So can I correctly assume that it is legal have the type and method in different files within the same package.  The specification seems to say that is fine.  If so, where do I report this bug (that the compiler complains when doing cross-compilation, which was my original issue)?  I didn't see anything about reporting bugs in the FAQ.  Do I simply open an issue on Github?

Thanks.

--
Mike

--
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.
ps | 2 Mar 18:49 2015
Picon

Mac firewall

For those using OS X, how do you deal with the firewall as part of your Go development workflow? ("Do you want the application “hello” to accept incoming network connections?")

I've created a code signing certificate and used it to `codesign` my binary, but that only works until the next build before I'm prompted again.

Is there something I'm missing?

Thanks.

--
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.
usedforprinting123 | 2 Mar 16:17 2015
Picon

Search articles on golang

https://qolleqt.com/collect/golang/search

If there are any well known sources/articles that I'm missing, let me know and I'll add them.

And of course, the app was built using golang.

--
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 Tiller | 2 Mar 15:50 2015
Picon

Strange cross compilation issue

Under OSX, if I invoke this command:

$ GOOS=darwin GOARCH=amd64 go build -a

Everything builds fine.  But, from the same directory, if I do this:

$ GOOS=linux GOARCH=amd64 go build -a
# github.com/xogeny/gofmi/sim/sfmu1
../../../GoWorkspace/src/github.com/xogeny/gofmi/sim/sfmu1/sfmu1_sim.go:10: undefined: FMU1Sim

Note that this is a Go language error (not, for example, a linker error).  Any semantic errors should be the same across platforms, right?

Note that under OSX:

$ go version
go version go1.4.1 darwin/amd64

This was installed with brew.  If I then switch to a Linux machine and run:

$ go version
go version go1.4.1 linux/amd64

On this machine, the command...

$ go build -a

Completes without error.

In summary, same version of go on both platforms.  Builds on one but won't cross-compile to that target.

Any ideas?

--
Mike

--
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