Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Michael Baker

On 14/04/2021 20:25, Jeff Peck wrote:


Just a complete shot in the dark. Have you verified that the 
environment variables you set are indeed getting picked up inside of 
your application? Try checking the output of os.GetEnv("HTTP_PROXY"), 
os.GetEnv("HTTPS_PROXY"), and os.GetEnv("NO_PROXY"). Make sure that if 
NO_PROXY is set that it isn't overriding your local proxy.



You could also try setting the lowercase versions of these env vars:

https://github.com/golang/net/blob/master/http/httpproxy/proxy.go

func FromEnvironment() *Config {
    return {
        HTTPProxy:  getEnvAny("HTTP_PROXY", "http_proxy"),
        HTTPSProxy: getEnvAny("HTTPS_PROXY", "https_proxy"),
        NoProxy:    getEnvAny("NO_PROXY", "no_proxy"),
        CGI:    os.Getenv("REQUEST_METHOD") != "",
    }
}

Thanks for the ideas Jeff. I already found out what the issue was though 
- see my other reply.






--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3b6c84a4-fed3-0bed-3c17-b595a3239066%40gmail.com.


Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Jeff Peck
Just a complete shot in the dark. Have you verified that the environment 
variables you set are indeed getting picked up inside of your 
application? Try checking the output of os.GetEnv("HTTP_PROXY"), 
os.GetEnv("HTTPS_PROXY"), and os.GetEnv("NO_PROXY"). Make sure that if 
NO_PROXY is set that it isn't overriding your local proxy.



You could also try setting the lowercase versions of these env vars:

https://github.com/golang/net/blob/master/http/httpproxy/proxy.go

func FromEnvironment() *Config {
    return {
        HTTPProxy:  getEnvAny("HTTP_PROXY", "http_proxy"),
        HTTPSProxy: getEnvAny("HTTPS_PROXY", "https_proxy"),
        NoProxy:    getEnvAny("NO_PROXY", "no_proxy"),
        CGI:    os.Getenv("REQUEST_METHOD") != "",
    }
}


On 4/13/21 2:07 PM, Orson Cart wrote:

Please accept my ay apologies. I'd misunderstood the documentation.

I was looking for a reason why my go application's requests aren't 
being sent to the proxy that I've specified using HTTP_PROXY and 
HTTPS_PROXY. When I saw the comment in the documentation I thought I'd 
found an explanation even if I didn't understand the reason for it 
being that way.


So now I'm left with my original problem: I have HTTP_PROXY set to 
http://localhost: and HTTPS_PROXY set to https://localhost:. I 
also have a proxy (Fiddler) running on localhost: but requests 
from my application appear to go direct, bypassing the proxy.


I'm perplexed :(

On Tuesday, 13 April 2021 at 19:17:10 UTC+1 wagner riffel wrote:

On Tue Apr 13, 2021 at 2:14 PM -03, Orson Cart wrote:
> Can anyone explain the reasoning behind this? It rather
interferes with
> debugging traffic using a local proxy like Fiddler.
>

My guess here it's for preventing the remote from tricking the
proxy to
make request to internal services that couldn't be reached otherwise.

> I've seen suggestions to define an alternative hostname in
/etc/hosts
> but as far as I can tell this doesn't work either.
>

The code you linked doesn't seen to try that hard to block loopback
requests, I do think that an /etc/hosts entry to 127.0.0.1 should
bypass the proxy, if not I don't see any other way around other than
implementing the RoundTripper yourself, which shouldn't be hard for
such simple use.

--wagner

--
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 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ac6c1bae-2153-41b3-9037-110fc0eb12cfn%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c889bc72-0a1d-72a1-83dc-ecafe5ef8458%40gmail.com.


Re: [go-nuts] Trying to port Go to HPE NonStop x86 - Need some guidance

2021-04-14 Thread Ian Lance Taylor
On Wed, Apr 14, 2021 at 8:25 AM Shiva  wrote:
>
> One file specifically, types_linux.go which I duped into types_nsx.go has a 
> build statement that goes like this '+build ignore'. Github discussions 
> around this suggest to me that I don't have to build this? But happy to be 
> corrected.

