As I can see from the comment of http.Transport :
// Transports should be reused instead of created as needed.
The comment telled me that I need reuse the transports.
But i am writing a rpc system that the caller can pass different dialler to
make http request.
It almost impossible for my rpc
On Wednesday, August 24, 2016 at 10:22:22 PM UTC-7, Ian Lance Taylor wrote:
>
> On Wed, Aug 24, 2016 at 9:21 PM, sbkim via golang-nuts
> wrote:
> > Hello group,
> >
> > Why are the following snippets errors?
> >
> > https://play.golang.org/p/mgEYMNNw9h
> > type
Assuming we have this test:
func TestRecover(t *testing.T) {
f := func() (interface{}, error) {
panic(`TEST`)
}
r, e := Recover(f)
t.Log(r, e)
}
And two versions of *Recover* function.
Version 1:
func Recover(f func() (interface{}, error)) (interface{}, error) {
var result interface{}
Thanks Sam,
I managed without a token_peek(). It just leads to more verbose code with
calls to scan() and switches everywhere.
On Thursday, August 25, 2016 at 10:52:54 PM UTC+1, Sam Whited wrote:
>
> On Thu, Aug 25, 2016 at 2:09 PM, DrGo
> wrote:
> > Ok! So my original
On Thu, Aug 25, 2016 at 2:09 PM, DrGo wrote:
> Ok! So my original post was not clear. Let us say you just executed scan()
> twice on this string: a= x
> As expected, Scan() returned scanner.Ident for a, followed by a rune
> indicating the = sign.
> Now, peek() will
On Thu, Aug 25, 2016 at 2:08 PM, Nate Finch wrote:
> The type seems unnecessary. It doesn't actually do anything different than
> a regular func().
You are correct that the behavior of the function doesn't differ, but
then again behavior isn't necessarily the point of the
Check out go4.org/syncutil for Gate to limit concurrency with ease.
--
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+unsubscr...@googlegroups.com.
For
The type seems unnecessary. It doesn't actually do anything different than
a regular func(). Does it just exist to give a place for common
documentation for each of the methods that use it?
IMO, the With* functions would be more clear if they didn't use a named
type for func(), because now
I'll admit to not understanding how your question and code example mesh,
but as far as I can tell Scanner.Peek is working as it is documented in the
API, it returns the rune w/o advancing:
https://play.golang.org/p/DgzRcWeTRI
--
You received this message because you are subscribed to the
On Thu, Aug 25, 2016 at 12:55 PM, DrGo wrote:
> Should not scanner.Peek do whatever scanner.Scan does just without advancing
> the scanner?
It does; scanner.Scan returns the next rune in the string and
scanner.Peek returns the next rune in the string without advancing the
Hello,
Perhaps I am misunderstanding the purpose or do not know how to optimally
use this package, but the way I see it scanner.peek() is not doing what I
expect it to do: return the next non-whitespace token (e.g., scanner.Ident,
scanner.Int etc) without advancing the scanner. Instead it
Yes; I was super frustrated with big integers in JSON & your packages saved
me big time! Thanks a lot!
On Thursday, August 25, 2016 at 3:19:19 PM UTC+4:30, Ugorji Nwoke wrote:
>
> I just checked the issue you created:
> https://github.com/ugorji/go/issues/168 . I see you already closed it as
>
On Thu, Aug 25, 2016 at 3:09 AM, T L wrote:
>
> On Thursday, August 25, 2016 at 5:41:32 AM UTC+8, xiio...@gmail.com wrote:
>>
>> It doesn't/wouldn't seem to be any technical issue implementing methods on
>> any depth of pointer type .. as demonstrated in the unsafe example
Whenever you suspect memory corruption, try the race detector.
Can you also please post the full panic message, you cut off the important
part
On Friday, 26 August 2016 01:11:49 UTC+10, arb...@gmail.com wrote:
>
> Hello everyone,
>
> My application occasionally crash when processing string
Hello,
it would be hard to give you a complete solution without knowing many
more details about your application.
So to comment on just one part, spawning goroutine, or two, per
connection. It is absolutely THE correct way in Go. All those goroutines
will be effectively mapped to system
As you may have guesses, the html/package is not designed to perform such
clever calculations. It handles only the html rendering logic.
You have 2 pretty good fallbacks actually : either precalculate and feed
values to the template (server-side), or use javascript (client-side).
Cheers
Val
On
Hi all,
I'm looking for some good practices of concurrent programming in Go.
My software works and even customer satisfied :). But I feel job doesn't done
perfectly.
The task was to convert some well documented but proprietary protocol to
Diameter with custom dictionary.
But my feelings
There is one already, check Enduro/X ASG
(https://github.com/endurox-dev/endurox,
https://github.com/endurox-dev/endurox-go). You can create a modules which
basically is stand alone Go binaries which does the Enduro/X organized IPC.
Enduro/X monitors the processes, load balances the requests,
HI All,
been playing with using go to pull data from a few sources and serve a
consolidated view as a webpage.
I've got most of it going ok, but hitting a wall trying to do a totals row
in an output table.
anyone know if the html/template package is able to do this?
the fallback is to
Hello everyone,
My application occasionally crash when processing string variables. I can
not provide you with the full example, but the code looks more or less like
this:
package main
import "fmt"
type Event struct {
tokenA string
tokenB string
tokenC string
tokenD string
}
func
[edit] Just retracting the statement *"if you have pointers to pointers in
this context you're probably doing something wrong/unnecessary*." I made
earlier - which is clearly wrong on a moments thought.
Sorry..
--
You received this message because you are subscribed to the Google Groups
I get the original points. Though the current behaviour is in my opinion
consistent with https://golang.org/ref/spec#Method_declarations "[Receiver]
must be of the form T or *T (possibly using parentheses) where T is a type
name" and https://golang.org/ref/spec#Method_sets I can see the case
On Wednesday, August 24, 2016 at 9:44:04 PM UTC+8, Chintan Sheth wrote:
>
> I am using select statement to dispatch work coming from multiple
> goroutines, the variables used to consume the channel are allocated
> manually as I am recycling those
>
>
> for {
> a := getA()
> b := getB()
>
On Thursday, August 25, 2016 at 5:41:32 AM UTC+8, xiio...@gmail.com wrote:
>
> It doesn't/wouldn't seem to be any technical issue implementing methods on
> any depth of pointer type .. as demonstrated in the unsafe example linked
> from a previous related discussion (ie
>
On Thursday, August 25, 2016 at 5:41:32 AM UTC+8, xiio...@gmail.com wrote:
>
> It doesn't/wouldn't seem to be any technical issue implementing methods on
> any depth of pointer type .. as demonstrated in the unsafe example linked
> from a previous related discussion (ie
>
Not really. Runtime.KeepAlive is special, it'll continue to be special in the
future.
--
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
Does that mean that only inlined functions will be optimized and any
functions not inlined will not be optimized ?
在 2016年8月25日星期四 UTC+8上午11:55:12,Ian Lance Taylor写道:
>
> On Wed, Aug 24, 2016 at 7:06 PM, Cholerae Hu > wrote:
> >
> > I've read the source of package
Thanks; the problem is I'm using a third party package with lots of
data-structures and those data is going into CouchDB and deserializing
would set the IEEE 754 hell loose.
Also the `IntegerAsString` on `codec.JsonHandle` in ugorji package does not
works - created an issue for that.
I ended
hey everyone,
The problem is that i cant build a simple gomobile app for IOS.
I can build a normal (swift) IOS project in the Simulator & IPhone.
I can build the golang app for Android.
The public git repo of the Test Harness project is here:
https://bitbucket.org/gedw99/md-mobile-x
Its
Got it. thanks
On Thu, Aug 25, 2016 at 5:03 AM Matt Harden wrote:
> I don't think signing has anything to do with Go itself. You sign the
> binary executable file that your tool generates, regardless of the language
> it was written in.
>
> On Wed, Aug 24, 2016 at 2:16
30 matches
Mail list logo