[go-nuts] beginner question about chanels

2018-05-04 Thread sam
gobyexample.com/channel-buffering explains this really nicely with a runnable example showing the difference! -- 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 gol

[go-nuts] Go routines hanging

2018-05-04 Thread sam
le other questions in this group I've killed the process manually to get the stack trace which I'll attach, hopefully this is helpful. Any thoughts would be greatly appreciated! Thanks, Sam -- You received this message because you are subscribed to the Google Groups "golang-nu

[go-nuts] Re: Go routines hanging

2018-05-05 Thread sam
r going to return, and it >> will take too long and get kicked. I also asked this question here >> <https://stackoverflow.com/questions/50129226/golang-channels-getting-stuck> >> but it seems to have gone quiet. >> >> Based on comments from a couple other qu

[go-nuts] Re: Go routines hanging

2018-05-05 Thread sam
ver going to return, and it >> will take too long and get kicked. I also asked this question here >> <https://stackoverflow.com/questions/50129226/golang-channels-getting-stuck> >> but it seems to have gone quiet. >> >> Based on comments from a couple other qu

[go-nuts] Re: Go routines hanging

2018-05-05 Thread sam
is question here > <https://stackoverflow.com/questions/50129226/golang-channels-getting-stuck> > but it seems to have gone quiet. > > Based on comments from a couple other questions in this group I've killed > the process manually to get the stack trace which I'l

[go-nuts] Re: Go routines hanging

2018-05-05 Thread sam
Hi James, Thanks for the tip - could you elaborate on your idea of a 'busy loop'? Is this a loop that is blocked, or just one that is currently operating on something? I'm not sure what causes GC to act on certain go routines. I completely understand that getting the length of the channel isn't

[go-nuts] Re: Go routines hanging

2018-05-05 Thread sam
I see your point! Line 46 would never be in production, that was just to return for the specific situation I was testing, but the other loop would make more sense using sync. I'll take a look into sync functionality as I've not used it before, but that seems like the idiomatic way to do it! Than

[go-nuts] How do you retrieve certs from the Windows Local Machine cert store with Go?

2019-03-19 Thread Sam
It seems like I should be able to use this: store, err := syscall.CertOpenStore(syscall.CERT_STORE_PROV_MEMORY, 0, 0, windows.CERT_SYSTEM_STORE_LOCAL_MACHINE, uintptr(unsafe.Pointer(my))) but I think I am having trouble with the last argument. I only receive the CRYPT_E_NOT_FOUND error. I have

[go-nuts] Re: How do you retrieve certs from the Windows Local Machine cert store with Go?

2019-03-19 Thread Sam
at 11:34:02 AM UTC-7, Sam wrote: > > It seems like I should be able to use this: > > store, err := syscall.CertOpenStore(syscall.CERT_STORE_PROV_MEMORY, 0, 0, > windows.CERT_SYSTEM_STORE_LOCAL_MACHINE, uintptr(unsafe.Pointer(my))) > > but I think I am having trouble with the

[go-nuts] Re: How do you retrieve certs from the Windows Local Machine cert store with Go?

2019-03-19 Thread Sam
, 2019 at 11:52:50 AM UTC-7, Sam wrote: > > I'd like to add that I have tried this but the store handle returned is > zero > store, err := syscall.CertOpenStore( > windows.CERT_STORE_PROV_SYSTEM_W, > 0, > 0, > windows.CERT_SYSTEM_STORE_LOCAL_MACHI

[go-nuts] Re: How do you retrieve certs from the Windows Local Machine cert store with Go?

