mabye @bradfitz can give you some advise
On Friday, 4 June 2021 at 23:09:08 UTC+8 hang zhou wrote:
> Hi,
> I was use gomobile with go1.16.3 to build a framework for iOS
> NetworkExtension, but when the extension start, I found the memory it
> occupied is about 13M, and when we run some gorout
> I recently translated a substantial C library into Go, and watching all
> the pointers disappear, at least syntactically (there were still slices),
> was marvelous.
>
Side point: Rob, is this open source? If so, I'd be interested to see the
side-by-side comparison of the C vs Go code (other
* Joshua [210606 16:52]:
> > In most cases (or most cases in actual practice?) an interface can be
> > thought of as a pointer,
>
> This is however, an implementation detail specific to the compiler you use
> though, correct?
Well, sort of, but really no. Whether the compiler wastefully make
* 'Dan Kortschak' via golang-nuts [210606 06:43]:
> On Sun, 2021-06-06 at 03:17 -0700, Brian Candler wrote:
> > When you assign a regular (non-pointer) value to an interface
> > variable, it does take a copy of that value:
> > https://play.golang.org/p/XyBREDL4BGw
>
> It depends on whether it's s
> In most cases (or most cases in actual practice?) an interface can be
thought of as a pointer,
This is however, an implementation detail specific to the compiler you use
though, correct?
And similarly, the wording of the FAQ is "fine", given that it's talking
about the behaviour as the speci
Just a guess: You may need to make a local copy of index inside your loop
because index gets overwritten each iteration.
On Sunday, June 6, 2021 at 12:45:01 PM UTC-6 Suveetha Kamatchi wrote:
> Hi team
> I am a newbie to golang.
> I am writing a code that does transactions in postgres.
> The li
Axel and Keith: Thanks for responding. I'm glad it sounds like I'm reading
the spec correctly—and that Go shouldn't do anything sneaky with evaluation
order.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and st
Alex and Keith: Thanks for responding. I'm glad it sounds like I'm reading
the spec correctly—and that Go shouldn't do anything sneaky with evaluation
order.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and st
On Sun, Jun 6, 2021 at 8:44 PM 'Suveetha Kamatchi' via golang-nuts
wrote:
Please post code as plain text, no colors, no inverted schema in
particular. Or share code via a link at play.golang.org, thank you.
--
You received this message because you are subscribed to the Google Groups
"golang-nu
Hi team
I am a newbie to golang.
I am writing a code that does transactions in postgres.
The list of queries to be executed under one transaction is gathered across
multiple handler code.
The way I am maintaining the query structure is as follows
type TxQuery struct {
function TxFunc
data t
net/http/httputil.ReverseProxy should do
it https://pkg.go.dev/net/http/httputil#ReverseProxy
I think it's easier if you set it up as a standard server and configure a
SingleHostReverseProxy as a handler for each of the upstreams
On Sunday, June 6, 2021 at 10:28:15 AM UTC+2 Sebastien Binet wrot
On Saturday, June 5, 2021 at 2:15:27 PM UTC-7 Joshua wrote:
> However, I see lots of calls of "If you're using pointers to interfaces a
> lot, you probably don't understand them".
>
> Well, what am I not understanding?
>
To answer this particular point: In most cases (or most cases in actual
p
On Sunday, June 6, 2021 at 9:33:31 AM UTC-4 ren...@ix.netcom.com wrote:
> For example, the fact that this code is broken is not intuitively obvious
> for any reader. It requires way too much scrutiny IMO.
>
> https://play.golang.org/p/-f73t_Pm7ur
>
I would like to note that your example goes a
For example, the fact that this code is broken is not intuitively obvious for
any reader. It requires way too much scrutiny IMO.
https://play.golang.org/p/-f73t_Pm7ur
> On Jun 6, 2021, at 6:37 AM, Robert Engels wrote:
>
> For me this is the most inconsistent and obtuse aspect of the Go languag
Thanks! I'd seen the "dead code elimination" comment somewhere and
questioned it, but not enough.
If I worry about what some future Go compiler might optimize, I end up
worrying quite a lot! For example, could this code:
func BenchmarkPopCountAlive(b *testing.B) {
sum = 0
for i := 0; i <
For me this is the most inconsistent and obtuse aspect of the Go language. It
seems it would always be saner to treat interfaces as pointers. Which would
mean if they had non pointer receiver methods might force more objects to be
allocated on the heap - but it would prevent a lot of misundersta
https://github.com/golang/go/blob/master/src/runtime/mgc.go#L858-L876
due to these code lines, stw in one gc cycle may happen more than 2 times.
so stw times in one gc cycle could be 2(general), 3, 4, and even for
ever?
--
You received this message because you are subscribed to the Google
On Sun, 2021-06-06 at 03:17 -0700, Brian Candler wrote:
> When you assign a regular (non-pointer) value to an interface
> variable, it does take a copy of that value:
> https://play.golang.org/p/XyBREDL4BGw
It depends on whether it's safe to leave uncopied or not. You can see
this here https://pla
On Sun, Jun 6, 2021 at 12:17 PM Brian Candler wrote:
> When you assign a regular (non-pointer) value to an interface variable, it
> does take a copy of that value:
> https://play.golang.org/p/XyBREDL4BGw
>
Yupp, as I said :)
> As to whether the value is copied when you copy a non-pointer inter
I can only give the opinion of someone who's new to the language, but maybe
that is helpful for me to describe the learning journey a bit.
I'd seen references (hehe) to maps and slices "acting like pointers" and
thus weren't costly to be passing around directly into functions, and so I
went to l
When you assign a regular (non-pointer) value to an interface variable, it
does take a copy of that value:
https://play.golang.org/p/XyBREDL4BGw
Compare with what happens when the interface contains a pointer:
https://play.golang.org/p/UpZnHS0xDU1
As to whether the value is copied when you copy
TBH from that FAQ answer I would have come to the same conclusion as OP.
It literally says "Copying an interface value makes a copy of the thing
stored in the interface value". But it doesn't. Assigning to an interface
variable makes a copy of the value. Calling one of the methods on the
interface
On Sun, 2021-06-06 at 18:14 +1000, Rob Pike wrote:
> You are using a steamroller to press a shirt.
Tomi Ungerer has already published this approach.
https://kotonoha-books.ocnk.net/data/kotonoha-books/product/20160619_70ddf5.JPG
--
You received this message because you are subscribed to the G
hi,
I am trying to setup a little self-hosted http(s) server at home.
it should be able to serve the following:
- https://example.com/x/pkg1 [a 'go-get'-able Go pkg]
- https://example.com/x/pkg2 [ditto]
- https://example.com/mumble [a mumble server for family and friends]
- https://example.com/cl
Can you explain the trap? I don't pick up that vibe, but I may be the
author of that paragraph. Plus there is no such thing as a big interface.
In the current implementation, all interfaces are the same size - a pair of
words. You may still have a misapprehension.
Try the first half of this articl
The reason is that the only way to implement repetition in an NFA or DFA is
literally to repeat the expression, so asking for `a{6}` means to generate
the machine for `aa`. It is a notational convenience only, a macro
mechanism if you will. Other "regexp" packages, which do not adhere to the
cl
Thanks all for the insights, I think a key takeaway for me is "Don't worry
about it unless it's a problem", but it's also good to know that it
(probably) isn't a problem!
I'm glad at least the semantics are the same, and I guess I'll cross the
performance bridge if I ever come to it and someone
Probably not a bug, since it's documented:
https://golang.org/pkg/regexp/syntax/
> Implementation restriction: The counting forms x{n,m}, x{n,}, and x{n}
reject forms that create a minimum
> or maximum repetition count above 1000. Unlimited repetitions are not
subject to this restriction.
I
It is to protect the regexp engine from overly expensive computations, as
the repetition can introduce quadratic behavior in the compiler. The Go
engine is concerned about pathological execution - not all engines have
this property (see https://swtch.com/~rsc/regexp/regexp1.html) - and is
being car
29 matches
Mail list logo