Chandru | 24 Jul 07:20 2014
Picon

Suggestion: Allow customizing Scanner token limit

The maximum token size is limited to 64K in bufio.Scanner. Currently there is no way to provide a custom limit.

While this is a reasonable default, for rare cases where the tokens can exceed the limit, providing a way to change this limit can be convenient.

--
Chandra Sekar.S

--
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.
Mark Fletcher | 24 Jul 07:07 2014

ANN: Python Fabric-like library, Loom

Hi,

I just created a small library that mimics much of the functionality of Python's Fabric library. It allows you to interact with remote servers over SSH. I was using fabric for a bunch of build and machine configuration stuff, and got tired of having to ensure that I had the correct python modules installed.

https://github.com/wingedpig/loom

I hope it's useful to others. And of course, suggestions for improvement are appreciated.

Thanks,
Mark

--
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.
thomas.burdick | 23 Jul 20:53 2014
Picon

XML Canonicalization

I have the unfortunate but necessary task of dealing with SAML in Go.

This requires primarily the ability to generate Canonical XML. Does xml.Encoder happen to generate canonical XML already? Am I going to need a different xml library for this?

Any help would be much appreciated.

Tom

--
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.
robin.monjo | 23 Jul 23:07 2014

Check if a port is bound to a process

Hello,

I would like to check if a given port is bound to a process. Basically, I want to launch a command using the os/exec package. This command will launch a web server that will listen on specific port. I want to be able to detect when the port is bound by my process.

Feel like it's possible to do it natively (on unix machines) using the syscall package, but didn't manage to do it so far. 

Another solution would be to use external programs such as netstat or lsof but doing it natively would be better.

Any help would be great.
Cheers

--
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.
John Lawrie | 23 Jul 22:41 2014
Picon

auto-loading of /usr/local/go/src/pkg/runtime/runtime-gdb.py declined

When I try to debug my go application, I always get the following output on my console. The first warning line is printed in red.

warning: File "/usr/local/go/src/pkg/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /usr/local/go/src/pkg/runtime/runtime-gdb.py
line to your configuration file "/home/johnlawrie/.gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/home/johnlawrie/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
$1 = 0xff
The target endianness is set automatically (currently little endian)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff77f5700 (LWP 1109)]
[New Thread 0x7ffff6ef4700 (LWP 1110)]
[New Thread 0x7ffff66f3700 (LWP 1111)]
[Thread 0x7ffff66f3700 (LWP 1111) exited]
[Thread 0x7ffff6ef4700 (LWP 1110) exited]
[Thread 0x7ffff77f5700 (LWP 1109) exited]
Quit

I have tried to follow the instructions printed and have added to my .gdbinit file to try to get gdb to parse in and load the runtime-gdb.py, but I have no luck.

Currently, my /home/johnlawrie/.gdbinit file contains simply
set auto-load safe-path /usr/local/go/

I have also tried using
add-auto-load-safe-path /usr/local/go/src/pkg/runtime/runtime-gdb.py
and
add-auto-load-safe-path /usr/local/go/src/pkg/

None of the options have changed the result. I'm using goclipse and I have version Luna (4.4.0). My gdb is version 7.7 if any of that helps.

Thanks in advance
John Lawrie

--
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.
Keith Rarick | 23 Jul 22:28 2014
Picon

UseAllFiles in go list -json

There's a godep bug, https://github.com/tools/godep/issues/84, that
is, in principle, straightforward to fix. It needs to consider all
files, regardless of whether their build constraints are satisfied. My
current approach is to steal the relevant source code from the go tool
(roughly 1000 lines, though I still might be able to cut out a good
chunk of that) so I can set flag UseAllFiles on the build Context. But
two other approaches come to mind:

1. Factor some of the go tool's logic into a package and let godep import that.
2. Expose UseAllFiles as a command line flag in the go tool.

Do either of these sound reasonable? They'd make my life easier, but
either one would increase the interface surface area under maintenance
by the Go team, so I understand if you'd rather avoid it.

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@...
For more options, visit https://groups.google.com/d/optout.

John Lawrie | 23 Jul 22:23 2014
Picon

Trouble getting HandleFunc called.

Hello,

I have a very simple HTTP server that I'm working. It was working well, but now for some reason the handlers don't get called anymore. Even if I have just this simple code, the hello function will not get called when hit it.

http://192.168.1.116:9000/hello