2019-03-19 Thread Sam
only guess what the C++ code you refer to > does (as CertOpenStore itself doesn't return an error code). > > > On Tuesday, March 19, 2019 at 2:04:13 PM UTC-7, Sam wrote: >> >> It turns out that the call I mentioned will indeed retrieve the Local >> Machine Per

[go-nuts] SQLite3 Support without CGo

2016-12-12 Thread sam
Hello, I love the pure-Go compiler & tool-chain, especially how effortless it makes cross-compiling from our Linux development server for our estate of Windows PCs. It even made me feel like it was worth the effort to create a DLL wrapper for SQLite3, so we can use it without CGo by bundling t

Re: [go-nuts] SQLite3 Support without CGo

2016-12-12 Thread sam
Thanks Konstantin, That was very helpful. I'll do some more looking into it, as taking your suggestion, the ulibc version (here ) seems more simple than glibc. I'm not going to kid myself though, it looks well beyond my cur

[go-nuts] Re: SQLite3 Support without CGo

2016-12-13 Thread sam
If anyone is interested, I've opened a ticket on GitHub (https://github.com/golang/go/issues/18296). Please drop by and show your support. On Monday, December 12, 2016 at 11:28:19 PM UTC, brainman wrote: > > I was toying with this idea myself. > > Maybe even going all the way with "pure" Go vers

Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-16 Thread Sam
eived over the connection before evicting and interpreting them. intBytes, err := reader.Peek(4) if err == nil { // Decode integer reader.Discard(4) } -Sam On Mon, Dec 16, 2019 at 7:27 AM Marvin Renich wrote: > * Ian Lance Taylor [191215 23:05]: > > The Buffered method [snip]

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

2018-02-08 Thread Sam Whited
ch separate database you want to support be a different plugin (https://godoc.org/plugin) that implements your datastore abstraction and load the correct plugin at runtime. It hardly seems worth the complexity or maintainability cost though. —Sam -- You received this message because you are subscrib

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

2018-02-21 Thread sam boyer
Unfortunately, the rules also create some new perverse incentives, with some, IMO, nastier failure modes and remediations. That's one of the things i'll be elaborating on in my doc (hopefully) next week. That said, one of the points Russ and i agree on is that dep does allow more expressiveness

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

2018-02-21 Thread Sam Whited
rted using Go, but later came to love) if you force developers to drastically change their work flow, many of them will either push back, or, if it's only convention as this is, simply won't do it. —Sam -- You received this message because you are subscribed to the Google Groups "

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
My understanding was that the path is still relavant, so you'd need a /v2 directory inside the zip file, which means you probably need it in your source code. However, if that is incorrect it fixes the problem. —Sam -- You received this message because you are subscribed to the Google G

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

2018-02-21 Thread Sam Whited
I've had a hard time coming to grips with all the implications of this proposal (it being a radical departure from the current state of the art), but the detailed posts have been very helpful; thanks for writing about it! —Sam -- You received this message because you are subscribed to the G

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
rom v1 to v2? This wasn't clear to me either, but it was pointed out that you can just change the "module" line in your go.mod file, eg. module "example.net/mypackage/v2" and you don't have to actually create a /v2 tree or move your code around at all. —Sam

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

2018-02-24 Thread Sam Whited
feel > like I'm missing something obvious. FYI, there is an active CL for this here: https://golang.org/cl/95578 —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

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

2018-08-07 Thread Sam Whited
o", s) b.Handle("/hi", s) —Sam On Tue, Aug 7, 2018, at 07:29, Tong Sun wrote: > Hi, > > Consider this function: > > b.Handle("/hello", func(m *tb.Message) { > b.Send(m.Sender, "hello world") > }) > > > I

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

2018-08-07 Thread Sam Whited
n the io package, I wonder why this one wasn't exported? —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-nuts+unsubscr...@googlegroup

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

2018-08-08 Thread Sam Whited
mpile time error if no case statements was the actual problem, I probably would have assumed that this meant that at first too. —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 fr

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

2018-08-08 Thread Sam Whited
unity, and the information you can get from it is very important. Please do not move it to a closed system like Slack. Not everyone can get a Slack account to participate, or even read any discussion that happens there. I for one would like to continue being able to see this discussion. —Sam -- You

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

2018-08-08 Thread Sam Whited
rt of things because you limit responses primarily to those in the same couple of timezones and who happen to not be busy, etc. and Slack is even worse by virtue of being impossible to use for a large number of people (for accessibility or legal reasons). —Sam -- You received this message because yo

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] Re: Ternary ... again

2018-08-14 Thread Sam Vilain
I haven't seen all the discussion referenced, but I remember digging deep into the python language archives where Guido and others eventually relented and added ternaries (with the syntax "a if val else b"). I can't remember the argument which swung the consensus but the arguments against seem rema

Re: [go-nuts] Re: Ternary ... again

2018-08-15 Thread Sam Vilain
rn FooBar{ Field: blah, } To: var foo FooBar if someCond { foo.Field = blah } else { foo.Field = bar } return foo In my experience code is clearer and easier to read if it does *not* contain re-assignments and branches, and temporary variables used only once. With a ternary operator,

Re: [go-nuts] Local cache of dependencies

2018-08-22 Thread Sam Vilain
Check out vendetta - it uses git submodules, so you keep a cache of the 3rd party repo in git but not the actual content. You get small repos and reproducible builds.SamOn Aug 22, 2018 3:25 PM, Conor Hackett wrote:Hey Guys,So, adding your "vendor" directory to SCM is a contentious topic at best.I

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

2018-08-30 Thread Sam Whited
+360771e422) but haven't dug in further. —Sam On Thu, Aug 30, 2018, at 13:29, Denis Cheremisov wrote: > strange, still the same > > $ go get -x -u golang.org/x/tools/cmd/goimports > go: cannot find main module; see 'go help modules' > > I am using > >

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

