Re: [go-nuts] CPU fairness in goroutine scheuding

2016-06-17 Thread Sam Whited
nction calls in a loop in the blowfish block cipher: http://bl.ocks.org/SamWhited/ebe4f5923526c0d9220f1b5b23b56eba —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 https://blog.samwhited.com -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] TLS

2016-06-27 Thread Sam Whited
; wrote: > Mybe you have simple sample for my ? > Server and client initialization. If you look at the documentation for the tls.Dial method (https://godoc.org/crypto/tls#Dial) there is an "Example" link just below the method description. —Sam -- Sam Whited pub 4096R/54083AE104EA

Re: [go-nuts] Is there a way to implement this C macro in Go?

2016-07-22 Thread Sam Whited
what you want: https://godoc.org/fmt#hdr-Printing —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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-n

Re: [go-nuts] ioutil.WriteFile and Sync

2016-07-21 Thread Sam Whited
get written (or your network gets flushed, or whatever the case may be), and it will be able to optimize under the hood, make the best utilization of its file cache, and generally do all the good things it wants to do for you. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received thi

Re: [go-nuts] Best practice for sets in go?

2016-07-26 Thread Sam Whited
ut even so one or two extra bytes of code (`_, ok = m[key]; ok') seems like a small price to pay for safety guarantees and to save a few bytes of memory. (though as you said, it hardly matters either way; I just prefer to recommend the struct{} version to new people) —Sam -- Sam Whited pu

Re: [go-nuts] Is it weird?

2016-07-25 Thread Sam Whited
On Mon, Jul 25, 2016 at 11:05 AM, T L wrote: > Then why > > T{...} > > can't be a syntactic sugar for > > tmp := T{...} > tmp > > and tmp is an okay receiver. > :P It is (effectively); that works just fine: https://play.golang.org/p/SF2lznWaRj eg.

Re: [go-nuts] Is it weird?

2016-07-25 Thread Sam Whited
On Mon, Jul 25, 2016 at 11:23 AM, T L wrote: > It doesn't work. The receiver should be a pointer in function definition. > > https://play.golang.org/p/fQbbeDhB9O Oh I see, I misunderstood. If the receiver is a pointer it's probably so that you can modify the value, but in

Re: [go-nuts] golang non-availability in Iran...

2016-08-02 Thread Sam Whited
tooling and infrastructure still under the control of Google in the US)? I was under the impression that several other large companies were doing this with their crypto, but I can't find any reference to it at the moment and I'm sure the lawyers would fight it either way. —Sam -- Sam Whited pub 4

[go-nuts] Thoughts on a SASL API design

2016-07-19 Thread Sam Whited
Hi all, I'm working on an implementation of RFC 4422, the SASL authentication mechanism. The idea is to make using common SASL mechanisms (PLAIN, SCRAM-whatever) easy, but also to provide a framework for people to build their own SASL mechanisms that will be compatible with anything that uses the

Re: [go-nuts] goimports has been updated

2016-07-15 Thread Sam Whited
s, otherwise you can't skip submodules and subtree merges and the like (external code where you don't have the ability to add a .goimportsignore file). —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "g

Re: [go-nuts] Plurality of package naming

2016-07-12 Thread Sam Whited
On Tue, Jul 12, 2016 at 9:19 AM, Rayland wrote: > When does it make sense for a package to be named in plural? For example, > I'm currently working on a MVC framework and for me it makes sense to have a > "controller" package as opposed to "controllers", but I saw that Beego

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-05 Thread Sam Whited
't follow this; the library *doesn't* have any vendor/ dir, nor do any of the other things the application has vendored. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 https://blog.samwhited.com -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-05 Thread Sam Whited
t jap/vendor). The library was doing the correct thing and not vendoring. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-05 Thread Sam Whited
that actually implements the commands is part of the contract, vendoring it seems like a bad idea. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] Vendored trace package causes panic because of implicit handlers

2016-07-05 Thread Sam Whited
> using the same import path by all the packages that need it. Not doing this > is probably the most common cause of having multiple copies of a package > linked in to your binary. The import path is the same, it's always "golang.org/x/net/trace". —Sam -- Sam Whited pu

Re: [go-nuts] Initialize Variables in case clause of a switch

2016-08-05 Thread Sam Whited
p of my head though. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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

Re: [go-nuts] GIMP plugins written in pure Go

2016-07-01 Thread Sam Whited
GC sometime down the road). I'm a big fan of Go, but this isn't a use case I'd think it would be great for, but maybe if you're just manipulating one or two images at a time it's not that big of a deal. Keep us posted! —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message

Re: [go-nuts] GIMP plugins written in pure Go

2016-07-01 Thread Sam Whited
On Fri, Jul 1, 2016 at 2:29 PM, Ian Lance Taylor wrote: > Current release of Go have a concurrent collector that does almost all > of its work in parallel with your application. If your application is > allocating a lot of memory quickly, the collector works harder. I > don't

Re: [go-nuts] example in errors package documentation

2016-08-22 Thread Sam Whited
e_test.go —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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

[go-nuts] Extra bytes in Gob format

2017-02-27 Thread Sam Whited
Hi all, I'm writing an implementation of the Gob serialization format in another language, but am seeing some extra bytes that, as far as I can tell, aren't described in the documentation. For example, if I encode a simple bool (https://play.golang.org/p/shFJnM3WgM) I get: > 03 02 00 01 I

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Sam Whited
On Tue, Feb 28, 2017 at 1:04 AM, Rob Pike wrote: > For a single object, not a struct, it still gets sent as a struct with one > field. The 0 is the marker after the last (only) field is sent. Thanks; that makes sense. So it fits in the grammar description by virtue of being part

Re: [go-nuts] Extra bytes in Gob format

2017-02-28 Thread Sam Whited
On Tue, Feb 28, 2017 at 11:49 AM, Axel Wagner wrote: > FYI, this looks very similar to this issue I filed a while back: > https://github.com/golang/go/issues/16978 Looks like there's nothing to do here (except the actual work to update the docs); thanks Axel! —Sam

Re: [go-nuts] tool to print dependency graph of /vendor libs

2016-09-02 Thread Sam Whited
eones presentation without proper attribution): % ( echo "digraph G {"; \ % go list -f '{{range .Imports}}{{printf "\t%q -> %q;\n" \ % $.ImportPath .}}{{end}}' \ % $(go list -f '{{join .Deps " "}}' YOURPACKAGE) YOURPACKAGE; \ % echo &q

Re: [go-nuts] compile vs stylistic errors

2016-09-05 Thread Sam Whited
e Go authors and the community have opinions, but those opinions aren't held by everyone and some people may not want to use gofmt. Why force them too when most people will use it willingly? —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed t

Re: [go-nuts] interactive debugger for go ??

2016-09-06 Thread Sam Whited
a full time go dev > right now, but use it part time so I may just not know about this. It's not Go specific, and therefore will have some issues (especially when you start getting into highly concurrent programs), but GDB works well enough for me in most cases: https://www.gnu.org/software/gd

Re: [go-nuts] time.Time vs time.Instant

2016-09-21 Thread Sam Whited
me that has a timezone at that (aka, just a duration that we've made some arbitrary assumptions about, which you could do with the existing duration implementation). —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Timeout using Select from "Go Design Pattern"

2016-09-23 Thread Sam Whited
this case means trying again because it's in an infinite loop). —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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, sen

Re: [go-nuts] Timeout using Select from "Go Design Pattern"

2016-09-23 Thread Sam Whited
On Fri, Sep 23, 2016 at 9:13 AM, Sam Whited <s...@samwhited.com> wrote: > The time.After channel isn't garbage collected until after the function > returns (when > it goes out of scope). I'm sorry, I just re-read my original email and it was very confusing; in the current

Re: [go-nuts] Timeout using Select from "Go Design Pattern"

2016-09-23 Thread Sam Whited
select { > case s := <-c: > fmt.Println(s) > case <-t: > fmt.Println("You're too slow.") > return > } > } —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are sub

Re: [go-nuts] Go beginner asks for code review

2016-09-22 Thread Sam Whited
he Go community, and congrats on your first big project! I'm sure you'll get lots of feedback, and please, continue to ask questions and avail yourself of this list, it's a great resource if you're just starting out. Best, Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this mess

Re: [go-nuts] Go beginner asks for code review

2016-09-22 Thread Sam Whited
g each of the "special" paragraph types. if p.parseHeading() { return true } if p.parseBulletedParagraph() { return true } some people prefer to write long chains of I -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Gro

Re: [go-nuts] What's current status of the crypto/des package (performance-wise)?

2016-08-27 Thread Sam Whited
es are, you're better off just using a different implementation that is optimized for performance. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] labeled loop vs for statement inlining

2016-08-29 Thread Sam Whited
quot;for" in them apparently can't be inlined) —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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 a

Re: [go-nuts] Why does context.CancelFunc exist?

2016-08-25 Thread Sam Whited
t don't? Glancing at the source there's no reason it needs to be. Probably just because it was done this way originally, and it stuck around. —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: text/scanner: scan() vs peek()

2016-08-25 Thread Sam Whited
On Thu, Aug 25, 2016 at 2:09 PM, DrGo wrote: > Ok! So my original post was not clear. Let us say you just executed scan() > twice on this string: a= x > As expected, Scan() returned scanner.Ident for a, followed by a rune > indicating the = sign. > Now, peek() will

Re: [go-nuts] text/scanner: scan() vs peek()

2016-08-25 Thread Sam Whited
ut advancing the scanner. Are you confusing text/scanner (which operates on UTF-8 strings and returns runes) and bufio's Scanner (which is an "interface for reading data such as a file of newline-delimited lines of text")? —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received th

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
I should also state that in this example you could of course just use MarshalIndent, the point was to show that you could do it manually if you need more customized formatting. On Sat, Nov 5, 2016 at 11:13 AM, Sam Whited <s...@samwhited.com> wrote: > On Sat, Nov 5, 2016 at 10:57 AM,

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
encoder: https://play.golang.org/p/dVJjYvdHpS —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- 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+uns

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
ne of the things I wanted something like this for in the first place). —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fr

Re: [go-nuts] Beautify XML

2016-11-05 Thread Sam Whited
is simple example (most of the error handling was ignored here, obviously that would not be ideal in a real implementation): https://play.golang.org/p/cBiUv0Xl1k —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Google Groups "gola

Re: [go-nuts] Re: XML Beautifier that doesn't rewrite the document

2016-11-05 Thread Sam Whited
kage won't be able to do it either (see https://github.com/golang/go/issues/13400 and the many other open bugs about the issues). It's just not properly supported. Good luck! Best, Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 -- You received this message because you are subscribed to the Goog

Re: [go-nuts] XML Stream Parser examples

2017-04-05 Thread Sam Whited
On Wed, Apr 5, 2017 at 6:44 PM, Mandolyte wrote: > I need to parse to find a known element, then based on what I find, decode > its children elements. This implies I need to treat the child elements as a > document (may have to add a fake root node, unless the decoder accepts

Re: [go-nuts] what's the max length of an identifier

2017-04-10 Thread Sam Whited
On Sun, Apr 9, 2017 at 5:49 PM, Rob Pike wrote: > To answer your question about creat, ken named it. Why does no one ask about > aretu? I'll bite: what's up with aretu? —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: No Allman-Style, No go!

2017-03-09 Thread Sam Whited
> No Allman-Style, No go! It's worth noting that the difference between tabs and spaces is cosmetic and you're right, your editor could handle that for you, but Allman-style is more complex. Having opening braces on the same line is a matter of *syntax* in Go, not style; if you were to write the

Re: [go-nuts] Re: API patterns for a function with a single argument that is rarely needed

2017-07-07 Thread Sam Whited
On Fri, Jul 7, 2017 at 12:05 PM, peterGo wrote: > Good naming is such a key part of a good API that the use of sterile names > like Foo and Bar during design is doomed to failure. It sure is; my function is not of course actually named "Foo", I just didn't want people to

Re: [go-nuts] Are functional options idiomatic

2017-07-09 Thread Sam Whited
On Sun, Jul 9, 2017 at 2:05 PM, 'Anmol Sethi' via golang-nuts wrote: > I haven’t seen this API design used anywhere at all in any library I have > ever used (or in the standard library at all) so I was wondering whether or > not it’s idiomatic. It's used heavily in

Re: [go-nuts] Re: API patterns for a function with a single argument that is rarely needed

2017-07-07 Thread Sam Whited
On Fri, Jul 7, 2017 at 12:05 PM, peterGo wrote: > Perhaps it's like packages fmt and log: a default output and a user defined > output. For example fmt.Print, fmt.Fprint. I'm starting to think I'm overthinking this (no idea why I'm hung up on this one particular weird API

Re: [go-nuts] justforfunc: a Go YouTube series

2017-07-11 Thread Sam Whited
On Mon, Jul 10, 2017 at 7:07 PM, Francesc Campoy Flores wrote: > Sorry to spam you, but I'll do it only once! Today I published the episode 15 > of a YouTube series I've been working on for a while. Thanks Francesc, Spam away I say! Your videos are always a treat, I wanted

Re: [go-nuts] Re: API patterns for a function with a single argument that is rarely needed

2017-07-07 Thread Sam Whited
On Fri, Jul 7, 2017 at 10:24 PM, Dave Cheney wrote: > Iff there is only one possible option and it's only used infrequently, I'd be > inclined to try something like this > > // Foo returns a new Bar > func Foo() Bar > > // FooWithQuxx returns a new Bar using the underlying Quxx

Re: [go-nuts] Re: API patterns for a function with a single argument that is rarely needed

2017-07-08 Thread Sam Whited
On Sat, Jul 8, 2017 at 4:41 PM, Rob Pike wrote: > From https://talks.golang.org/2012/splash.article: > > … Thanks; I feel much more comfortable with that design having some literature (as well as the voices of several community members in this thread) to back it up. I'm suprised

[go-nuts] API patterns for a function with a single argument that is rarely needed

2017-07-07 Thread Sam Whited
Hi all, I have an API that I'm not satisfied with and wanted to see what others do. I have a function in my API, the details don't really matter so let's call it Foo and say it returns type Bar (the return type we can't mess with): Foo() Bar Most of the time we have all the information we

Re: [go-nuts] Re: golang-codereview - purpose

2017-07-22 Thread Sam Whited
On Sat, Jul 22, 2017, at 20:59, Ulderico Cirello wrote: > Just confirming, you read all of it? I do not read every single comment and try-bot-starting message on every single CL, but I at least look at what CLs are being proposed. So I more or less read the first message in every thread. —Sam

Re: [go-nuts] golang-codereview - purpose

2017-07-22 Thread Sam Whited
On Sat, Jul 22, 2017, at 18:42, Ulderico Cirello wrote: > Does anyone here really read it? Or just a subset of it? if so, how do > you manage it? I read it (or skim the subject lines anyways); it's nice to know what changes people are submitting. I also filter for a few specific things that I'd

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Fri, Jun 30, 2017 at 10:23 PM, Manohar Reddy wrote: > `iota` is golnag's enum. I've seen this code in Wikipedia. But I did not > understand it. Can someone please explain this code? This is slightly nitpicky since many languages don't use enums for much more than what

Re: [go-nuts] Explain the meaning of iota

2017-07-02 Thread Sam Whited
On Sun, Jul 2, 2017 at 4:34 PM, Sam Whited <s...@samwhited.com> wrote: > This means that the code you pasted is the same as if you'd written: > > type ByteSize float64 > > const ( > _ = 0 // ignore first value by assigning to blank identifier &

Re: [go-nuts] Re: Recover considered harmful

2017-04-26 Thread Sam Whited
On Wed, Apr 26, 2017 at 10:47 AM, Юрий Соколов wrote: > You are not quite right. Sometimes there is scope dependency between Lock > and Unlock, ie Unlock happens not at function exit, but is triggered > asynchronously by some condition. If you can stomach the overhead of

Re: [go-nuts] Recover considered harmful

2017-04-24 Thread Sam Whited
On Mon, Apr 24, 2017 at 7:39 AM, Kevin Conway wrote: > I've yet to find a panic that would not be better served as a returned > error. While I generally agree with you, panics in libraries should probably not bubble up to anythihng outside of the library, the

Re: [go-nuts] Recover considered harmful

2017-04-24 Thread Sam Whited
On Mon, Apr 24, 2017 at 9:30 AM, Юрий Соколов wrote: > :-) > Does os.Exit(1) prints backtrace of all goroutines like unrecovered panic > does? import "runtime/debug" fmt.Fprintf(os.Stderr, "it's full of stars!\n") debug.PrintStack() os.Exit(1) -- You

Re: [go-nuts] Recover considered harmful

2017-04-24 Thread Sam Whited
On Mon, Apr 24, 2017 at 6:31 PM, Dan Kortschak wrote: > We (gonum) would extend the security exception to include scientific > code; there are far too many peer reviewed works that depend on code > that will blithely continue after an error condition that should

Re: [go-nuts] Re: [Blog] Context should go away for Go 2

2017-08-08 Thread Sam Whited
On Mon, Aug 7, 2017, at 11:33, Uli Kunitz wrote: > I assume here that the proposal is not to change io.Reader but to … There is no proposal. This was briefly discussed in the contributors summit, but the underlying issues are not necessarily well understood. Blog posts like this one help us all

Re: [go-nuts] Go 1.9 Beta 1 is released

2017-06-21 Thread Sam Whited
gt; Video: > https://www.youtube.com/watch?v=4Dr8FXs9aJM > > > -- > 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+uns

Re: [go-nuts] understanding utf-8 for a newbie

2017-05-07 Thread Sam Whited
On Sun, May 7, 2017 at 9:44 AM, rob solomon wrote: > I now understand that the bytes may be different. It's also worth noting that when Ken Thompson and Rob Pike (yes, the same Rob Pike and Ken Thompson that created Go) created UTF-8, they made sure it was backwards

Re: [go-nuts] understanding utf-8 for a newbie

2017-05-06 Thread Sam Whited
On Fri, May 5, 2017 at 8:11 PM, rob solomon wrote: > I decided to first change ", ' and emdash characters. Using hexdump -C in > Ubuntu, the runes in the file are: > > open quote = 0xE2809C > > close quote = 0xE2809D > > apostrophe = 0xE28099 > > emdash = 0xE28094 The

Re: [go-nuts] Re: understanding utf-8 for a newbie

2017-05-06 Thread Sam Whited
On Sat, May 6, 2017 at 7:40 PM, peterGo wrote: > Corrected, corrected link. I will get it right eventually! > > For UTF-8 to CP1252: https://play.golang.org/p/vzupJY78XB FWIW, if you do need CP1252 (you probably don't) it already exists in Go-land as one of the encodings

Re: [go-nuts] Choosing a framework

2017-09-12 Thread Sam Whited
Here is a list of useful components that I sometimes reach for when I need to do something in HTTP land that requires that I leave the comfort and safety of the standard library but don't want to get locked into a "framework". There may be better implementations of some of these, but the ones

Re: [go-nuts] XML unmarshaller cannot handle space padded numbers

2017-09-29 Thread Sam Whited
On Fri, Sep 29, 2017, at 10:00, Per Persson wrote: > I made a commit > > > that I was about to make into a pull request, but then I saw the > contribution information and now I'm not sure where to propose the >

Re: [go-nuts] Re: Golang 1.9 failing with excelize (simple case works under 1.8.3)

2017-08-29 Thread Sam Whited
On Mon, Aug 28, 2017, at 22:59, silviucap...@gmail.com wrote: > Interesting... For this portion of code: > > https://github.com/360EntSecGroup-Skylar/excelize/blob/master/rows.go#L76-L85 > > The xml decoder returns row and col token types for 1.8.3 but rushes > into > an EOF for 1.9 In Go 1.8

Re: [go-nuts] Help, using fmt.Sprint

2017-09-01 Thread Sam Whited
On Fri, Sep 1, 2017, at 10:00, Tong Sun wrote: > For normal Go way, should I name the string function `*String*()` or ` > *ToString*()`? If you want your type to satisfy the `fmt.Stringer' interface (https://godoc.org/fmt#Stringer) the method should be named `String'. —Sam -- You received

Re: [go-nuts] Sanitising a UTF-8 string

2017-10-22 Thread Sam Whited
On Sun, Oct 22, 2017, at 09:29, Juliusz Chroboczek wrote: > I'm probably missing something obvious, but I've looked through the > standard library to no avail. How do I sanitise a []byte to make sure > it's a UTF-8 string by replacing all incorrect sequences by the > replacement character (or

Re: [go-nuts] Re: Would someone care to compare Firefox Quantum Rust concurrency features to Go....

2017-11-25 Thread Sam Whited
On Fri, Nov 24, 2017, at 21:33, Dave Cheney wrote: > > In Rust a thread has its own memory space and hence a thread cannot > > reference data by reference of some other thread. > > How is this accomplished? Is there a prohibition against passing a > borrowed reference between threads? In

[go-nuts] Easy access to #golang

2017-11-17 Thread Sam Whited
Hi all, I don't like signing up for accounts, or having to jump through hoops (even if they're relatively straight forward hoops) to get an invite to something that should just be public. Also, some people seem to like web clients, so here's a quick and easy way to access the #golang channel on

Re: [go-nuts] XML Pretty Print

2017-12-11 Thread Sam Whited
On Mon, Dec 11, 2017, at 09:12, Mandolyte wrote: > At my previous company I had a Go program that would take any XML > document > and output it as XML in a nicer human readable format, i.e., pretty > printed. I've trying to find it again, but my searches have not turned up > any. Perhaps I had

Re: [go-nuts] [Question] database/sql

2018-02-08 Thread Sam Whited
On Thu, Feb 8, 2018, at 07:28, Mandolyte wrote: > I'd like to use the same program against multiple databases and set the > driver by configuration. But since the driver is in the source code, I > don't see a way to do that. > > In other words, I don't want to include this in my code: > > >

Re: [go-nuts] What's the best way to maintain a package repository that have the major version in the import path?

2018-02-21 Thread Sam Whited
On Wed, Feb 21, 2018, at 22:35, alex.rou...@gmail.com wrote: > vgo suggested that package developers put the major version into the import > path e.g. foo/v1. > However dealing with a VCS like git, this thought occur to me, what would > it look like when the project needs to move from v1 to v2?

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Sam Whited
On Wed, Feb 21, 2018, at 13:49, Peter Bourgon wrote: > > If not, do I maintain separate /v2 and /v3 trees in my directory and > > copy/paste changes between them when I want to release security fixes as a > > point release? > > Yes, this is what vgo expects. This (and the other alternatives)

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Sam Whited
On Wed, Feb 21, 2018, at 14:57, Russ Cox wrote: > My plan is that this is in one of tomorrows' post. Sorry for seeming like > I'm withholding information. I'm posting as they are finished. :-) Sounds good, I look forward to reading it and continuing to digest the proposal. I've had a hard time

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Sam Whited
will be very difficult)? Do I maintain separate repos and cherry pick or copy/paste files between them? None of these sound especially appealing except perhapse having a server handle it for me, but this makes hosting my own packages harder. —Sam -- Sam Whited s...@samwhited.com -- You received

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Sam Whited
On Wed, Feb 21, 2018, at 14:46, Henrik Johansson wrote: > But wait. Wasn't there a mention of archive downloads instead of relying on > the different VCS's? > > In the GitHub case I guess it amount to downloading releases (or any commit > I guess) as a zip or tarball. My understanding was that

