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: > > > imp

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) s

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

2018-02-21 Thread Sam Whited
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 this

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 th

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 co

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] 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 s

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...@samw

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 talk

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 informatio

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 alon

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

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

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

2018-08-30 Thread Sam Whited
t -x -u golang.org/x/tools/cmd/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 gro

Re: [go-nuts] Panic getting swallowed by defer in Go 1.11

2018-09-03 Thread Sam Whited
On Mon, Sep 3, 2018, at 04:10, ama...@naucera.net wrote: > type S []int > > func (s *S) Last() int { > return (*s)[len(*s) - 1] > } On an unrelated matter, the extra indirection is (probably) not what you want here, slices are already a pointer type. For more information see https://blog.go

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

2018-09-04 Thread Sam Whited
a Unfortunately, you'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 fro

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 st

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] 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 so

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 st

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 very

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 clo

Re: [go-nuts] Golang equivalent of Python's context manager

2018-09-12 Thread Sam Whited
On Wed, Sep 12, 2018, at 14:12, Mirko Friedenhagen wrote: > However, coming from Java lately, retrieving a DB-connection from a pool, > opening a transaction and committing/aborting and returningafterwards seems > something which could be handled with such a construct. How would you do > this in

Re: [go-nuts] Is it possible to build a module without a hosted repository?

2018-09-14 Thread Sam Whited
On Fri, Sep 14, 2018, at 20:32, K Davidson wrote: > Is there a way that I can build my package as a module without having to > host it on the internet? I've found myself just making up fake import statements. While you're prototyping it doesn't hurt: package main // import "golang.org/total

[go-nuts] Getting Go module versions from Git Log

2018-09-24 Thread Sam Whited
Hi all, Here's a quick Git config for getting go module meta-versions from Git Log output, hopefully its useful to someone else who was getting frustrated by trying to make up v0.0.0 versions: https://blog.samwhited.com/2018/09/go-module-versions-from-git-log/ —Sam -- You received this messa

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 usage

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 password

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 han

Re: [go-nuts] Having trouble installing golint

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

Re: [go-nuts] Having trouble installing golint

2018-10-17 Thread Sam Whited
quot;git", RepoRoot: > "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/go

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 fil

Re: [go-nuts] database for protobuf - profanedb or similar

2018-10-30 Thread Sam Whited
On Tue, Oct 30, 2018, at 13:48, Tharaneedharan Vilwanathan wrote: > I am looking for a database for protobuf, preferably the one that fits Go > environment better. I located profanedb. I am wondering if anyone tried it > with Go and if there is any example code that I can take a look at. Also, > pl

Re: [go-nuts] RE: integration tests and using atom

2018-11-08 Thread Sam Whited
On Thu, Nov 8, 2018, at 13:49, S Ahmed wrote: > Is there a way to ignore certain tests like my integration tests that setup > db etc. and are long running? I like to add a build tag to my integration tests, something like: // +build integration Then when I want to run them: go test -tags "i

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 09:46, Paul Jolly wrote: > > 2. "Why doesn't "go build" run "go mod tidy" automatically? > > It does in as much as adding missing dependencies are concerned, but > doesn't do the tidying (removal) in go.{mod,sum} that go mod tidy > does. I don't think this is true (unless

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 10:39, Paul Jolly wrote: > I don't think there's anything wrong with this distinction - when you > say "unless this has been fixed", are you suggesting the behaviour is > wrong or could be improved in some respect? I've just seen several projects do this wrong because they

Re: [go-nuts] what does the "replace" in go.mod mean?

2018-11-10 Thread Sam Whited
On Sat, Nov 10, 2018, at 11:00, Paul Jolly wrote: > > I've just seen several projects do this wrong because they don't know about > > go mod tidy so they build, let CI run tests (and don't notice that the file > > has changed in CI), and call it a day never knowing that they're missing > > depen

Re: [go-nuts] Unable to view go-review.googlesource.com on Firefox 60.x

2018-11-16 Thread Sam Whited
eceived 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] Simple Go http daemon under systemd

2018-11-23 Thread Sam Whited
On Thu, Nov 22, 2018, at 21:14, Tong Sun wrote: > and it needs to be working under systemd. > … > but there is no mentioning of how it can work under systemd, which could > be > troublesome, > like the question I found at why systemd cannot start golang web app >