The "+build ignore" line means that the file will not be built as part
of an ordinary "go build" or "go install".  For a file like
syscall/types_linux.go, that is because the file originally served as
input to cgo -godefs as part of generating the various
ztypes_linux_GOARCH.go files.

> Also, can I build the bootstrap on windows or can I only do it in a POSIX 
> environment - I don't see bootstrap.bat and running bootstrap.bash with 
> GOOS=nsx and GOARCH=amd64 simply returns back the prompt?

You should be able to build a bootstrap on Windows but you'll have to
either replicate bootstrap.bash in a Windows style, or you'll have to
use something like cygwin to run the bootstrap.bash shell script.
There aren't that many real commands in bootstrap.bash so I think that
creating a minimal bootstrap.bat would be fairly simple.

Ian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcV3KTEum58CHnsBybPdPTmn2sCf5zFxoScbqZt5j6UhbQ%40mail.gmail.com.


Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Orson Cart


On Wednesday, 14 April 2021 at 18:06:53 UTC+1 Adrian Ho wrote:

> The "Name Resolution" section in https://golang.org/pkg/net/ says:
>
> On Unix systems, the resolver has two options for resolving names. It can 
> use a pure Go resolver that sends DNS requests directly to the servers 
> listed in /etc/resolv.conf, or it can use a cgo-based resolver that calls C 
> library routines such as getaddrinfo and getnameinfo.
>
> By default the pure Go resolver is used, because a blocked DNS request 
> consumes only a goroutine, while a blocked C call consumes an operating 
> system thread.
>
> That might have some bearing on your problem. To see if it's the case, as 
> the page suggests:
>
> export GODEBUG=netdns=cgo   # force cgo resolver
>
>
> Best Regards,
> Adrian
>

Thanks Adrian. For the record, I'm working on Windows.

For the record I should also admit that I've been missing the blindingly 
obvious. At least it's blindingly obvious to me now.

I never occurred to me before that the client instance that I'm using has a 
non-default Transport. The way that the transport is initialised means that 
it has a nil Proxy - hence whatever I set in the environment didn't matter 
as it was being ignored.

This thread hasn't been my finest hour! 

Thanks to all for the help.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/16791ca0-702a-4474-9052-76ce67ba9a42n%40googlegroups.com.


Re: [go-nuts] go text://protocol client?

2021-04-14 Thread 'Axel Wagner' via golang-nuts
I'm genuinely baffled by the lack of self-awareness on display here.

On Wed, Apr 14, 2021 at 7:43 PM Thomas Bushnell BSG 
wrote:

> In *Ash Wednesday, *T. S. Eliot wrote the line "Lady, three white
> leopards sat under a juniper tree in the cool of the day" When he was
> asked what it meant, he aisd "It means, 'Lady, three white leopards sat
> under a juniper tree in the cool of the day'"
>
> I suspect if there were a better way to express what Eliot meant, he would
> have chosen it.
>
>
> On Sun, Apr 11, 2021 at 8:19 AM 'Axel Wagner' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
>> I don't understand what you are trying to say. And I feel the fact that
>> everyone talking about is either confused, or speaking in riddles instead
>> of just plainly explaining what they are trying to say, speaks for itself.
>>
>> On Sun, Apr 11, 2021 at 1:55 PM Petite Abeille 
>> wrote:
>>
>>>
>>>
>>> > On Apr 11, 2021, at 12:22, 'Axel Wagner' via golang-nuts <
>>> golang-nuts@googlegroups.com> wrote:
>>> >
>>> > Everything around it certainly emits the air of pretentiousness that
>>> the fine art market is famous for.
>>>
>>> There is a method to it:
>>>
>>>
>>> https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Ftextprotocol.org%2Fcontact
>>>
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/3CE49F13-0142-4172-B967-1CC189354524%40gmail.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/CAEkBMfH%2BQkdwicL3g_pHFz4Ncv_q-JdFEDsYWxczUBtUFHyr-w%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfF%2BbGP1POesS%2BQLGCD-ps94WYqyEs9-HBR7xz7pGVeABw%40mail.gmail.com.


Re: [go-nuts] go text://protocol client?