Re: [go-nuts] Re: Go += Package Versioning

2018-02-24 Thread Sam Whited
On Sat, Feb 24, 2018, at 21:44, Sean Russell wrote: > I'm working on adding support for Bitbucket, per your comment in #23950 > . I'm struggling a bit with > executing the tests in x/vgo -- should I expect vgo test to work? I feel > like I'm missing

Re: [go-nuts] buffer.WriteString Error case

2018-08-07 Thread Sam Whited
On Tue, Aug 7, 2018, at 19:43, Ian Lance Taylor wrote: > So that it implements the (unexported) interface io.stringWriter. I've wondered about this for a while; I find myself creating a StringWriter interface frequently in various projects. With all the other great standard interfaces in the io

Re: [go-nuts] Re: Nil Channels and Case Evaluation

2018-08-08 Thread Sam Whited
On Wed, Aug 8, 2018, at 04:40, Jan Mercl wrote: > On Wed, Aug 8, 2018 at 11:15 AM Kaveh Shahbazian > wrote: > > > But the error message (no cases) is confusing and unclear because > obviously there is a case there. > > I don't think it's confusing. The run-time message obviously does not

Re: [go-nuts] Host two distinct modules in one git repo?

2018-08-08 Thread Sam Whited
On Wed, Aug 8, 2018, at 11:29, Paul Jolly wrote: > And incidentally, #modules on Gophers Slack will likely be a better > place to work things through; it's got a great number of people > helping/responding. This thread is of great importance to a lot of people in the community, and the

