Re: [go-nuts] Re: go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Lee Painton
My build system was missing golang.org/x/net/lex/httplex and issuing go get
for this package was giving me that message without actually retrieving the
httplex sub-package.  I assumed it meant go get was failing.  I will try to
verify tomorrow though.

On Wed, Apr 4, 2018 at 11:43 PM, Volker Dobler 
wrote:

> Just to make sure: go get golang.org/x/net works, it does
> download all for golang.org/x/net and the message is
> just an information.
>
> V.
>
> On Thursday, 5 April 2018 04:21:15 UTC+2, Lee Painton wrote:
>
>> Trying the listed command returns:
>> package golang.org/x/net: no Go files in /Users/lpainton/go/src/golang.
>> org/x/net
>>
>> Workaround is trivial, but the documentation on
>> https://github.com/golang/net is wrong
>>
> --
> 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 more options, visit https://groups.google.com/d/optout.
>

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Volker Dobler
Just to make sure: go get golang.org/x/net works, it does
download all for golang.org/x/net and the message is
just an information.

V.

On Thursday, 5 April 2018 04:21:15 UTC+2, Lee Painton wrote:
>
> Trying the listed command returns: 
> package golang.org/x/net: no Go files in /Users/lpainton/go/src/
> golang.org/x/net
>
> Workaround is trivial, but the documentation on 
> https://github.com/golang/net is wrong
>

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Volker Dobler
As golang.org/x/net is not a Go package the result is
to be expected. I wonder where you found documented
that go get -u golang.org/x/net should behave differently?

V.

On Thursday, 5 April 2018 04:21:15 UTC+2, Lee Painton wrote:
>
> Trying the listed command returns: 
> package golang.org/x/net: no Go files in /Users/lpainton/go/src/
> golang.org/x/net
>
> Workaround is trivial, but the documentation on 
> https://github.com/golang/net is wrong
>

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] [ANN] go-resty v1.4 released - Simple HTTP and REST client library

2018-04-04 Thread Jeevanandam M.
Production Version : gopkg.in/resty.v1
Edge Version   : github.com/go-resty/resty
godoc  : https://godoc.org/github.com/go-resty/resty


Changelog:

Enhancements:
  * Added support for RFC7807 - `application/problem+json` and 
`application/problem+xml` #134, #135
  * Bufferless large file on body `R().SetBody(reader)` #133, #136

Cheers,
Jeeva

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Lee Painton
Trying the listed command returns: 
package golang.org/x/net: no Go files in 
/Users/lpainton/go/src/golang.org/x/net

Workaround is trivial, but the documentation on 
https://github.com/golang/net is wrong

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Go 1.8 or higher on Solaris sparc64.