2021-04-14 Thread 'Thomas Bushnell BSG' via golang-nuts
In *Ash Wednesday, *T. S. Eliot wrote the line "Lady, three white leopards
sat under a juniper tree in the cool of the day" When he was asked what
it meant, he aisd "It means, 'Lady, three white leopards sat under a
juniper tree in the cool of the day'"

I suspect if there were a better way to express what Eliot meant, he would
have chosen it.


On Sun, Apr 11, 2021 at 8:19 AM 'Axel Wagner' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I don't understand what you are trying to say. And I feel the fact that
> everyone talking about is either confused, or speaking in riddles instead
> of just plainly explaining what they are trying to say, speaks for itself.
>
> On Sun, Apr 11, 2021 at 1:55 PM Petite Abeille 
> wrote:
>
>>
>>
>> > On Apr 11, 2021, at 12:22, 'Axel Wagner' via golang-nuts <
>> golang-nuts@googlegroups.com> wrote:
>> >
>> > Everything around it certainly emits the air of pretentiousness that
>> the fine art market is famous for.
>>
>> There is a method to it:
>>
>>
>> https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https%3A%2F%2Ftextprotocol.org%2Fcontact
>>
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/3CE49F13-0142-4172-B967-1CC189354524%40gmail.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAEkBMfH%2BQkdwicL3g_pHFz4Ncv_q-JdFEDsYWxczUBtUFHyr-w%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BYjuxvLRPZ96FKoUj3kkJAtVhnG-7oCAqGaF5aR1-BN%3DukHdA%40mail.gmail.com.


Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
Ah, thanks
This will help me a lot
Khanh

On Thursday, April 15, 2021 at 1:13:17 AM UTC+8 th...@google.com wrote:

> Hi again,
>
> Not quite sure what you are asking-- 
>
> If you want to generated LLVM bitcode and then use that with your version 
> 10 llvm tools, then you'll either need to build a version-10 compatible 
> gollvm, or you'll need to upgrade the LLVM used by your tools/project.
>
> You can try building a V10-compatible gollvm by checking out old versions 
> of the various git repos in your work area. These sha's should give you a 
> working V10 gollvm:
>
> # This is the llvm 10.0.1 final git tag:
> LLVM: ef32c611aa214dea855364efd7ba451ec5ec3f74
>
> gollvm: ad0491f483d17893a2439bdb63d0f94124965549
>
> gofrontend: 85641a0f26061f7c98db42a2adb3250c07ce504e
>
> libffi: 737d4faa00d681b4c758057f67e1a02d813d01c2
>
> libbacktrace: 5a99ff7fed66b8ea8f09c9805c138524a7035ece
>
>
> Cheers, Than
>
> On Wed, Apr 14, 2021 at 11:42 AM Khanh TN  wrote:
>
>> Hi Ian,
>> My project is currently running on LLVM10.
>> If I want to use gollvm, do I just have to upgrade to the latest commits?
>> Thanks
>> Khanh
>>
>> On Wednesday, April 14, 2021 at 11:08:36 PM UTC+8 Khanh TN wrote:
>>
>>> Thanks,
>>> I see it's hard to keep syncing with LLVM. They have new commits every 
>>> minute
>>>
>>> Khanh
>>>
>>> On Wednesday, April 14, 2021 at 10:53:13 PM UTC+8 th...@google.com 
>>> wrote:
>>>
 OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069, 
 should be resolved now. Thanks for reporting.

 On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh  wrote:

> Thanks for reporting. I'll look into sending a CL.
>
> Cheers, Than
>
>
> On Tue, Apr 13, 2021 at 6:09 PM Khanh TN  wrote:
>
>> Hi, I'm building gollvm with both gollvm and LLVM on the latest 
>> commit.
>> It fails and the error reads:
>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: 
>> error: ‘NoAlias’ was not declared in this scope
>>if (AAResult != NoAlias)
>>^~~
>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: 
>> note: suggested alternative: ‘AR_NoAlias’
>>
>> Can you guys check? Sorry if I'm spamming about gollvm lately.
>> Thanks!
>> Khanh
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/de629758-4d44-4348-a506-1f2f6404b5b0n%40googlegroups.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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/6c371d0f-eea1-4098-999a-3f2126cdb602n%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1f4d6be9-d9bc-4eb1-bf94-4ed956621659n%40googlegroups.com.


Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread 'Than McIntosh' via golang-nuts
Hi again,