2018-09-03 Thread Sam Whited
inding this thread I wanted to mention it. —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-nuts+unsubscr...@googlegroups.com. For more options, v

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
s://stackoverflow.com/questions/38616687/which-way-to-name-a-function-in-go-camelcase-or-semi-camelcase/38617771#38617771 And here is a nice post about how to name things: https://blog.golang.org/package-names I hope that's helpful. Welcome to Go! —Sam -- You received this message bec

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 p

Re: [go-nuts] A thought on contracts

2018-09-05 Thread Sam Vilain
Is that the go team's job, though?  It's about go and automatically inferring duck types, so surely we should really be asking DuckDuckGo.Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving email

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

2018-09-06 Thread Sam Whited
I'll try again at some point and follow up if something was off. —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-nuts+unsubscr...@g

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

2018-09-08 Thread Sam Whited
nt of the overview document. The actual draft design does not include any such syntax. The document you want to read can be found here: https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling.md —Sam -- You received this message because you are subscribed to the Google Groups

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

2018-09-09 Thread Sam Whited
mCenterWithRadius > >and this is just a very simple example. Allowing this would also open us up to a lot of Java-like ambiguity: func Foo(i int) {…} func Foo(i ...int) {…} Foo(1) // Which function signature does this match? —Sam -- You received this message because you are subscribed

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

2018-09-10 Thread Sam Whited
The Server will close the request body. The ServeHTTP > // Handler does not need to. > > Am I misunderstanding something ? The rule is that HTTP *clients* must close the *response* body. Servers handle closing the request body themselves. —Sam -- You received this message becau

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

2018-09-12 Thread Sam Whited
checking it) —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-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

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

2018-09-14 Thread Sam Whited
// import "golang.org/totally-official-and-real" —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-nuts+unsubscr...@google

[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

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

2018-10-11 Thread Sam Whited
passwords, which is not acceptable for me. The x/crypto/argon2 package implements version 13, if you add "Version: Version13," to your context they should be the same. The docs claim this is the default for the legacy version, but they appear to be wrong. —Sam -- You received t

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

2018-10-11 Thread Sam Whited
#x27;re on "hash mechanism v2". There's no need to force reset every password all at once since this isn't a security issue. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

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

2018-10-11 Thread Sam Whited
pdate their password if they ever log in again. —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-nuts+unsubscr...@googlegroups.com. For more

Re: [go-nuts] Temporary files in go

2018-10-11 Thread Sam Whited
panic(err) } err = unix.Linkat(int(procdir.Fd()), strconv.Itoa(oldfd), int(dir.Fd()), "mynewfile", unix.AT_SYMLINK_FOLLOW) if err != nil { panic(err) } —Sam [1]: https://godoc.org/golang.org/x/sys/unix -- You received this message becau

Re: [go-nuts] Having trouble installing golint

2018-10-17 Thread Sam Whited
As the error says, you need to use golang.org/x/lint/golint: go get -u -v golang.org/x/lint/golint —Sam On Wed, Oct 17, 2018, at 10:12, gary.willoug...@victoriaplumb.com wrote: > I'm having trouble installing golint. Any idea what the problem could be? > > $ go get -u -v git

Re: [go-nuts] Having trouble installing golint

2018-10-17 Thread Sam Whited
which may be why you are confused. However, golint specifies a custom import path (golang.org/x/lint/golint) so you need to use that. —Sam On Wed, Oct 17, 2018, at 14:48, 'kalekold' via golang-nuts wrote: > I've already tried that and the original command still fails. &

Re: [go-nuts] Re: do you use binary-only packages?

2018-10-19 Thread Sam Mortimer
dev or golang-nuts. -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-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] go src organization question

2018-10-21 Thread Sam Whited
reate the file: ~/go/src/gitlab.com/example/go.mod and then add the line: module gitlab.com/example and build. Everything should work and the local copy of your libraries will be used because they are in the same module. —Sam -- You received this message because you are subscribed to t

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

2018-10-30 Thread Sam Whited
ghly relational, etc.) then pick something that's well tested and proven which meets your criteria. —Sam [1]: https://godoc.org/github.com/lib/pq -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

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