2018-04-04 Thread ayavanamanda
Go 1.7 is the latest version supported by Oracle 
(http://pkg.oracle.com/solaris/release/en/search.shtml?token=golang=Search),
 
anybody got Go 1.8 or higher working for Solaris sparc64?

Found https://github.com/4ad/go/tree/sparc64.go1.8, doesn't seem to be 
actively maintained, any one had luck with this repo?

Thanks,
--ay



-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Justifying dot imports using comments

2018-04-04 Thread roger peppe
On 2 April 2018 at 15:42, Paul Jolly  wrote:
> Speaking as someone who has written a few (albeit simple) code generators
> that parse Go code, dot imports are a nightmare from my perspective because
> it makes it impossible to work out from just imports alone whether an
> identifier belongs to the current package or not.
>
> Put another way, if you disallow dot imports, a reference to anything that
> is outside the current package needs to be a qualified identifier, a
> qualified identifier that is easily determined by reference to the (possibly
> renamed) imports in the current file.
>
> Blank imports on the other hand are only used for the side effects of their
> inits; they do not alter the importing scope.
>
> I can't quite find the link right now, but it has long been thought/said by
> the authors of the Go language that dot imports should not have been
> included in the language.
>
> All that said I suspect this was a large part of the reason that golint
> discourages the use of dot imports.

I agree wholeheartedly with this. In my experience they are almost
used for aesthetic reasons ("the package-qualified names ruin the look
of my DSL!") and those reasons should not trump the overall
readability and maintainability gains from having all externally
declared variables properly qualified.

If you want minimal package qualification for very frequently used
packages, using a shortened package identifier can work well. For
example, we commonly import our testing helper package with a
two-character package identifier because its symbols are so commonly
used. A single capital letter could work well too, I think.

We now also have aliases if you want to define names locally, but
that's an avenue I haven't explored much, and might turn out to be a
bad idea in the long run.

I'm rarely an absolutist when it comes to programming style, but I
make an exception for dot-imports. Please don't succumb to their
temptation.

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] [ANN] HAProxy log miner and forwarder

2018-04-04 Thread Shulhan
Hi all,

I just like want to share a library and program written in Go to parse
and forward HAProxy (UDP) stream log to Influxdb.

https://github.com/shuLhan/haminer

Have a nice day.

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Is there a memory leak on Rob Pike's demo codes?

2018-04-04 Thread andrey mirtchovski
The easiest way to avoid this is to make the channel buffered with
enough room to consume all responses. Only the first one will be read,
but the rest will be garbage collected.

c := make(chan Result, len(replicas))

should be enough.

On Wed, Apr 4, 2018 at 4:20 AM, wilby yang  wrote:
> I am new to golang and I am not sure if it is a stupid question. I am
> reading the slides of Rob Pike on go concurrency patterns in 2012. I think
> there is a resource leak in the below function. As the function will return
> after the first send pair happens on channel c, the other goroutines
> trying to send on channel c will be blocked and prevents resources GC.
> Anyone knows golang well can confirm this? If it is resource leak, how can I
> detect it using what kind of golang tooling?down votefavorite
>
> func First(query string, replicas ...Search) Result {
>   c := make(chan Result)
>   searchReplica := func(i int) {
> c <- replicas[i](query)
>   }
>   for i := range replicas {
> go searchReplica(i)
>   }
>   return <-c
> }
>
> --
> 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 more options, visit https://groups.google.com/d/optout.

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Is there a memory leak on Rob Pike's demo codes?

2018-04-04 Thread wilby yang
I am new to golang and I am not sure if it is a stupid question. I am 
reading the slides of Rob Pike on go concurrency patterns in 2012. I think 
there is a resource leak in the below function. As the function will return 
after the first send pair happens on channel c, the other 
goroutines trying to send on channel c will be blocked and prevents 
resources GC. Anyone knows golang well can confirm this? If it is resource 
leak, how can I detect it using what kind of golang tooling?down vote
favorite 


func First(query string, replicas ...Search) Result {
  c := make(chan Result)
  searchReplica := func(i int) {
c <- replicas[i](query)
  }
  for i := range replicas {
go searchReplica(i)
  }
  return <-c}

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: blocking profiler

2018-04-04 Thread sothy shan


On Wednesday, April 4, 2018 at 2:59:06 PM UTC+2, Dave Cheney wrote:
>
> You can report issues with Go at this link, golang.org/issue/new. 
>
> However, this looks like a docker weirdness so we cannot help you as the 
> bug isn't in go, it's docker weirdness.
>
> Please try their support forums, sorry I don't have those details, i've 
> never tried to get support for their product.
>

thanks Dave.  

>
> On Wednesday, 4 April 2018 21:52:08 UTC+10, sothy shan wrote:
>>
>>
>>
>> On Tuesday, April 3, 2018 at 4:50:36 PM UTC+2, Dave Cheney wrote:
>>>
>>> I’ve not seen that problem before. I’d hazard a guess that it’s an 
>>> incorrect go installation. Don’t set goroot, basically ever. But it’s just 
>>> a guess. 
>>>
>> It is basically problem when I run in docker container. This is sample 
>> program.
>>
>> ++
>> package main
>>
>> import (
>> "os"
>> "runtime/pprof"  
>> "runtime"
>> "fmt"   
>> ) 
>>
>> func main() {
>> f,_ :=os.Create("./ipcore_blocking.prof")
>> 
>>  runtime.SetBlockProfileRate(1)
>>   
>>   defer func() {
>> if err := pprof.Lookup("block").WriteTo(f,0); err 
>> !=nil {
>> fmt.Printf("blocking profiler statistic 
>> collecition initialization failed: %v", err)
>>  }
>>
>>  f.Close()
>>  runtime.SetBlockProfileRate(0)
>>}()  
>> // create new channel of type int
>> ch := make(chan int)
>>
>> // start new anonymous goroutine
>> go func() {
>> // send 42 to channel
>> ch <- 42
>> }()
>> // read from channel
>> <-ch
>> }
>> +
>> When I run localhost, it workes well. when I tries to run docker 
>> container, it didnt work. I can give my dockerfile here. 
>> FROM golang:1.9-alpine as dev
>>
>> +++
>> RUN apk add --no-cache --repository 
>> http://dl-3.alpinelinux.org/alpine/edge/community upx
>>
>> WORKDIR /go/src/project
>>
>>
>> COPY ./main.go /go/src/project
>> RUN go build -o /bin/project
>>
>> FROM scratch
>> COPY --from=dev /bin/project /bin/project
>> ENTRYPOINT ["/bin/project"]
>>  
>> +
>> I have another problem when I run in Docker with CPU profile. 
>>
>> In this case where to report the issues?
>>
>> Best regards
>> Sothy
>>
>>>
>>> Are you able to create a stand alone program that demonstrates the issue 
>>> with the profile? Please consider raising a bug, golang.org/issue/new
>>
>>

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: blocking profiler

2018-04-04 Thread Dave Cheney
You can report issues with Go at this link, golang.org/issue/new. 

However, this looks like a docker weirdness so we cannot help you as the 
bug isn't in go, it's docker weirdness.

Please try their support forums, sorry I don't have those details, i've 
never tried to get support for their product.

On Wednesday, 4 April 2018 21:52:08 UTC+10, sothy shan wrote:
>
>
>
> On Tuesday, April 3, 2018 at 4:50:36 PM UTC+2, Dave Cheney wrote:
>>
>> I’ve not seen that problem before. I’d hazard a guess that it’s an 
>> incorrect go installation. Don’t set goroot, basically ever. But it’s just 
>> a guess. 
>>
> It is basically problem when I run in docker container. This is sample 
> program.
>
> ++
> package main
>
> import (
> "os"
> "runtime/pprof"  
> "runtime"
> "fmt"   
> ) 
>
> func main() {
> f,_ :=os.Create("./ipcore_blocking.prof")
> 
>  runtime.SetBlockProfileRate(1)
>   
>   defer func() {
> if err := pprof.Lookup("block").WriteTo(f,0); err 
> !=nil {
> fmt.Printf("blocking profiler statistic 
> collecition initialization failed: %v", err)
>  }
>
>  f.Close()
>  runtime.SetBlockProfileRate(0)
>}()  
> // create new channel of type int
> ch := make(chan int)
>
> // start new anonymous goroutine
> go func() {
> // send 42 to channel
> ch <- 42
> }()
> // read from channel
> <-ch
> }
> +
> When I run localhost, it workes well. when I tries to run docker 
> container, it didnt work. I can give my dockerfile here. 
> FROM golang:1.9-alpine as dev
>
> +++
> RUN apk add --no-cache --repository 
> http://dl-3.alpinelinux.org/alpine/edge/community upx
>
> WORKDIR /go/src/project
>
>
> COPY ./main.go /go/src/project
> RUN go build -o /bin/project
>
> FROM scratch
> COPY --from=dev /bin/project /bin/project
> ENTRYPOINT ["/bin/project"]
>  
> +
> I have another problem when I run in Docker with CPU profile. 
>
> In this case where to report the issues?
>
> Best regards
> Sothy
>
>>
>> Are you able to create a stand alone program that demonstrates the issue 
>> with the profile? Please consider raising a bug, golang.org/issue/new
>
>

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Is there a build option to only consider the vendor folder for imports?

2018-04-04 Thread Alex Efros
Hi!

On Tue, Apr 03, 2018 at 03:25:44PM -0700, roar...@zillowgroup.com wrote:
> In an effort to make sure code that builds on my local machine will build 
> on our build machine, I am looking for a build option to force the compiler 
> to only look for imported code in the vendor directory & pkg.

You can set GOPATH to directory specific to this project and either check
$GOPATH/src doesn't contain anything but your project's dir before release
or (untested) change $GOPATH/src permissions to 0555 to ensure `go get`
won't be able to create anything there.

But I doubt any of these will be convenient enough - usual way to solve
this issue is run local build/test before release in isolated CI-like
environment (like in a docker). If you'll have empty GOPATH in that
environment and will be able to build a project without `go get` at all
then it'll mean you've vendored all dependencies.

Also you can try to switch to vgo - while it's experimental it should
provide reproducible builds without vendoring at all.

-- 
WBR, Alex.

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Can I do Windows printing in Go?

2018-04-04 Thread ojucie
Take a look at a Windows utility named printui.EXE . It is meant to be used by 
scripts to configure printer settings.

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: blocking profiler

2018-04-04 Thread sothy shan


On Tuesday, April 3, 2018 at 4:50:36 PM UTC+2, Dave Cheney wrote:
>
> I’ve not seen that problem before. I’d hazard a guess that it’s an 
> incorrect go installation. Don’t set goroot, basically ever. But it’s just 
> a guess. 
>
It is basically problem when I run in docker container. This is sample 
program.

++
package main

import (
"os"
"runtime/pprof"  
"runtime"
"fmt"   
) 

func main() {
f,_ :=os.Create("./ipcore_blocking.prof")

 runtime.SetBlockProfileRate(1)
  
  defer func() {
if err := pprof.Lookup("block").WriteTo(f,0); err !=nil 
{
fmt.Printf("blocking profiler statistic collecition 
initialization failed: %v", err)
 }
   
 f.Close()
 runtime.SetBlockProfileRate(0)
   }()  
// create new channel of type int
ch := make(chan int)

// start new anonymous goroutine
go func() {
// send 42 to channel
ch <- 42
}()
// read from channel
<-ch
}
+
When I run localhost, it workes well. when I tries to run docker container, 
it didnt work. I can give my dockerfile here. 
FROM golang:1.9-alpine as dev

+++
RUN apk add --no-cache --repository 
http://dl-3.alpinelinux.org/alpine/edge/community upx

WORKDIR /go/src/project


COPY ./main.go /go/src/project
RUN go build -o /bin/project

FROM scratch
COPY --from=dev /bin/project /bin/project
ENTRYPOINT ["/bin/project"]
 
+
I have another problem when I run in Docker with CPU profile. 

In this case where to report the issues?

Best regards
Sothy

>
> Are you able to create a stand alone program that demonstrates the issue 
> with the profile? Please consider raising a bug, golang.org/issue/new

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go ssa instruction type

2018-04-04 Thread Sebastien Binet
Arpit,


On Wed, Apr 4, 2018 at 1:40 PM, Arpit Aggarwal 
wrote:

> Thank you very much Sebastien,
> this is very helpful. I didn't know about the type switches.
> Also do you know anything by which i can simply print the type rather than
> adding a case for every type.
>

fmt.Printf("instruction= %T\n", instr)

should do.
hth,
-s

>
>
> On Wednesday, April 4, 2018 at 5:00:12 PM UTC+5:30, Sebastien Binet wrote:
>>
>> Hi,
>>
>> You just have to type-switch on the ssa.Instruction value.
>>
>> hth,
>> -s
>>
>> sent from my droid
>>
>> On Wed, Apr 4, 2018, 13:21 Arpit Aggarwal  wrote:
>>
>>> Hi everybody,
>>>
>>> I am using Go SSA for analysis purposes in my project.
>>>
>>> The BasicBlock type in Go ssa contains Instrs[] of type []Instruction.
>>> But Instruction type is not able to tell me which type of instruction is
>>> it (BinOp, Unop etc). There is no function if Instruction interface which
>>> can tell me about the type of instruction
>>> Is there a way to retriece that information.
>>>
>>> Thanks in advance
>>> Arpit
>>>
>>> --
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 more options, visit https://groups.google.com/d/optout.
>

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go ssa instruction type

2018-04-04 Thread Sebastien Binet
Arpit,


On Wed, Apr 4, 2018 at 1:40 PM, Arpit Aggarwal 
wrote:

> Thank you very much Sebastien,
> this is very helpful. I didn't know about the type switches.
> Also do you know anything by which i can simply print the type rather than
> adding a case for every type.
>

fmt.Printf("instruction= %T\n", instr)

should do.
hth,
-s

>
>
> On Wednesday, April 4, 2018 at 5:00:12 PM UTC+5:30, Sebastien Binet wrote:
>>
>> Hi,
>>
>> You just have to type-switch on the ssa.Instruction value.
>>
>> hth,
>> -s
>>
>> sent from my droid
>>
>> On Wed, Apr 4, 2018, 13:21 Arpit Aggarwal  wrote:
>>
>>> Hi everybody,
>>>
>>> I am using Go SSA for analysis purposes in my project.
>>>
>>> The BasicBlock type in Go ssa contains Instrs[] of type []Instruction.
>>> But Instruction type is not able to tell me which type of instruction is
>>> it (BinOp, Unop etc). There is no function if Instruction interface which
>>> can tell me about the type of instruction
>>> Is there a way to retriece that information.
>>>
>>> Thanks in advance
>>> Arpit
>>>
>>> --
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 more options, visit https://groups.google.com/d/optout.
>

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go ssa instruction type

2018-04-04 Thread Arpit Aggarwal
Got it using reflect package.

Still thanks a lot buddy.


On Wednesday, April 4, 2018 at 5:10:01 PM UTC+5:30, Arpit Aggarwal wrote:
>
> Thank you very much Sebastien,
> this is very helpful. I didn't know about the type switches.
> Also do you know anything by which i can simply print the type rather than 
> adding a case for every type.
>  
>
> On Wednesday, April 4, 2018 at 5:00:12 PM UTC+5:30, Sebastien Binet wrote:
>>
>> Hi,
>>
>> You just have to type-switch on the ssa.Instruction value.
>>
>> hth,
>> -s
>>
>> sent from my droid
>>
>> On Wed, Apr 4, 2018, 13:21 Arpit Aggarwal  wrote:
>>
>>> Hi everybody,
>>>
>>> I am using Go SSA for analysis purposes in my project.
>>>
>>> The BasicBlock type in Go ssa contains Instrs[] of type []Instruction. 
>>> But Instruction type is not able to tell me which type of instruction is 
>>> it (BinOp, Unop etc). There is no function if Instruction interface which 
>>> can tell me about the type of instruction
>>> Is there a way to retriece that information.
>>>
>>> Thanks in advance
>>> Arpit
>>>
>>> -- 
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go ssa instruction type

2018-04-04 Thread Arpit Aggarwal
Thank you very much Sebastien,
this is very helpful. I didn't know about the type switches.
Also do you know anything by which i can simply print the type rather than 
adding a case for every type.
 

On Wednesday, April 4, 2018 at 5:00:12 PM UTC+5:30, Sebastien Binet wrote:
>
> Hi,
>
> You just have to type-switch on the ssa.Instruction value.
>
> hth,
> -s
>
> sent from my droid
>
> On Wed, Apr 4, 2018, 13:21 Arpit Aggarwal  > wrote:
>
>> Hi everybody,
>>
>> I am using Go SSA for analysis purposes in my project.
>>
>> The BasicBlock type in Go ssa contains Instrs[] of type []Instruction. 
>> But Instruction type is not able to tell me which type of instruction is 
>> it (BinOp, Unop etc). There is no function if Instruction interface which 
>> can tell me about the type of instruction
>> Is there a way to retriece that information.
>>
>> Thanks in advance
>> Arpit
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Go ssa instruction type

2018-04-04 Thread Sebastien Binet
Hi,

You just have to type-switch on the ssa.Instruction value.

hth,
-s

sent from my droid

On Wed, Apr 4, 2018, 13:21 Arpit Aggarwal  wrote:

> Hi everybody,
>
> I am using Go SSA for analysis purposes in my project.
>
> The BasicBlock type in Go ssa contains Instrs[] of type []Instruction.
> But Instruction type is not able to tell me which type of instruction is
> it (BinOp, Unop etc). There is no function if Instruction interface which
> can tell me about the type of instruction
> Is there a way to retriece that information.
>
> Thanks in advance
> Arpit
>
> --
> 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 more options, visit https://groups.google.com/d/optout.
>

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Go ssa instruction type

2018-04-04 Thread Arpit Aggarwal
Hi everybody,

I am using Go SSA for analysis purposes in my project.

The BasicBlock type in Go ssa contains Instrs[] of type []Instruction. 
But Instruction type is not able to tell me which type of instruction is it 
(BinOp, Unop etc). There is no function if Instruction interface which can 
tell me about the type of instruction
Is there a way to retriece that information.

Thanks in advance
Arpit

-- 
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 more options, visit https://groups.google.com/d/optout.


[go-nuts] Is there a build option to only consider the vendor folder for imports?

2018-04-04 Thread roarker
Hello,

In an effort to make sure code that builds on my local machine will build 
on our build machine, I am looking for a build option to force the compiler 
to only look for imported code in the vendor directory & pkg. Often I will 
have worked on a project in my local go workspace means it is in the src 
directory but have forgotten to add the dependency to the vendor directory, 
and it will still build. I would like to avoid developing using the 
container image used in the build machine.

Best,

Roarke

-- 
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 more options, visit https://groups.google.com/d/optout.