Not quite sure what you are asking--

If you want to generated LLVM bitcode and then use that with your version
10 llvm tools, then you'll either need to build a version-10 compatible
gollvm, or you'll need to upgrade the LLVM used by your tools/project.

You can try building a V10-compatible gollvm by checking out old versions
of the various git repos in your work area. These sha's should give you a
working V10 gollvm:

# This is the llvm 10.0.1 final git tag:
LLVM: ef32c611aa214dea855364efd7ba451ec5ec3f74

gollvm: ad0491f483d17893a2439bdb63d0f94124965549

gofrontend: 85641a0f26061f7c98db42a2adb3250c07ce504e

libffi: 737d4faa00d681b4c758057f67e1a02d813d01c2

libbacktrace: 5a99ff7fed66b8ea8f09c9805c138524a7035ece


Cheers, Than

On Wed, Apr 14, 2021 at 11:42 AM Khanh TN  wrote:

> Hi Ian,
> My project is currently running on LLVM10.
> If I want to use gollvm, do I just have to upgrade to the latest commits?
> Thanks
> Khanh
>
> On Wednesday, April 14, 2021 at 11:08:36 PM UTC+8 Khanh TN wrote:
>
>> Thanks,
>> I see it's hard to keep syncing with LLVM. They have new commits every
>> minute
>>
>> Khanh
>>
>> On Wednesday, April 14, 2021 at 10:53:13 PM UTC+8 th...@google.com wrote:
>>
>>> OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069,
>>> should be resolved now. Thanks for reporting.
>>>
>>> On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh  wrote:
>>>
 Thanks for reporting. I'll look into sending a CL.

 Cheers, Than


 On Tue, Apr 13, 2021 at 6:09 PM Khanh TN  wrote:

> Hi, I'm building gollvm with both gollvm and LLVM on the latest commit.
> It fails and the error reads:
> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23:
> error: ‘NoAlias’ was not declared in this scope
>if (AAResult != NoAlias)
>^~~
> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23:
> note: suggested alternative: ‘AR_NoAlias’
>
> Can you guys check? Sorry if I'm spamming about gollvm lately.
> Thanks!
> Khanh
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/de629758-4d44-4348-a506-1f2f6404b5b0n%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/6c371d0f-eea1-4098-999a-3f2126cdb602n%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55EK_Rn8FOXdJG%2BXGWQBrmej88mYRkfed%2BmNqw9dnpyBLQ%40mail.gmail.com.


Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Adrian Ho

On 14/4/21 6:39 am, Orson Cart wrote:

So, to clarify:

1/ I have a proxy (Fiddler) running locally on port 
2/ my /etc/hosts file has an entry as follows: 127.0.0.1 fiddler
3/ My HTTP_PROXY and HTTPS_PROXY environment variables are set to 
http://fiddler:  and https://fiddler: 
 respectively


if I then issue a request via curl then that request is picked up by 
the proxy.
However if I make the same request from my go application, the request 
appears to bypass the proxy and is sent directly. I'm perplexed.


The "Name Resolution" section in https://golang.org/pkg/net/ says:

On Unix systems, the resolver has two options for resolving names. It 
can use a pure Go resolver that sends DNS requests directly to the 
servers listed in /etc/resolv.conf, or it can use a cgo-based resolver 
that calls C library routines such as getaddrinfo and getnameinfo.


By default the pure Go resolver is used, because a blocked DNS request 
consumes only a goroutine, while a blocked C call consumes an operating 
system thread.


That might have some bearing on your problem. To see if it's the case, 
as the page suggests:


export GODEBUG=netdns=cgo   # force cgo resolver


Best Regards,
Adrian

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2709afa1-a037-8d3c-3fe0-f469588e3c8e%4003s.net.


Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
Hi Ian,
My project is currently running on LLVM10.
If I want to use gollvm, do I just have to upgrade to the latest commits?
Thanks
Khanh

On Wednesday, April 14, 2021 at 11:08:36 PM UTC+8 Khanh TN wrote:

> Thanks,
> I see it's hard to keep syncing with LLVM. They have new commits every 
> minute
>
> Khanh
>
> On Wednesday, April 14, 2021 at 10:53:13 PM UTC+8 th...@google.com wrote:
>
>> OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069, 
>> should be resolved now. Thanks for reporting.
>>
>> On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh  wrote:
>>
>>> Thanks for reporting. I'll look into sending a CL.
>>>
>>> Cheers, Than
>>>
>>>
>>> On Tue, Apr 13, 2021 at 6:09 PM Khanh TN  wrote:
>>>
 Hi, I'm building gollvm with both gollvm and LLVM on the latest commit.
 It fails and the error reads:
 [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: 
 error: ‘NoAlias’ was not declared in this scope
if (AAResult != NoAlias)
^~~
 [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: 
 note: suggested alternative: ‘AR_NoAlias’

 Can you guys check? Sorry if I'm spamming about gollvm lately.
 Thanks!
 Khanh

 -- 
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/golang-nuts/de629758-4d44-4348-a506-1f2f6404b5b0n%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6c371d0f-eea1-4098-999a-3f2126cdb602n%40googlegroups.com.


Re: [go-nuts] Trying to port Go to HPE NonStop x86 - Need some guidance

2021-04-14 Thread Shiva
Thanks, Ian. I did as you suggested. 

One file specifically, types_linux.go which I duped into types_nsx.go has a 
build statement that goes like this '+build ignore'. Github discussions 
around this suggest to me that I don't have to build this? But happy to be 
corrected. 

Also, can I build the bootstrap on windows or can I only do it in a POSIX 
environment - I don't see bootstrap.bat and running bootstrap.bash with 
GOOS=nsx and GOARCH=amd64 simply returns back the prompt?

On Wednesday, April 7, 2021 at 11:34:26 PM UTC+1 Ian Lance Taylor wrote:

> On Wed, Apr 7, 2021 at 4:47 AM Shiva  wrote:
> >
> > Thanks, Ian. Another step closer. Should the build statement just say:
> >
> > +build nsx
> >
> > Or should it be subject to any other rule, because I see a lot of 
> different build statements in each of those directories and they vary.
>
> As a general guideline, follow the pattern of the existing files.
>
> If there is a case that is unclear, let us know.
>
> Ian
>
>
> > On Wednesday, March 24, 2021 at 6:44:00 PM UTC Ian Lance Taylor wrote:
> >>
> >> On Wed, Mar 24, 2021 at 11:18 AM Shiva  wrote:
> >> >
> >> > Thank you for that, Ian.
> >> >
> >> > Just to confirm, I see the following -
> >> >
> >> > *_linux.c,
> >> > *_linux.h,
> >> > *_linux.go,
> >> > *_linux.s,
> >> > *_linux.pl
> >> >
> >> > They are in different directories - crypto, internal\syscall, net, 
> os, runtime, sync\atomic and syscall under the src directory. But you had 
> earlier mentioned only runtime and syscall packages so do I have to add the 
> rest too?
> >> >
> >> > After this I suppose I run bootstrap.bash which should create a go 
> package that I should try and run on the Nonstop.
> >>
> >> In the long run you will most likely have to handle all of those one
> >> way or another, yes. Except probably for mksysnum_linux.pl.
> >>
> >> Ian
> >>
> >>
> >>
> >> > On Tuesday, March 23, 2021 at 6:51:55 PM UTC Ian Lance Taylor wrote:
> >> >>
> >> >> On Tue, Mar 23, 2021 at 9:41 AM Shiva  
> wrote:
> >> >> >
> >> >> > Trying to pick this up where it was left, we have the list of 
> files *_linux.go, *_linux.s but not all of them have the build statements, 
> do we create new nsx files only for those which have build statements in 
> them or for all of those files?
> >> >>
> >> >> For all of them. And add build tags to all of them. The use of build
> >> >> tags in *_linux files is not consistent because the go tool has 
> always
> >> >> recognized *_linux file names specially.
> >> >>
> >> >> Ian
> >> >>
> >> >> > On Sunday, June 7, 2020 at 2:38:09 AM UTC+1 Ian Lance Taylor wrote:
> >> >> >>
> >> >> >> On Sat, Jun 6, 2020 at 8:57 AM Randall Becker  
> wrote:
> >> >> >> >
> >> >> >> > Thanks. Where do fix the linker. I found the files to modify - 
> so will basically copy the *_linux.go, *_linux.s in both runtime and 
> syscalls to *_nsx.go and *_nsx.s, replacing +build lines with nsx instead 
> of linux, I assume. Currently looking for an assembler cross-compiler for 
> the platform (I may have to write one, something I'm much more comfortable 
> with than the GO port) - I can wrap asm in C code, but I don't know how to 
> get GO to recognize that.
> >> >> >>
> >> >> >> Go uses its own assembler, in cmd/asm.
> >> >> >>
> >> >> >> Ian
> >> >> >>
> >> >> >>
> >> >> >> > On Friday, 5 June 2020 19:03:07 UTC-4, Ian Lance Taylor wrote:
> >> >> >> >>
> >> >> >> >> On Fri, Jun 5, 2020 at 3:46 PM Randall Becker <
> the@gmail.com> wrote:
> >> >> >> >> >
> >> >> >> >> > That's actually what I figured. So where do I look to add 
> nsx to the toolchain?
> >> >> >> >>
> >> >> >> >> You'll have to fix the linker to generate whatever nsx expects.
> >> >> >> >> You'll have to add code to support nsx in the runtime and 
> syscall
> >> >> >> >> packages. Pick which supported OS is most like nsx; let's say 
> it's
> >> >> >> >> linux. Look for *_linux.go and *_linux.s files; you'll need nsx
> >> >> >> >> versions of those files. Look for +build lines in files that 
> say
> >> >> >> >> linux; you'll need to add nsx, or write a separate file that 
> works on
> >> >> >> >> nsx.
> >> >> >> >>
> >> >> >> >> It's a lot of work.
> >> >> >> >>
> >> >> >> >> Ian
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> > On Friday, 5 June 2020 17:03:11 UTC-4, Ian Lance Taylor 
> wrote:
> >> >> >> >> >>
> >> >> >> >> >> On Fri, Jun 5, 2020 at 12:49 PM Randall Becker <
> the@gmail.com> wrote:
> >> >> >> >> >> >
> >> >> >> >> >> > Some progress. I've managed to build 1.14.4 using the 
> Windows GO implementation. The trouble I was having was using cygwin64. 
> After figuring that part out...
> >> >> >> >> >> >
> >> >> >> >> >> > I checked out a new branch from release_go1.14 named 
> nonstop_port
> >> >> >> >> >> >
> >> >> >> >> >> > Then ran
> >> >> >> >> >> >
> >> >> >> >> >> > GOARCH=amd64 GOOS=nsx bootstrap.bash
> >> >> >> >> >> > which failed because I am using cygwin64, but then ran 
> make.bat from inside ../../go-nsx-amd64-bootstrap
> >> >> >> >> >> > That 

Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread Khanh TN
Thanks,
I see it's hard to keep syncing with LLVM. They have new commits every 
minute

Khanh

On Wednesday, April 14, 2021 at 10:53:13 PM UTC+8 th...@google.com wrote:

> OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069, 
> should be resolved now. Thanks for reporting.
>
> On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh  wrote:
>
>> Thanks for reporting. I'll look into sending a CL.
>>
>> Cheers, Than
>>
>>
>> On Tue, Apr 13, 2021 at 6:09 PM Khanh TN  wrote:
>>
>>> Hi, I'm building gollvm with both gollvm and LLVM on the latest commit.
>>> It fails and the error reads:
>>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: 
>>> error: ‘NoAlias’ was not declared in this scope
>>>if (AAResult != NoAlias)
>>>^~~
>>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: note: 
>>> suggested alternative: ‘AR_NoAlias’
>>>
>>> Can you guys check? Sorry if I'm spamming about gollvm lately.
>>> Thanks!
>>> Khanh
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/de629758-4d44-4348-a506-1f2f6404b5b0n%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f9c11fbd-ebcf-40f9-9b0e-e165d88b488bn%40googlegroups.com.


Re: [go-nuts] Building gollvm fails on the latest commit

2021-04-14 Thread 'Than McIntosh' via golang-nuts
OK, I checked in https://go-review.googlesource.com/c/gollvm/+/310069,
should be resolved now. Thanks for reporting.

On Tue, Apr 13, 2021 at 7:30 PM Than McIntosh  wrote:

> Thanks for reporting. I'll look into sending a CL.
>
> Cheers, Than
>
>
> On Tue, Apr 13, 2021 at 6:09 PM Khanh TN  wrote:
>
>> Hi, I'm building gollvm with both gollvm and LLVM on the latest commit.
>> It fails and the error reads:
>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: error:
>> ‘NoAlias’ was not declared in this scope
>>if (AAResult != NoAlias)
>>^~~
>> [..]/llvm-project/llvm/tools/gollvm/passes/GoNilChecks.cpp:363:23: note:
>> suggested alternative: ‘AR_NoAlias’
>>
>> Can you guys check? Sorry if I'm spamming about gollvm lately.
>> Thanks!
>> Khanh
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/de629758-4d44-4348-a506-1f2f6404b5b0n%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55GhbdumdzM8Ka-rUCE51B%3D1p44pFQnPa0rjVtibwWoZcg%40mail.gmail.com.


Re: [go-nuts] how to pass analyzer's flag with 'go vet -vettool'

2021-04-14 Thread 'wagner riffel' via golang-nuts
On Wed Apr 14, 2021 at 12:25 AM -03, Xiangdong Ji wrote:
> I tried to modify fieldalignment to turn its '-fix' option on by
> default, change worked as expected if running fieldalignment as a
> standalone utility, but no rewriting is applied when running it as a
> tool of 'go vet', could any expert here shed a light? Thanks.
>

In the last time I check this, I remember I saw that `go vet` calls
`vettol` with -flags argument and then tries to match with the command
line passed, but fieldalignment doesn't list -fix, that's why I said it
was broken. Hope this might help you:
https://github.com/golang/go/blob/e22478/src/cmd/go/internal/vet/vetflag.go#L67

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANHTHBOHYT7.2C1Y5NKICHA8%40pampas.


Re: [go-nuts] Go Semantics Aware diff tool?

2021-04-14 Thread Jan Mercl
On Wed, Apr 14, 2021 at 1:51 PM Steve Mynott  wrote:

> I'm aware tools exist to parse go and a quick google search search
> fails me but I was wondering if there was a utility which was a
> go-aware diff which I could use like "git diff master" which printed
> out a list of funcs changed?

Would this work for you?

$ git diff master | grep '@@ func'

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-Uy038UXckc3hCvwyaXko84-LZZNb2JE3MCoJt_NxJbBQ%40mail.gmail.com.


[go-nuts] Go Semantics Aware diff tool?

2021-04-14 Thread Steve Mynott
I'm aware tools exist to parse go and a quick google search search
fails me but I was wondering if there was a utility which was a
go-aware diff which I could use like "git diff master" which printed
out a list of funcs changed?

Cheers Steve

-- 
Steve Mynott 
cv25519/ECF8B611205B447E091246AF959E3D6197190DD5

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANuZA8R_kYvtqJRErQLSOQxdWbjqsg3L4TuZTR0H9Xe-SXHqFA%40mail.gmail.com.


Re: [go-nuts] Case for Cond.WaitTimeout()

2021-04-14 Thread Jesper Louis Andersen
On Tue, Apr 13, 2021 at 3:00 PM Roman Leventov 
wrote:

> Jesper, a single channel works if I provision it with big enough capacity
> (1000), but this feels like an antipattern which can break.
>

Yes.

On the flip side though, unbounded channels are also dangerous if the
producer(s) outpaces consumers. In a real system, you'll have to decide on
an in-flight limit anyway, if you want your system to be stable. If you
don't want a bound, just set the capacity at 1_000_000_000_000 or some
number that's larger than the available RAM for the foreseeable future.

Personally, I'd probably go with the flow control pattern.

Also, the idea of using a checkout/checkin pattern on a 1-capacity channel
circumvents most of these considerations.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGrdgiX26Ndouk3ftafVmz_QH9Q9yVumOP%3DmdyHdvLUWKbJiXA%40mail.gmail.com.