func hello(res http.ResponseWriter, req *http.Request) {
    fmt.Println("At top of hello")
    res.Header().Set(
        "Content-Type", 
        "text/html",
    )
    io.WriteString(
        res, 
        `<doctype html>
<html>
    <head>
        <title>Hello World</title>
    </head>
    <body>
        Hello World!
    </body>
</html>`,
    )
    fmt.Println("At bottom of hello")
}
func main() {
    fmt.Println("At top of main")
    http.HandleFunc("/hello", hello)
    http.ListenAndServe(":9000", nil)
    fmt.Println("At bottom of main")
}

When I run this, I see 
<terminated> Debug GO HTTP Server [Go Application] serverMain
At top of main
At bottom of main

I can see In fiddler on the machine that is running my go server that the request is being sent, but not receive. I swear this worked before,

Any ideas would be appreciated.
Thanks,
John Lawrie

--
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.
Alexander Shopov | 23 Jul 21:37 2014

Tracing a whole package in gccgo - all calls with parameters and returns

Hi everybody,
I will need to trace a whole package - all calls made to it with the
returned values when I use gccgo (and if possible - gc).

Thus far I have managed to successfully compile docker 1.0.0 (patched)
with gccgo 4.9. Many of docker's managing commands run just fine -
like ps, images, rm, rmi, etc. However I still cannot get it to
actually run a container.

After a lot of tracing with fmt.Println and debugging (gdb via
liteide) my hunch is that there is a difference between the behavior
of some of the functions in the syscall package. I have still not
proven this, but thus far nothing contradicts this.

Since there quite a few places where syscalls are made, I need a way
to speed up tracing.

Thus far I can think of the following:

1. Using ftrace + strace to trace the syscalls
2. Using fmt.Println + runtime/debug.PrintStack
3. setting GOTRACEBACK to 2 - though the binary does not crash and
this does not help

Do I have any more options to trace which SYSCALLS are called, their
arguments and return values?

Kind regards:
al_shopov

--

-- 
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@...
For more options, visit https://groups.google.com/d/optout.

Updating a statistics object within a program

There was an interesting thread recently about how dispersed parts of a program could elegantly detect that a config file had changed, and reload the config. My question is somewhat related -- I'm new to golang, so would like to validate my pattern.

I want dispersed parts of my program (https://github.com/otoolep/syslog-gollector) to have access to a shared statistics object (it could be a simple map of strings to int). Different parts of the program need to increment various counters in the map. Another part of the program would dump a JSON representation of that object out over an HTTP API, when requested.

For exactly correct stats, the map would need to be locked if accessed directly by the various parts of the program. This could be a big bottleneck, and is a crude implementation. So, in the spirit of Go, I guess I should have a channel where the various parts of the program could post stat updates? And launch a *single* goroutine which reads that channel and updates the map? Is this the correct pattern? Would a buffered channel be a good choice, to deal with any burstiness in stats updates?

For comparison I have written the same type of program in a previous life, using C++ and the Boost ASIO library (an async event-driven network IO framework). To solve the problem there I fired off an event for every stat update, and had the event handler run inside a specific strand. It worked very nicely -- I got exactly correct stats, high-performance, and all without explicit locking.

Have I generally the right idea?

Thanks,

Philip
 
-----------------------------------------
http://www.philipotoole.com

--
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 Banzon | 23 Jul 20:12 2014
Picon

Vendoring

Hi,

Hope everyone is enjoying the hot weather that seems to be everywhere! ;-)

I am looking for a good source on package vendoring and was wondering if anyone on the list has any resource (article, blog eg.) on the subject?

Thank you guys!

--
Michael Banzon
http://michaelbanzon.com/

--
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.
Frank Schröder | 23 Jul 19:53 2014
Picon

pprof tries to find source under build path and not GOPATH

I'm trying to debug a program on a production machine using pprof via http. (Go 1.3 linux/amd64 in case that matters) I've copied the source code into my home directory (incl. src) and exported GOPATH to that directory. However, on *list somefunc* pprof tries to locate the source in the directory where it was built and not under the GOPATH.

E.g.;

Build path: /var/lib/jenkins/somejob/workspace/src/somepkg/ ...
GOPATH: $HOME/src/somepkg

go tool pprof /path/to/somepkg http://localhost:1234/debug/pprof/heap

list somefunc

/var/lib/jenkins/somejob/workspace/src/somepkg/main.go: No such file or directory

Sure, I can symlink it but is there a way to tell pprof to look for the source files in another directory?

Frank

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