[go-nuts] Syntax highlighting (again) [WAS go language sensitive editor?]

2018-11-24 Thread Sam Whited
On Fri, Nov 23, 2018, at 17:06, Jay Ts wrote: > Nowadays I use vim > because there are a few nice things about it that aren't in vi. At least, > vim is ok after you turn off syntax highlighting and all the other newbie > crutches. :-P Seriously, how many people can't read or write in English (or

Re: [go-nuts] [Go2] move everything to gopath so goroot isn't required anymore

2018-12-02 Thread Sam Whited
There has been some discussion of making packages in the standard library into modules (once that's the default versioning system) which could be versioned separately from Go so that fixes could be released without having to wait on the full Go release cycle. I can't find a link at the moment, b

Re: [go-nuts] Getting .slide of Golang Talks

2018-12-03 Thread Sam Whited
On Mon, Dec 3, 2018, at 10:28, Andrew Frances wrote: > Is it possible to get the .slide files for the > Golang Talks https://talks.golang.org/ so I can have more examples (I don't > really need all the accompanying files)? https://github.com/golang/talks -- You received this message because you

Re: [go-nuts] Re: json and interface unmarshalling

2018-12-14 Thread Sam Whited
> payload := new(model.ChatMessage) > > user := pmap["user"].(string) > > payload.User = user > > > > message := pmap["message"].(string) > > payload.Message = message > > > > tme := pmap["time"].(string) > > tmee,

[go-nuts] Language line in go.mod

2018-12-18 Thread Sam Whited
Hi all, I've been asked multiple times recently to point people to documentation for the language line in a go.mod file (eg. the `go 1.12' line that's added by recent builds), but I haven't been able to find any on the wiki or in `go help modules` or similar, just the occasional list discussion

Re: [go-nuts] Language line in go.mod

2018-12-18 Thread Sam Whited
On Tue, Dec 18, 2018, at 10:13, Ian Lance Taylor wrote: > https://tip.golang.org/cmd/go/#hdr-The_go_mod_file Ah thanks! I wouldn't have ever thought to look there for info on the mod file. I'll pass that along. —Sam -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] tool to automatically refresh godoc ?

2018-12-21 Thread Sam Whited
On Fri, Dec 21, 2018, at 14:48, Beoran wrote: > Not go specific, there are inotifywait and entr > http://eradman.com/entrproject/. Or a post-push hook on the server where the repos live if you're using Git. —Sam -- You received this message because you are subscribed to the Google Groups "gol

Re: [go-nuts] go modules go build fails - normal go build with $GOPATH set works

2018-12-25 Thread Sam Whited
This sounds like the version is mismatched. Is the gopath version a newer commit (with api changes) than the tag being picked in the go.mod file? I have this quite frequently with golang.org/x/text which was last released some time ago and have to use a replace directive to get a more up to date

Re: [go-nuts] Re: Secure password hashing algorithm in go.

2019-01-07 Thread Sam Whited
On Mon, Jan 7, 2019, at 07:58, minfo...@arcor.de wrote: > I've often encountered demands for password encryption, where simple string > hashing would suffice. You should never encrypt passwords; encryption implies that you can get the original password back out, it's a two way street. Some form

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-12 Thread Sam Whited
On Fri, Jan 11, 2019, at 23:03, grego...@unity3d.com wrote: > But now, I don't know how I can essentially copy the mod cache (or > whatever the right term is) like I'd have copied the vendor directory. If you're suggesting that you already have the module cached on the machine that builds your c

Re: [go-nuts] When to use interfaces?

2019-01-18 Thread Sam Whited
On Fri, Jan 18, 2019, at 18:06, 伊藤和也 wrote: > When to use interfaces? Reading this chapter in Effective Go might help. You can find answers to many of your questions there. https://golang.org/doc/effective_go.html#interfaces_and_types —Sam -- You received this message because you are subscrib

Re: [go-nuts] Re: multiple binaries from a single directory with go modules?

2019-01-18 Thread Sam Whited
On Sat, Jan 19, 2019, at 01:12, Tyler Compton wrote: > What alternative do you recommend? Use what you're comfortable with. Make is a great tool, and doesn't appear to be the problem here. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. T

Re: [go-nuts] Is the type of a variable with interface{} "nil"?

2019-01-20 Thread Sam Whited
On Mon, Jan 21, 2019, at 00:39, 伊藤和也 wrote: > I checked the type of the variable "v" with interface{} using TypeOf > function in reflect package but it returned "nil". > var v interface{} > fmt.Println(reflect.TypeOf(v)) > That is what the reflect.TypeOf function is supposed to do. The docs spe

Re: [go-nuts] How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-21 Thread Sam Whited
On Tue, Jan 22, 2019, at 03:26, Antonio Romeo Riga wrote: > I would like to do something like that > fmt.Printf("%-15v %5.2f %5.2f" , coin, piggyBank) > > %-15v and %5.2f should change the variable 'coin'. If you want the first two verbs to both affect "coin" in your example, use bracket notatio

Re: [go-nuts] Re: Is it possible to export a variable from main package? If impossible, why?

2019-01-23 Thread Sam Whited
On Thu, Jan 24, 2019, at 07:00, 伊藤和也 wrote: > Is it possible? > package main > > var Number int = 100 > func main() {} > > package hello > > import "fmt" > > func abc() { >fmt.Println(Number) > }2019年1月24日木曜日 11時27分57秒 UTC+9 伊藤和也: > > package main > > > > var Number int = 100 > > > > func

Re: [go-nuts] Go Module File

2019-01-27 Thread Sam Whited
On Sun, Jan 27, 2019, at 11:24, Kaveh Shahbazian wrote: > Where can I find the complete reference for Go module files (go.mod)? > > I am particularly interested in getting fluent in using local > packages/sub-packages and also redirecting import paths - for example > for times I need to use a fo

Re: [go-nuts] go install touches the result file even if no changes

2019-01-28 Thread Sam Whited
On Mon, Jan 28, 2019, at 19:44, 'Tim Hockin' via golang-nuts wrote: > People already chide me for my affinity for baroque > Makefiles... I use bmake too; and here I was all this time thinking that the "b" stood for "BSD". —Sam -- You received this message because you are subscribed to the Goog

Re: [go-nuts] Alternative of defer?

2019-02-08 Thread Sam Whited
it, send > an email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Sam Whited -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Sam Whited
On Fri, Feb 15, 2019, at 20:00, Burak Serdar wrote: > rate=1.0/double(dur) nit: s/double/float64/ —Sam -- 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-nu

Re: [go-nuts] Re: Unmarshal nested XML value from dynamic XML document

2019-02-24 Thread Sam Whited
ulácsi:Walk > over it usin xml.Decoder.Token, and UnmarshalElement when found a > StartToken with a proper Name.Local. > > > > -- > You received this message because you are subscribed to the Google > Groups "golang-nuts" group. > To unsubscribe from

Re: [go-nuts] Go packaging

2019-03-18 Thread Sam Whited
On Mon, Mar 18, 2019, at 06:24, Nada Saif wrote: > I am learning to Go. For packages, do I need to use GitHub? > I tried to build two packages one accessing functions from the other. Welcome! You can use whatever repository hosting you want, and even use your own domain name with it! I encourage

Re: [go-nuts] Go command support for "make"

2019-03-19 Thread Sam Whited
On Wed, Mar 20, 2019, at 05:05, Lucio wrote: > What I just realised is that my Makefile/mkfile-foo isn't sufficient > to *do something* with such information, but at this point I'm willing > to cross that bridge when I come to it. For now, having a "go status > infernal/package", say, even if it pr

[go-nuts] SourceHut Terraform Provider and HTTP API SDK

2019-03-24 Thread Sam Whited
me pending changes [2] are merged. —Sam [1]: https://sourcehut.org/ [2]: https://golang.org/cl/168065 -- Sam Whited -- 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

Re: [go-nuts] OCSP revocation checking before completing TLS handshake

2019-04-11 Thread Sam Whited
On Thu, Apr 11, 2019, at 15:49, erikssonfili...@gmail.com wrote: > Using Go's standard TLS library this does not seem possible, as > tls.Dial does not seem to do any OCSP checking. Another possible > workaround would be to fetch the server certificate without > performing a handshake, then check re

Re: [go-nuts] built-in alternative to bcrypt?

2019-04-22 Thread Sam Whited
On Mon, Apr 22, 2019, at 10:14, whitehexagon via golang-nuts wrote: > I am concerned about the Go binary size, since I'm already at 15MB! So > I'm trying to limit external dependencies as much as possible. Staying in the standard library won't help you here. You'll still have to link in the code y

Re: [go-nuts] Re: built-in alternative to bcrypt?

2019-04-22 Thread Sam Whited
On Mon, Apr 22, 2019, at 20:18, whitehexagon via golang-nuts wrote: > Also good to know only what I'm using gets linked in, but then the > size of 'hello world' is even more surprising. That's because the runtime is being linked in. Go requires, among other things, a garbage collector and goroutin

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 li

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] 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 un

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

2017-08-28 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 this

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 liste

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 > cha

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 what

[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 Fr

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 general

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 w

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Sam Whited
On Wed, Apr 24, 2019, at 14:08, Mark Volkmann wrote: > Are there really developers that find this unreadable? > > color := temperature > 80 ? “red” : “green” Yes. What is "?"? If I've never seen that before I have no easy way to search for that, and a random symbol me nothing about what it does.

Re: [go-nuts] Interesting public commentary on Go...

2019-05-23 Thread Sam Whited
Thank you for writing your reply Ian. Since it's a rather long post I don't want to go through it point by point, but suffice it to say that I agree with most of what you've written. However, I also agree that Go is Google's language, and that in its current form this is a problem. I'm going to ta

Re: [go-nuts] Interesting public commentary on Go...

2019-05-23 Thread Sam Whited
m On Thu, May 23, 2019, at 19:22, Sam Whited wrote: > Thank you for writing your reply Ian. Since it's a rather long post > I don't want to go through it point by point, but suffice it to say > that I agree with most of what you've written. However, I also > agree that Go i

Re: [go-nuts] Interesting public commentary on Go...

2019-05-23 Thread Sam Whited
On Thu, May 23, 2019, at 22:28, Anthony Martin wrote: > How do you square this opinion with the fact that the Go team went out > of their way to enable the use of third-party module proxies, > something that is good for the community but would be of little > practical use to Google? I'm certainly

Re: [go-nuts] Any alternative to go-bindata that supports dynamic assets?

2019-05-26 Thread Sam Whited
not have propagated everywhere yet. If you're getting TLS errors from Netlify or can't look up the domain at all, wait 24 hours or so for DNS to finish propagating and for the new certs to be deployed. [1]: https://github.com/rakyll/statik [2]: https://git.sr.ht/~samwhited/pk

Re: [go-nuts] Interesting public commentary on Go...

2019-05-29 Thread Sam Whited
On Thu, May 23, 2019, at 17:59, Ian Lance Taylor wrote: > But (and here you'll just have to trust me) those executives, and > upper management in general, have never made any attempt to affect how > the Go language and tools and standard library are developed. Of > course, there's no reason for th

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-11 Thread Sam Whited
On July 12, 2019 4:35:54 AM UTC, Andrey Tcherepanov wrote: >What these guys are proposing in that paper would be closer to >(Go-style) >func f() (v value | e error) { ... } > >(where "|" could be read as "or" or "union") > I've thought a tiny bit about how union or sum types would work in Go

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-12 Thread Sam Whited
On Fri, Jul 12, 2019, at 06:31, Andrey Tcherepanov wrote: > I haven't seen your proposal before, but it looks interesting - you > seem to have put quite a thought into it already. To be clear, this isn't actually a proposal. I was just toying with the idea and there's really not much thought put i

[go-nuts] Simple web components and other libraries

2019-07-12 Thread Sam Whited
web frameworks that have become popular. They can all be found here: https://code.soquee.net/ —Sam -- Sam Whited -- 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, se

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-14 Thread Sam Whited
On Sun, Jul 14, 2019, at 06:53, roger peppe wrote: > As far as I can tell, that's almost identical to the scheme that I > suggested here: > https://github.com/golang/go/issues/19412#issuecomment-288485048 I hadn't seen that issue, I'll have to read through it. Thanks for

Re: [go-nuts] About the Google logo on the new Go website

2019-07-15 Thread Sam Whited
"The Go Contributors". Google (and the core Go team that works for them) are just one of those Contributors. Should we put every company that's ever signed the CLA on the website too? —Sam -- Sam Whited -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] About the Google logo on the new Go website

2019-07-15 Thread Sam Whited
On Mon, Jul 15, 2019, at 16:54, Wojciech S. Czarnecki wrote: > Neither go-nuts list is a proper venue for the Big Enders and Little > Enders fight. Please keep this mailing list clean. This is the place for Go discussion. Not everyone in the community has an account on Reddit, or even GitHub, but

Re: [go-nuts] Re: golang with XSLT

2019-08-19 Thread Sam Whited
On Mon, Aug 19, 2019, at 20:31, 'Eric Johnson' via golang-nuts wrote: > Tips: > * When ever you're wondering about a good library for , two good > places to start are https://go-search.org , and > https://github.com/avelino/awesome-go. Also try searching on https://godoc.org/ —Sam -- You

Re: [go-nuts] Go string and UTF-8

2019-08-20 Thread Sam Whited
I personally wouldn't do this. If you're going to incur the overhead of a heap allocation, might as well incur a bit more and encode the hash, eg. using hex.EncodeToString [1], just so that you don't forget and try to print or decode the string as utf8 later. —Sam [1]: https://godoc.org/encodi

Re: [go-nuts] Go string and UTF-8

2019-08-20 Thread Sam Whited
On August 20, 2019 11:50:54 AM UTC, Rob Pike wrote: >Printf can print hexadecimal just fine. Never understood the point of >encoding/hex. I always thought that the C style format strings were unreadable and the hex package methods were much clearer, personally. —Sam -- You received this me

Re: [go-nuts] Re: go mod dependency hell is real

2019-09-10 Thread Sam Whited
.4 > > => github.com/ugorji/go v0.0.0-20190204201341-e444a5086c43` > On Tuesday, September 10, 2019 at 2:48:25 PM UTC+2, Darko > Luketic wrote: > > What used to work pre go 1.13 now doesn't work anymore -- Sam Whited -- You received this message because you are subscr

Re: [go-nuts] How to mock functions in Go ?

2019-09-20 Thread Sam Whited
On Thu, Aug 1, 2019, at 12:09, Nitish Saboo wrote: > How can we mock a function in Go like os.Hostname() or os.Getwd() > ? Any framework or Library that we can use for mocking the > function calls ? I don't like to think about "mocking" in Go, but I can't provide an alternative term so maybe this

Re: [go-nuts] Golang library for - ORM & Schema Migration

2019-10-01 Thread Sam Whited
On Mon, Sep 30, 2019, at 21:05, bram wrote: > Thank you all. For schema migration i am looking for similar tool > like flyway. I'm not sure if it's like flyway, but I use a library that I wrote, code.soquee.net/migration [1]. The idea is that it gives you the tools you need to write a migration co

Re: [go-nuts] [ANN] go-resty v2.1.0 released - Simple HTTP and REST client library

2019-10-11 Thread Sam Whited
On Fri, Oct 11, 2019, at 20:55, Dimas Prawira wrote: > Stable Version : github.com/go-resty/resty/v2 > > got 404 (not found) That is a Go import line with a module major version suffix, not a GitHub URL. The fact that they look the same instead of using some other syntax is extremely annoying,

Re: [go-nuts] [ANN] go-resty v2.1.0 released - Simple HTTP and REST client library

2019-10-11 Thread Sam Whited
On Fri, Oct 11, 2019, at 21:24, Dimas Prawira wrote: > Just test using got get You appear to be using an old version of Go that doesn't support modules or have it turned off or set to auto using the GO111MODULE environment variable. If you upgrade to Go 1.13 and make sure GO111MODULE isn't set, it

Re: [go-nuts] module declares its path as: golang.org/x/lint but was required as: github.com/golang/lint

2019-11-21 Thread Sam Whited
e post questions as new threads with a subject that describes what you're asking. It helps sometimes if you describe your issue in the message body too instead of just linking to another site (this encourages people to answer your question inline). Thanks again, and good luck! —Sam -- Sam

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

2016-08-22 Thread Sam Whited
On Mon, Aug 22, 2016 at 8:29 AM, Sridhar wrote: > I suppose my question is where's the repo for the examples in the package > documentation ? >From the root of the main Go repo (which contains the standard library) look in src/errors/example_test.go —Sam -- Sam Wh

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

2016-08-25 Thread Sam Whited
re 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 this message because you

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

2016-08-25 Thread Sam Whited
27;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" g

  1   2   3   >