2018-11-08 Thread Sam Whited
t have short/long tests in both categories. —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-nuts+unsubscr...@googlegroups.com. For more opti

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

2018-11-10 Thread Sam Whited
ncies, build won't necessarily help you. I've noticed this causing a lot of confusion in libraries moving to modules where dependencies get left out because they're hidden behind a build tag, or only get added when tests are run. —Sam -- You received this message because you are

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

2018-11-10 Thread Sam Whited
dependencies in the go.mod file (and even if you do, it's probably not nearly as common as wanting all of them), the default behavior of go build seems wrong to me. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubs

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

2018-11-10 Thread Sam Whited
nd Blackfriday), but that's exactly what I would expect. Building source files is subject to build constraints, generating a go.mod isn't (or shouldn't be; unless there's some reason I'm missing why you'd want a go.mod file that's specific to an individual build wit

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

2018-11-16 Thread Sam Whited
FWIW, I'm on 65 nightly and haven't noticed any problems (including back when 63 was the nightly release). —Sam On Fri, Nov 16, 2018, at 09:22, Ian Davis wrote: > Hi all, > > Since upgrading to Firefox 60.3 on Linux I am unable to view any pages > on https://go-review.g

Re: [go-nuts] Append array to slice of slice behavior puzzles me

2018-11-21 Thread Sam Mortimer
On Wednesday, November 21, 2018 at 2:38:42 PM UTC-8, Sun Frank wrote: > > Perfect! Thank you so much for your answer and explanation, : ) > It is, unfortunately, a very common "gotcha". More discussion can be found here: https://github.com/golang/go/issues/20733 Cheers

Re: [go-nuts] Simple Go http daemon under systemd

2018-11-23 Thread Sam Whited
s you bind to port 443, or wondering what type of service to use? Or are you getting some other kind of error? —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

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

2018-11-24 Thread Sam Whited
inated when everything is in string color instead of scrolling up several hundred lines wondering why it said the file ended early. It's not a crutch, as it probably doesn't help you if you can't walk already. —Sam -- You received this message because you are subscribed to t

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

2018-12-02 Thread Sam Whited
the moment, but the Go team has mentioned the possibility of doing this. —Sam On Sun, Dec 2, 2018, at 21:04, Gert wrote: > Can we move stdlib (goroot) to gopath in Go2? On install you can do go get > -u stdlib to download the stdlib into gopath. Basically getting rid of > goroot. --

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
with various visual disabilities. Plain text emails are your friend; everyone's individual client (including yours when you're composing it, probably) can style those in such a way that they'll be able to read it. Thanks, Sam On Fri, Dec 14, 2018, at 13:24, Darko Luketic wrote: > Of

[go-nuts] Language line in go.mod

2018-12-18 Thread Sam Whited
the occasional list discussion. Is this documented anywhere and I'm just missing it? Thanks, 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-nut

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

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 Go

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

2018-12-25 Thread Sam Whited
date version and fix the build —Sam On December 25, 2018 8:10:08 PM UTC, robr...@gmail.com wrote: >I have been testing out the new go modules feature. Our application >compiles/installs without problems using the normal $GOPATH way and >have >been using this for a while now. tryin

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

2019-01-07 Thread Sam Whited
nction and is not suitable for password storage. OWASP has a good overview of password storage if you're interested: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. T

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

2019-01-12 Thread Sam Whited
ine that builds your containers, the cache lives at ~/go/pkg/mod by default so you could probably copy that tree into your build container. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

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

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 "

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

2019-01-20 Thread Sam Whited
unction is supposed to do. The docs specifically mention this: https://godoc.org/reflect#TypeOf —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 golan

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

2019-01-21 Thread Sam Whited
sking, so if this wasn't what you were trying to figure out I apologize. —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-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

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

2019-01-23 Thread Sam Whited
也: > > package main > > > > var Number int = 100 > > > > func main() { > > > > } No, if you simply try this you'll see that you get an error: import "main" is a program, not an importable package —Sam -- You received this message because you a

Re: [go-nuts] Go Module File

2019-01-27 Thread Sam Whited
I need to use a fork. I'm glad I'm not the only one who had a hard time finding this: https://tip.golang.org/cmd/go/#hdr-The_go_mod_file —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

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 messa

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 ema

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

2019-02-24 Thread Sam Whited
error? is it some XML?). fmt.Errorf can be used for this, also just return the io.EOF directly. —Sam On Sun, Feb 24, 2019, at 17:28, Steffen Wentzel wrote: > Thanks for the response. I was hoping it would be possible with just > xml.Unmarshal. > > I now have this implementation - any