Re: [go-nuts] Host two distinct modules in one git repo?

2018-08-08 Thread Sam Whited
On Wed, Aug 8, 2018, at 11:46, Paul Jolly wrote: > My suggestion would be that, in cases such as this thread, any > answers/insights derived from Slack be reported back to the go-nuts > thread, for the benefit of anyone else following along. This also has > the benefit of cutting out any noise

Re: [go-nuts] How to refactor out this function

2018-08-07 Thread Sam Whited
tried to refactor the above function to func sayHi(m *tb.Message) {...}, > so that I can give an alias to the above /hello command (say to define a > /hi command), but found that I cannot use bwithin it any more. > > So, how to refactor out this function? -- Sam Whited s...@samwhited

Re: [go-nuts] Is this a go fmt bug? map[string]int{...}

2018-08-09 Thread Sam Whited
ubscribed 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. -- Sam Whited s...@samwh

Re: [go-nuts] How to deal with binaries compilation with go modules enabled?

2018-08-30 Thread Sam Whited
/goimports and see what > > the output prints about the problem. > > > > > > > > -- > You received this message because you are subscribed to the Google > Groups "golang-nuts" group. > To unsubscribe from this group and stop receiving emai

Re: [go-nuts] go module for library developer workflow

2018-09-04 Thread Sam Whited
u'll have to be careful not to accidentally commit this line. —Sam -- Sam Whited s...@samwhited.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 g

