Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-05 Thread Peter Waller
On 31 January 2018 at 16:23, roger peppe wrote: > BTW you can already do something like this: > https://play.golang.org/p/q4bz8-AckN3 Neat trick! > You can even do it without reflect, which I'll leave as an exercise for > the reader :) I'll bite, does it involve struct { len int; content [m

Re: [go-nuts] Re: Any plans to add ASN.1 PER support?

2018-02-05 Thread David Wahlstedt
Thanks! Den lördag 27 januari 2018 kl. 20:02:18 UTC+1 skrev Matt Harden: > > It isn't something that is likely to be added to the stdlib. If anything, > a library like https://github.com/Logicalis/asn1 might be interested in > supporting it / accepting a pull request to add it. > > On Fri, Jan 1

[go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-05 Thread Egon
I recommend re-writing them using real-world examples, where they really are the "best solution", rather than a facilitated example. Often beginners learn from such facilitated examples and end-up misusing and getting the wrong idea about them. Using realistic examples helps to avoid those prob

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-05 Thread roger peppe
On 5 February 2018 at 08:36, Peter Waller wrote: > On 31 January 2018 at 16:23, roger peppe wrote: >> >> BTW you can already do something like this: >> https://play.golang.org/p/q4bz8-AckN3 > > > Neat trick! > >> >> You can even do it without reflect, which I'll leave as an exercise for >> the re

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-05 Thread Peter Waller
On 5 February 2018 at 11:04, roger peppe wrote: > > I'll bite, does it involve struct { len int; content [maxCount]int }, or > did > > you have something else in mind? > > Something else. No size limit. Not what one might call efficient though. :) > [low growling] (ok, so I've been watching Str

Re: [go-nuts] Re: GOTCHA: Just when you think you understand interfaces

2018-02-05 Thread Chris Hopkins
Well, the first allows one Less per package, the second allows one per type. Since I tend to have multiple types in a package I find that more readable. Anyway, I finally fixed the problem with mixture of reflect and type assertion val := reflect.ValueOf(b) if val.Kind() == reflect.

[go-nuts] comparing empty interface values?

2018-02-05 Thread l vic
Working on the package that should handle multiple data types. I started with using empty interfaces but got stuck when it come to comparing empty interface values, seems it's possible to get empty interface type, but not value Is there a working pattern to use in this case, aside of using reflec

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-02-05 Thread Aliaksandr Valialkin
On Tuesday, January 30, 2018 at 12:43:38 AM UTC+2, Sina Siadat wrote: > > Hi Sebastien, > > ​Thanks for your comment and question :) > > > I have one "drive-by-comment" and a question: > > you could have perhaps used gonum for the stats stuff :) > > ​Actually, I did start with gonum :)) but I tho

Re: [go-nuts] comparing empty interface values?

2018-02-05 Thread Jan Mercl
On Mon, Feb 5, 2018 at 1:48 PM l vic wrote: > Working on the package that should handle multiple data types. I started with using empty interfaces Probably not a good idea. > but got stuck when it come to comparing empty interface values, seems it's possible to get empty interface type, but not

Re: [go-nuts] comparing empty interface values?

2018-02-05 Thread l vic
I have problem with "<" ">", like in example below invalid operation: j < i (operator < not defined on interface) var i interface{} var j interface{} i = 2 j = 3 if j == i { fmt.Println("correct") } On Mon, Feb 5, 2018 at 7:58 AM, Jan Mercl <0xj...@gmail.com> wrote: > On Mon

[go-nuts] Re: [ANN] rsrc - Tool for embedding Windows executable manifests in Go programs.

2018-02-05 Thread manish . webref
On Monday, December 9, 2013 at 8:31:32 PM UTC+5:30, salvor...@gmail.com wrote: > > On Sunday, December 8, 2013 5:55:28 PM UTC-6, Mateusz Czapliński wrote: >> >> rsrc - Tool for embedding Windows executable manifests in Go programs. >> >> INSTALL: go get github.com/akavel/rsrc >> >> USAGE: rsrc.e

[go-nuts] Re: [ANN] rsrc - Tool for embedding Windows executable manifests in Go programs.

2018-02-05 Thread manish . webref
Hi guys I was done this all process but side-by-side configuration error occurring. -- 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...@goog

[go-nuts] Re: Extensive Go resources for CS101

2018-02-05 Thread Looserof7
Thank you. -- 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: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-05 Thread matthewjuran
They haven’t seemed necessary in small application development. I'll monitor for real-world examples. There's a few repositories for Go design patterns: https://github.com/tmrts/go-patterns https://github.com/monochromegane/go_design_pattern https://github.com/yksz/go-design-patterns But they

Re: [go-nuts] Re: GOTCHA: Just when you think you understand interfaces

2018-02-05 Thread 'Axel Wagner' via golang-nuts
On Mon, Feb 5, 2018 at 1:13 PM, Chris Hopkins wrote: > Well, the first allows one Less per package, the second allows one per > type. > No, the first allows an arbitrary number of Less' per package or type and the second one allows one per type. You can call a function LessByName, LessByID, Less