Re: [go-nuts] Go packaging

2019-03-18 Thread Sam Whited
ourage using alternatives; the less we tie the Go ecosystem to GitHub the better. For more information on repository lookup, custom domains, and special casing of some of the bigger repo hosting services see: https://golang.org/cmd/go/#hdr-Remote_import_paths —Sam -- You received this m

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

2019-03-19 Thread Sam Whited
files. Something like this is a good start for a Go project (assuming you want to depend on all .go files in the project, which may or may not be a good assumption depending on the project). GOFILES!=find . -name '*.go' yourbinary: go.mod $(GOFILES) go build -o $@ —Sam --

[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
ponses which are returned by crypto/tls's OCSPResponse() method. [1]: https://godoc.org/golang.org/x/crypto/ocsp —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

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

2019-04-22 Thread Sam Whited
l have to link in the code you use regardless of where it comes from (the entire standard library isn't linked into your binary, just whatever you use). As someone else mentioned, argon2 is probably what you want [1]. It's the current OWASP recommendation [2]. —Sam [1]: https://god

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

2019-04-22 Thread Sam Whited
h > stuff. ie clients that reuse 123456 for everything :) This generally isn't necessary and probably doesn't add much since you're not likely to have your passwords stolen out of memory. Just follow industry standard best practices. —Sam -- You received this message because you are

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

2017-07-22 Thread Sam Whited
gs that I'd like to review or follow more closely. —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-nuts+unsubscr...@googlegroups.com. For

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. —

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

2017-08-08 Thread Sam Whited
all understand those issues better. Apologies if I made it sound like this was something that was going to happen in the contributors summit post; everything at the summit was just a discussion which, for the most part, avoided concrete solutions. —Sam -- You received this message because you

[go-nuts] Go 2.0 proposal: context scoped variables

2017-08-11 Thread Sam Vilain
return ctx.Err() case out <- v: } } } *Prior Art & Approaches in other languages* As far as I know, only Perl 6 has this concept as an explicit language feature, also called "context variables" at some point (IIRC), which it now calls "the *

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

2017-08-11 Thread Sam Vilain
text.Context is the right pattern, in that values are rolled back as the call stack unwinds, and building it inside the runtime allows performance optimizations (variable elimination, slot unrolling, combination of context values into per-scope arenas) which would otherwise be impractical or ugl

Re: [go-nuts] Built-in log Package

2017-08-14 Thread Sam Vilain
es, and it would be good to be able to plug into those (and see also my context suggestion which could let these libraries automatically connect with a configured logger) Sam On Mon, Aug 14, 2017 at 9:36 AM, dc0d wrote: > Some packages tried that approach, adding levels as prefixes (which I

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

2017-08-14 Thread Sam Vilain
27;d use it, which means by default it gets the zero value - but they're both scoped by the call stack with a new value on re-assignment, and named by a package. I could get behind either. Sam On Sun, Aug 13, 2017 at 11:08 PM, 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.c

Re: [go-nuts] Built-in log Package

2017-08-15 Thread Sam Vilain
ation I just couldn't trade performance, memory efficiency and a good abstraction for a little syntax sugar. I'm not quite sure what the language or stdlib could do to make this better, other than shipping something like zap in stdlib. It's never really appropriate to use any

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

2017-08-28 Thread Sam Whited
OF for 1.9 In Go 1.8 the patch in 02240408a1 was ported to restore error masking behavior from 1.7 (which is why you get output in 1.8). I don't see that patch in 1.9. See also https://golang.org/issue/19333 —Sam -- You received this message because you are subscribed to the Google Group

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

Re: [go-nuts] Choosing a framework

2017-09-12 Thread Sam Whited
t tracing) - https://godoc.org/golang.org/x/text/secure/precis (Unicode safety) —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-nuts+unsubs

Re: [go-nuts] Simple web crawler question. How to avoid crawling visited links?

2017-09-24 Thread Sam Vilain
Why not be even more concurrent?Pass "to visit" links to a channel.Reader of channel holds the map, de-dupes and passes to worker channel.Multiple workers dequeue the channel and feed back into the "to visit" channel.SamOn Sep 24, 2017 10:13 AM, Michael Jones wrote:you must remember where you've b

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

2017-09-29 Thread Sam Whited
nd ask questions. Sometimes people are busy, and everyone just wants to make sure Go code remains high quality. Thanks, and good luck! I look forward to seeing your contribution! —Sam [1]: https://go-review.googlesource.com [2]: https://golang.org/doc/contribute.html -- You received this message

  1   2   3   >