FAIL: TestTransportEventTraceRealDNS

Am i the only one seeing this since a few weeks in tip?

--- FAIL: TestTransportEventTraceRealDNS (0.32s)
    transport_test.go:3371: expected error during DNS lookup
FAIL
FAIL    net/http    9.562s

30fc940c70ee5ee27f0a455248735b8b57f34fb7

yours

--
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.
rhomoliako | 23 May 19:58 2016
Picon

Using `Timeout` attribute of `net.Dialer` type to dial with timeout

Hi all!

As far as I understand, basic `net.Dial()` uses non-blocking connect when dialing. I want the opposite and for that I tried to use `net.Dialer` type with `Timeout` attribute set to simulate blocking connect with timeout. But that hasn't worked out for me. Could someone tell me how to achieve this? 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.
Ankur Gupta | 22 May 22:11 2016
Picon
Gravatar

importgolang - A weekly Go newsletter

Hi Fellow Go Programmers,

Just want to announce the first issue of importgolang a weekly Go Programming Newsletter. http://importgolang.com/newsletter/ 

Thanks,
Ankur

--
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.
rhomoliako | 23 May 00:17 2016
Picon

Set deadline/timeout for TCP listener's Accept()

Hi all!

I'm trying to implement non-blocking accept call in Golang and the best I've come so far is the following code snippet (this is a working Go v1.7 program):

package main

import (
"net"
"log"
"time"
)

func createClient() {
tcpConn, err := net.DialTCP("tcp4", nil, &net.TCPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: 12819,
})
if err != nil {
log.Fatalln("Error connecting to the server!")
}
log.Println("Managed to dial!")
tcpConn.Close()
}

func main() {
go createClient()
l, err := net.ListenTCP("tcp4", &net.TCPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: 12819,
})
if err != nil {
log.Fatalln("Can't listen on provided IP/port!")
}
if err = l.SetDeadline(time.Now().Add(time.Nanosecond)); err != nil {
log.Fatalln("Can't set appropriate deadline!")
}
tcpConn, err := l.AcceptTCP()
if err != nil {
if opError, ok := err.(*net.OpError); ok {
if opError.Timeout() {
log.Fatalln("Timeout error!")
}
}
log.Fatalln("Error while accepting connection!")
}
log.Println("Accepted new connection!")
tcpConn.Close()
}

The problem here is that I always get "Timeout error!". As far as I understand that's because by the time listener's `AcceptTCP()` gets called the timeout previously set will have already expired. Try changing it to `time.Microsecond` and you will probably get the same result (unless you have processor slower than mine). I start having positive results altering timeout to at least `time.Second`. That's where I start having "Accepted new connection!"/"Managed to dial!".

So the basic idea is to get the same functionality one gets using POSIX socket interface with `select` system call to achieve non-blocking 'accept()'. Any opinion would be highly appreciated.

Any thoughts?

--
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.
Francis Chuang | 23 May 00:39 2016
Picon

Apache Phoenix / Avatica driver for database/sql available

Hi everyone,

I have released an Apache Phoenix and Avatica (part of Apache Calcite) driver for the database/sql package. Phoenix was previously only available for Java, but they have included the Avatica server since 4.4.0, which allows clients to use Phoenix over http.

The driver I have open-sourced now allows Go users to easily talk to Phoenix. Avatica is designed to be an HTTP query server that allows queries to other backend databases over HTTP. This means that the driver will also allow you to query any database supported by Calcite over HTTP.

The source is available here and is licensed under Apache2: https://github.com/Boostport/avatica

Cheers,
Francis

--
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.
王坤 | 23 May 15:00 2016
Picon

A simple log lib

Hi gophers, i create a simple log lib. 

Features: 
* Auto category logger by package name.
* Config via json.


Welcome to review.

--
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.
Claygod | 23 May 18:00 2016
Picon

Bxog is a simple and fast HTTP router for Go (HTTP request multiplexer)

Hello all!

On habrahabr.ru I wrote a short article (in Russian) on my router Bxog  I suggest to read this article to anyone who knows the Russian language. If you do not know, just take a look at Github . The router will get a quick and competes in speed with a known router HttpRouter. Simple test and benchmark compared to HttpRouter, Zeus, Bone, Gorilla can be viewed here . I hope that something you enjoy!

--
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.
MA LIG | 22 May 06:22 2016
Picon

archive/zip reader memory usage

Hi, does anyone know whether the "archive/zip" reader does (or can) operate without reading the entire file into memory? In particular, I would like to process a large zip file by just streaming the requested decompressed content to the calling process (or function) and using a limited, fixed-size internal buffer that never requires any heap usage (per concurrent execution) beyond a predetermined, fixed size.

--
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.
Ain | 22 May 13:46 2016
Picon

Getting parts of xml document as raw data

Hi

I have XML structure like

<root>
   <bar>...</bar>
   <foo a="x">...</foo>
   <foo a="y">...</foo>
</root>

and I need to get list of "foo" elements for further processing. The API for further processing takes it's input as io.Reader, so getting slice of []byte or string per foo element would be OK, these are simple to wrap into bytes.Buffer...
The problem is how to get the entire foo element as raw data. I have tryed with ",innerxml", but then I'm loosing the outer foo tag and it's attributes.
Any suggestions?


TIA
ain

--
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.
Jan Algermissen | 21 May 21:35 2016
Picon

How to access a variable 'owned' by another goroutine?

Hi,

the "share memory example" in https://golang.org/doc/codewalk/sharemem/ contains a StateMonitor that ownes a map and manages updates to that map in a sequential way. It periodically prints out the map.

What would be the go idiom to let other goroutines  read-access that map?

I think I should have StateMonitor return not only the state channel but also a handle for accessing the map:

type SMon interface {
  GetValueForKey(key string)
}
func StateMonitor(updateInterval time.Duration) (chan<- State,SMon) { ... }

How would I implement GetValueForKey(key string)? I see two options:

1) have the state monitor replace the full map on each change and simply read the value for key in GetValueForKey(key string) (this assumes reference assignments are atomic in Go - are they?)

2) Use channels in   GetValueForKey(key string) to get the value for key in the sequential management context of the state monitor. I guess this would involve a new channel for GetValueForKey(key string) to communicate with the state monitor goroutine (eg send the key along the channel) ....

What I cannot figure out is what the idiomatic way would be to get the actual value back to the caller of GetValueForKey(key string).

Can anyone help with this?

Jan

--
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.
david.john.gee | 22 May 00:52 2016
Picon
Gravatar

net package, setting the UDP source port

Hi all,

Without wanting to dive into raw sockets in Go, is there an easy way I can't find for the life of me to set the source port of UDP packets in the net package? Any help would be greatly received. I've checked documentation for any signs of which (I can't find) and hunted blogs too.

The only reference I found to UDP source port was in a DNS package file. If any of you know a simple way to set the source ports in UDP packets, that would be great.

Thanks in advance,
David G

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