[go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-05 Thread 'Eric Johnson' via golang-nuts
An interesting idea. Some thoughts On Friday, February 2, 2018 at 9:03:54 AM UTC-8, matthe...@gmail.com wrote: > > I’m looking at patterns summarized on Wikipedia from “Design Patterns: > Elements of Reusable Object-Oriented Software” and writing out a few as the > equivalent in Go. > > Visi

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-05 Thread roger peppe
On 5 February 2018 at 11:38, Peter Waller wrote: > On 5 February 2018 at 11:04, roger peppe wrote: >> >> > I'll bite, does it involve struct { len int; content [maxCount]int }, or >> > did >> > you have something else in mind? >> >> Something else. No size limit. Not what one might call efficient

[go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread theckman via golang-nuts
Hey Gophers, I've run in to an interesting case regarding Method Sets that makes me wonder whether it should be disallowed by the spec[1]. Before opening an issue on GitHub I thought I'd reach out here to get some clarifications as I may be misreading the spec. Based on my understanding of met

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread Paul Jolly
Hi Tim, Take a look at https://golang.org/ref/spec#Calls: "A method call x.m() is valid if the method set of (the type of) x contains m and the argument list can be assigned to the parameter list of m. If x is addressable and &x's method set contains m, x.m() is shorthand for (&x).m()" Paul On

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread Burak Serdar
On Mon, Feb 5, 2018 at 10:42 AM, theckman via golang-nuts wrote: > Hey Gophers, > > I've run in to an interesting case regarding Method Sets that makes me > wonder whether it should be disallowed by the spec[1]. Before opening an > issue on GitHub I thought I'd reach out here to get some clarifica

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread theckman via golang-nuts
Yep, this is exactly it. I missed this section when I was trying to figure this out. Thank you! -Tim On Monday, February 5, 2018 at 11:53:32 AM UTC-8, Paul Jolly wrote: > > Hi Tim, > > Take a look at https://golang.org/ref/spec#Calls: > > "A method call x.m() is valid if the method set of (the

[go-nuts] Global variable initialized in init() not working in main()

2018-02-05 Thread mbrizic
I'm initializing a Logger variable in an init() function and then attempting to use in the main() function. However, I'm able to Printf from the Logger in the init() function but not inside the main() function. Any help would be appreciated. package main import ( "fmt" "log" "io"

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread gtownsend
This issue once puzzled me, too. It would help to add something to the spec section on method sets . I suggest something like this at the very end of the second paragraph: ... Additionally, if a receiver of type T is *addressable

Re: [go-nuts] Global variable initialized in init() not working in main()

2018-02-05 Thread 'Thomas Bushnell, BSG' via golang-nuts
Your init is closing the file before returning, so at that point all the writes are failing. If you check the error you receive from logger.Print you should see something to that effect. Thomas On Mon, Feb 5, 2018 at 1:39 PM wrote: > I'm initializing a Logger variable in an init() function and

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread 'Axel Wagner' via golang-nuts
That sentence wouldn't be true, though. There is a call-expression shorthand, but the method does not actually get added to T - so, for example var b bytes.Buffer b.WriteString("foo") // fine (&b).WriteString("foo") // the same, as it's just syntactic sugare r := strings.NewReader("foo") io.Copy(b

Re: [go-nuts] Global variable initialized in init() not working in main()

2018-02-05 Thread Michael Brizic
Thank you, missed that, didn't fully understand the nature of *defer*, but now I do! On Monday, February 5, 2018 at 3:42:10 PM UTC-6, Thomas Bushnell, BSG wrote: > > Your init is closing the file before returning, so at that point all the > writes are failing. If you check the error you receive

[go-nuts] gomobile - SIGPIPE

2018-02-05 Thread mihai
I'm trying to develop a gomobile application using a http server serving html and a swift client serving the content from localhost through a WKWebView. All the work happens inside the http handlers(i.e. http requests to external API servers). The issue is that after several requests the appl

[go-nuts] gobot and raspberry pi

2018-02-05 Thread JM
anyone know where i would begin to figure out if i can use this: https://www.robotshop.com/uk/arducam-multi-camera-adapter-module-raspberry-pi.html on a pi with gobot? I cant find any api or reference on how to use it, let alone anything for golang. on want to run multiple cameras to take differ

[go-nuts] About golang.org/x/net/prox and cancellation

2018-02-05 Thread Juliusz Chroboczek
Hi, I'm using golang.org/x/net/proxy, and I've run into an issue: there appears to be no way to cancel a (*proxy.Dialer).Dial in progress -- unlike net.Dialer, there is no DialContext method for proxy.Dialer. Any idea for a workaround? (By the way, since net.Dial is a struct, not an interface, m

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-05 Thread gtownsend
You're right. I do think expanding the section on method sets is worthwhile because that section *seems* to have the complete set of rules. But any addition needs to be clear, concise *and* correct. How about: ... Additionally, an addressable v

[go-nuts] Re: gomobile - SIGPIPE

2018-02-05 Thread Elias Naur
It's hard to know what's causing the SIGPIPE without more information. Ideally, a standalone recipe to reproduce the problem. Make sure you have the latest version of gomobile as well. - elias On Monday, February 5, 2018 at 10:53:09 PM UTC+1, mi...@ubo.ro wrote: > > I'm trying to develop a gom