Re: [go-nuts] Re: Can't print GO2 draft documents with firefox 61.0.1 (64 bits) Ubuntu

2018-09-05 Thread Sam Whited
On Wed, Sep 5, 2018, at 15:04, peterGo wrote: > Print the draft documents from Firefox Quantum 61.0.1 (64-bit) for Mozilla > Firefox for Ubuntu canonical - 1.0. I'm using Firefox 63.0a1 nightly cut 2018-08-19 and am also getting only one page; I had to download a new browser to print. —Sam

Re: [go-nuts] Go 2 Draft Design Question : Error Handling

2018-09-08 Thread Sam Whited
On Sat, Sep 8, 2018, at 12:41, Henry wrote: > I have read the Go 2 Draft Design about Error Handling. You can read about > it here Go 2 Draft Designs > . The > draft suggested something like this: > > func CopyFile(src, dst

Re: [go-nuts] Operator Overloading Implies Generics?

2018-09-09 Thread Sam Whited
On September 9, 2018 1:43:09 PM UTC, robert engels wrote: >I think the lack of method overload is a poor choice. > > … > >I would much rather write > >NewCircle([]Point) >NewCircle(center Point,radius int) > >than > >NewCircleFromPoints >NewCircleFromCenterWithRadius > >and this is just a

Re: [go-nuts] Re: Can't print GO2 draft documents with firefox 61.0.1 (64 bits) Ubuntu

2018-09-06 Thread Sam Whited
On Wed, Sep 5, 2018, at 20:28, peterGo wrote: > What happenned when you followed the instructions I gave to Christophe? I believe this is exactly what I was doing before; I don't love having to use the simplify option though, so it's possible I left it off and didn't notice. I'll try again at

Re: [go-nuts] help seek: creating and using go package

2018-09-04 Thread Sam Whited
On Tue, Sep 4, 2018, at 01:33, Sayan Shankhari wrote: > Probably I am making some nonsense post here and disturbing you but as a > beginner, I want to know how in Go I can implement the following. If I can > not, please suggest me suitable solution: Not at all; welcome! If you're just getting

Re: [go-nuts] Is it needed to close a HTTP request body ?

2018-09-10 Thread Sam Whited
On Mon, Sep 10, 2018, at 09:27, Pierre Durand wrote: > When I learned Go a few years ago, I was told to always defer/close the > HTTP request body, otherwise it will cause a resource leak. > > But today I read this: https://golang.org/pkg/net/http/#Request.Body > // The Server will

Re: [go-nuts] Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Sam Whited
On Thu, Oct 11, 2018, at 11:37, Thomas Bruyelle wrote: > I want to update my authentication code by using > golang.org/x/crypto/argon2, as a replacement of > github.com/tvdburgt/go-argon2 which uses the legacy C lib under the hood > through CGO. > The main benefit is of course to drop the

Re: [go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Sam Whited
On Thu, Oct 11, 2018, at 13:56, Thomas Bruyelle wrote: > Unfortunately, because of that version mismatch, all my users' hashes were > created with a version not supported by golang.org/x/crypto/argon2, so I > can't migrate :/ I hope no problems are ever discovered in Argon2 then, it's generally

Re: [go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Sam Whited
On Thu, Oct 11, 2018, at 14:14, Thomas Bruyelle wrote: > That say, the downside is I have to keep both hash system, until all users > connect, which can take a long time, or can never happen! Or at least until enough users have updated that you don't mind forcing the rest to update their

Re: [go-nuts] Temporary files in go

2018-10-11 Thread Sam Whited
On Thu, Oct 11, 2018, at 18:48, Greg Saylor wrote: > 1. Create a temporary file and squirrel away the file handle > 2. Unlink the temporary file by name > 3. Various functions would write stuff to the file > 4. If the programs completes to some successful state, create a hardlink to > the file

Re: [go-nuts] Having trouble installing golint

2018-10-17 Thread Sam Whited
ribed 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. -- Sam Whited s...@samwhited.co

Re: [go-nuts] go src organization question

2018-10-21 Thread Sam Whited
On Sun, Oct 21, 2018, at 11:31, Sankar wrote: > For such a hybrid requirement, what is the most recommended way to import > and structure our libraries and the source directories, to work with go > modules? A single module at the root of the project should give you what you want. Create the

Re: [go-nuts] Having trouble installing golint

2018-10-17 Thread Sam Whited
"https://go.googlesource.com/tools"} at https: > //golang.org/x/tools/go/internal/gcimporter?go-get=1 > get "golang.org/x/tools/go/internal/gcimporter": verifying non- > authoritative > meta tag > > $ go get -u -v github.com/golang/lint/golint > github.c

  1   2   >