very thanks , I am unfamiliar with the cpu *out-of-order execution ,
but I doubt if my three line code is related ,it will reorder it ??*
在 2016年11月4日星期五 UTC+8下午1:38:12,Ian Lance Taylor写道:
>
> On Thu, Nov 3, 2016 at 10:28 PM, 刘桂祥 >
> wrote:
> >
> > In my write goroutine I don't modify th
I would also like to point out the extreme hypocrisy of saying Aram's
comment is "unnecessary and insensitive" then labeling someone's thread as
"bullying" (a pretty serious charge in todays climate). Both of which I
would consider worse insults than saying someone has bad English. If i was
on
On Thu, Nov 3, 2016 at 10:28 PM, 刘桂祥 wrote:
>
> In my write goroutine I don't modify the map key (data structure) but set
> the variable point to another map address ,this is a pointer assignment and
> is atomic
You're right, my previous reply was incorrect. My apologies. The
real reason your
In my write goroutine I don't modify the map key (data structure) but set
the variable point to another map address ,this is a pointer assignment
and is atomic
在 2016年11月4日星期五 UTC+8下午1:22:20,Ian Lance Taylor写道:
>
> On Thu, Nov 3, 2016 at 10:19 PM, 刘桂祥 >
> wrote:
> > can you explain why w
On Thu, Nov 3, 2016 at 10:19 PM, 刘桂祥 wrote:
> can you explain why whis ?
A map is basically a pointer to a complex data structure. Setting a
value in a map changes that data structure. If one goroutine is
reading from the data structure while a different goroutine is writing
to the data struc
can you explain why whis ?
在 2016年11月4日星期五 UTC+8下午1:16:39,Ian Lance Taylor写道:
>
> On Thu, Nov 3, 2016 at 8:37 PM, 刘桂祥 >
> wrote:
> > // example.go
> >
> > package main
> >
> > var gMap = make(map[int]int)
> >
> > func w() {
> > temp := make(map[int]int)
> > temp[1] = 100
> >
On Thu, Nov 3, 2016 at 8:37 PM, 刘桂祥 wrote:
> // example.go
>
> package main
>
> var gMap = make(map[int]int)
>
> func w() {
> temp := make(map[int]int)
> temp[1] = 100
> temp[2] = 200
> gMap = temp// Does the compiler or cpu will reorder temp[1]=100,
> temp[2]=200, gMap=temp ??
It is procedural programming with OO seasoning and there's nothing wrong
with that for small projects and utilities. Would like to see some case
studies on using Go on projects with exceptional large code bases. I really
think the all tenants of OOP (encapsulation, inheritance and polymorphism)
That's not up to you to judge if some comment is "harmless" or not. Because
you're not the person the comment has been directed at. Something that
might seem "harmless" to you might be perceived as insulting to someone
else. Aram's comment was unnecessary and insensitive to say the least, it
do
Glad it's being useful, and indeed, that API looks familiar. Nice.
On Nov 3, 2016 4:33 PM, "Chris Hines" wrote:
> FWIW, I'm a big fan of gopkg.in/tomb.v2. For similar functionality using
> contexts consider golang.org/x/sync/errgroup.
>
> On Wednesday, November 2, 2016 at 7:55:59 PM UTC-4, Gusta
I'm curious to know what Activestate plans to bring to the table that isn't
already a part of the go distributions people can download off of
golang.org. I see it mentions the distribution including "popular modules"
(I presume it means packages)... but given how easy it is to just go-get
pack
sorry could you provide a complete example ?
I try this but not find question
package main
import "time"
type T struct{ x int }
var global *T
func f() {
p := new(T)
p.x = 1
global = p // "publish" the new T (racy!)
}
func g() {
p := global
if p != nil {
// println(p.x) // may prin
// example.go
package main
var gMap = make(map[int]int)
func w() {
temp := make(map[int]int)
temp[1] = 100
temp[2] = 200
gMap = temp// Does the compiler or cpu will reorder temp[1]=100,
temp[2]=200, gMap=temp ??
}
func r() {
local := gMap
println(local[1], local[2])
>
>
> That's the sort of cheap checks that I had mind in the very first post
> when I talked about "I envisaged a call to CPUID and then some bool tests
> along the way to utilise SSE[2-4]/AVX[2] (or NEON on ARM) if available. All
> in a static, portable package." Thanks for a good example of t
Just use Client.Do - https://godoc.org/github.com/valyala/fasthttp#Client.Do .
It doesn't follow redirects, so you can inspect each response and decide
whether to follow each redirect.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscr
We would like to fix the behavior of cgo invoking pkg-config on Windows,
for golang.org/issue/16455. From the failure in the report, it appears that
pkg-config --libs printed the actual text "C:/Program Files
(x86)/libgit2/lib" as part of its output, without any kind of escaping of
the spaces in th
A couple months ago we had a package management survey. Since the survey
closed the data has been fed into the package management committee.
Now we are sharing the data, that was not asked to be kept private. This
can be read at
https://docs.google.com/document/d/15j_Q6RRX_LH6tu4DNDm-vAcWAUablq
I would like to be able to use the fasthttp client. But I need to be able
to control the redirect logic. Specifically I would like to limit the
number of redirects and abort the request if it redirects to a specific
host.
I am able to do that using the `http.Client.CheckRedirect` function, but
FWIW, I'm a big fan of gopkg.in/tomb.v2. For similar functionality using
contexts consider golang.org/x/sync/errgroup.
On Wednesday, November 2, 2016 at 7:55:59 PM UTC-4, Gustavo Niemeyer wrote:
>
> You said the function would return whether it got cancelled or not, so I
> assumed something like
Hi,
thanks, ok good to go then !
> And, it doesn't really work for local dev
Yeah, I figured this out after some reading.
Some resources explains it might be possible to work with letsencrypr for
local domains,
but the setup is complex (my taste) and adds additional maintenance.
What i want t
On Thursday, 3 November 2016 03:05:47 UTC-4, 刘桂祥 wrote:
>
>
> package main
>
> import "time"
>
> func main() {
> s := []int{100, 200}
> println(&s)
> go func() {
> s[0] = 300
> s = []int{300, 400}
> }()
> time.Sleep(1 * time.Second)
> }
>
> just curious about this ,can you help explain the assemb
A, thanks a lot for your help and sorry for trivial question.
To test the type assertion I should use following code:
printerImpl, ok := p.(*printer.Printer)
if !ok {
panic("wrong type")
}
(*printerImpl).Print("test")
I was trying to call the 'Print' func as *printerImpl.Print("test") no
On Wednesday, 2 November 2016 11:24:38 UTC-4, Martin Steffen wrote:
>
> I meant more: the _terminology_ of being untyped may reflect an internal
> treatment of how the go compiler treats
> those things: inside the go-compiler, the ``static phase''/type
> checker/type inferencer may treat
> for i
Hi,
I have a setup where I first generate binary and then run the binary
for the test cases. I was able to do that successfully for basic things,
but when I want to pass the coverpkg flag to the binary it doesn't work as
it is not defined. I can see only coverprofile is defined while cover
The Lookup method is returning a pointer to the symbol (That way the
program can modify the value of Impl through the plugin.)
I believe you can write:
printerImpl := *p.(*printer.Printer)
On Thu, Nov 3, 2016 at 9:44 AM, Ian Lance Taylor wrote:
> [ +crawshaw ]
>
> On Thu, Nov 3, 2016 at 12:51 A
>
>
> Back on my original question, its ok if i copy paste the code into a
> specific module with its appropriate credits ?
> Given the quick red i gave it, there s really not much to change to this
> code, it if works already.
>
>
at the top of that file it says :
// Use of this source code is
[ +crawshaw ]
On Thu, Nov 3, 2016 at 12:51 AM, Mateusz Dymiński wrote:
> Hi,
>
> I am trying to load dynamically implementation of particular interface. I've
> created the example in following repo:
> https://github.com/mateuszdyminski/go-plugin
>
> I have interface - let's call it Printer:
> pac
Hi,
I am trying to load dynamically implementation of particular interface.
I've created the example in following
repo: https://github.com/mateuszdyminski/go-plugin
I have interface - let's call it Printer:
package printer
type Printer interface {
Print(text string)
}
And implementation of t
Hi, thanks for feedback.
The goal is to have a binary to generate self signed certificate in an
instant.
That i also want to provide installers, is because (its my sauce)
I believe there s a world beyond go community to whom go wonders can be
helpful
this is an easy goal to reach because go is
On Thu, Nov 3, 2016 at 1:40 PM wrote:
> to provide support for got get, windows/debian/rpm installers ?
I probably do not understand the goal correctly, but: If the user can do
`go get` then he has the go tool installed. That means he has Go installed.
That means he does not have to go get the
Hi,
I d like to know if i can go get this bin available here :
https://golang.org/src/crypto/tls/generate_cert.go
I think i can not, but i d like to be sure.
If that is not go gettable, is there any problem
if i re pack this into a specific module
to provide support for got get, windows/debia
On Thursday, 3 November 2016 01:40:29 UTC, Nigel Tao wrote:
>
>
> Another ignorant question from me, but what do you mean exactly by
> universal binary?
>
Apologies for the confusing and nonsensical term. What I meant was a binary
that works for a number of CPUs within an architecture, with or
package main
import "time"
func main() {
s := []int{100, 200}
println(&s)
go func() {
s[0] = 300
s = []int{300, 400}
}()
time.Sleep(1 * time.Second)
}
just curious about this ,can you help explain the assemble code here
"".main t=1 size=241 args=0x0 locals=0x28
0x 0 (main.go:5) TEXT "
33 matches
Mail list logo