Re: [go-nuts] Adding context.Context as first parameter in every function

2024-03-01 Thread Sam Vilain
irly naïve implementation should not slow down code that does not use the context variables at all. I have a proposal in draft at: https://github.com/samv/go-context-proposal Cheers, Sam On 3/1/24 12:40 AM, 'Yash Bansal' via golang-nuts wrote: Hello, I recently started writing code in Golang

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-29 Thread Sam Vilain
texts are passed to a function, or a function really does a lot of juggling of different contexts for use by different functions.  In the cases I've looked at, I have found that there exists a refactoring that aligns the use of the context with a function, and that the resulting code is cleaner.

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-28 Thread Sam Vilain
that includes concerns around backwards compatibility. So back to the initial question: can you give an example of somewhere that a unit test uses context in a way that you predict this proposal will make problematic?  I'd love to explore it to make sure, to make sure the proposal has lots of

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Sam Vilain
just rolled eyes and marked thread as read. Cheers, Sam On 2/20/24 3:35 PM, Axel Wagner wrote: If I may quote myself: > And no matter which choice you make for the language - it means that if the programmers wanted the other, they'd have to jump through annoying hoops and get confusing and

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Sam Vilain
On 2/17/24 1:32 AM, Axel Wagner wrote: On Sat, Feb 17, 2024 at 2:09 AM Sam Vilain wrote: I would argue that the matter can be simply decided by choosing the /calling/ stack, not the destination stack. I agree that this is *one choice*. But the point is, that *sometimes* you'd want

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-16 Thread Sam Vilain
This can be race–free.  Would an implementation of this help move the needle on this, in your view? Cheers & Happy Friday, 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 fro

[go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-16 Thread Sam Vilain
is doing something that can be expensive, and so is worthy of tracing representation with a new Span.  `Span.New()` would be a function that returned a new sub–span of the original Span. Anyway I think that's the nutshell of it. Thoughts/questions/concerns? Cheers, Sam -- You re

Re: [go-nuts] How to test the 'noasm' code?

2023-04-25 Thread Sam Vilain
is defined? (b) is it possible to write assembly functions that avoid the wrapper code, assuming that one follows the platform's calling convention? Sam On Tuesday, 25 April 2023 at 13:48:57 UTC-4 Ian Lance Taylor wrote: > On Tue, Apr 25, 2023 at 10:03 AM Sam Vilain wrote: > > > &

Re: [go-nuts] How to test the 'noasm' code?

2023-04-25 Thread Sam Vilain
w! Cheers, Sam On Tuesday, 25 April 2023 at 11:59:28 UTC-4 Ian Lance Taylor wrote: > On Tue, Apr 25, 2023 at 8:38 AM Sam Vilain wrote: > > > > I have a module that has a couple of assembly functions (for CLZ aka > BSR/LZCNT, which despite widespread availability[1] don't get

[go-nuts] How to test the 'noasm' code?

2023-04-25 Thread Sam Vilain
go:17:6: missing function body ./primitives_asm.go:20:6: missing function body FAIL ... Is this a bug in the compiler, i.e. should "noasm" always be set with "-complete", which disables assembly/C ? Or is there some other way to set 'noasm', like a define flag, that I missed?

Re: [go-nuts] Parsing time with timezones seem to fail

2023-02-13 Thread Sam Vilain
(-4) or Bahrain (+3) See more for yourself on https://www.timeanddate.com/time/zones/ Time Zone Abbreviations - Worldwide List timeanddate.com Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: Why Go has only slice and map

2022-04-12 Thread Sam Hughes
I'm certainly not privy to the nitty-gritty, but I'd encourage you to skim over the Go Dev team meeting notes. It's really cool to see what people have proposed over the years, how the team interacted with it, and ultimately why yes, why no. It's been really educational. The short of it is

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-11 Thread Sam Hughes
I've hit this problems a few times, and I immediately thumbs-upped that issue report. To correct @Ben, I suggest the purest reasoning for an error being displayed is "The process completed, and did not succeed". In your case, @Ben, yeah, it was killed while waiting on something, but the normal

Re: [go-nuts] float exactness

2022-04-11 Thread Sam Hughes
Noting that what @Brian%20Candler just said is bang on, I'll add that if you use `math.Nextafter(y, math.Round(y))` or `y - math.Nextafter(math.Mod(y, 0.01), math.Round(y))`, you can clean up a poorly represented number. The following is Brian's example, but with those two algorithms

Re: [go-nuts] Structured configuration in Go

2022-04-11 Thread Sam Hughes
@Paul%20Jolly, me likey! There's a really clean tokenizer implementation, and if nothing else that's really nice baseline to mimic! On Sunday, April 10, 2022 at 5:36:18 AM UTC-5 Andrew Pillar wrote: > > I think there are two big advantages to making your application > > consume either plain JSON

[go-nuts] Re: YAML Unmarshal changes keys

2022-04-10 Thread Sam Hughes
I skipped over to that package, and the doc says it converts from yaml to json, and the marshals/unmarshals. I tried changing your snippet to use struct tags with the key name as "json" instead of "yaml", and it immediately behaved as expected: https://goplay.tools/snippet/PSZtr1YErD8 While

Re: [go-nuts] Why does Go not have intrinsic functions?

2022-04-07 Thread Sam Hughes
FWIW, I took a stab at a SIMD-oriented feature (https://go.dev/issue/48499), but as @Ian%20Lance%20Taylor put it, it's about the right approach. I skewed too far towards convenience in what I proposed, gaining significant maintainability concerns. On Thursday, April 7, 2022 at 3:35:35 PM UTC-5

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-04-07 Thread Sam Hughes
inced me that >>>>>> the results were worth it. The benefits: A, package interpretation >>>>>> methods >>>>>> with a piece of data, B, lazily valuate data when needed, and C, gain >>>>>> introspective capability specific

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-04-05 Thread Sam Hughes
th anglebrackets - you're supposed to fill >>>>> that in yourself. I think he meant something like: >>>>> >>>>> type fooString struct{ string } >>>>> >>>>> https://go.dev/play/p/4Q94xMZDciV >>>>> >>>

[go-nuts] Re: Why can't an interface type be a receiver

2022-04-05 Thread Sam Hughes
So, for what it's worth: https://karthikkaranth.me/blog/functions-implementing-interfaces-in-go/ Otherwise, yeah. I'd love to be able to define interfaces with extra methods for implementors, but if you arrange your code around "traits", microstructs intended to present a possibly unergonomic

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-04-05 Thread Sam Hughes
t this is doing is *embedding* a string value into a struct; if you >>> have not come across type embedding before then Google for the details. >>> >>> You still cannot use one of these types transparently as a string, but >>> you can use >>>

Re: [go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-04-04 Thread Sam Hughes
: > On Mon, Mar 28, 2022 at 12:39 AM Sam Hughes wrote: > >> @Axel, I really did mean what I said. >> > > So did I. > > FTR, if OP would have asked for changes to the type-system to be able to > represent non-nilable types, my response would have been different

Re: [go-nuts] Tacit Golang?

2022-04-03 Thread Sam Hughes
ould want something like > F(G(H(...)) to return to the call site of F with an erorr, without > executing F or G in case H fails. > > On Apr 1, 2022, at 3:41 PM, Sam Hughes wrote: > > Point-free programming, or "tacit programming", is a convention that > highlights

Re: [go-nuts] Re: Tacit Golang?

2022-04-02 Thread Sam Hughes
Yep. That’s the status quo. My tongue-in-cheek response to that as objection is “If simply sufficient utility for a given task were valid as objection to a new utility, why Go over C?” If you’re not posing that as objection, no need to dwell on it. Yeah. That’s exactly the kind of behavior I want

[go-nuts] Tacit Golang?

2022-04-01 Thread Sam Hughes
Point-free programming, or "tacit programming", is a convention that highlights the intent without syntactic noise. For those unfamiliar, wikipedia: https://en.wikipedia.org/wiki/Tacit_programming I want better function composition. "Write a helper function to route values out to values in,

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-04-01 Thread Sam Hughes
gt; can use > x.string > instead of > string(x) > to extract the value. > > On Friday, 1 April 2022 at 06:48:04 UTC+1 yan.z...@gmail.com wrote: > >> Hi Sam! Your solution does not seem to work: >> >> package main >> >> import( >>

Re: [go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-27 Thread Sam Hughes
s integrated into the type system now (after > a while) feels natural and helpful to me. > > Sam is correct, there is bug in my Go snippet in the post. For humor value > only, I would like to point out that the imaginary Go compiler I was > wishing for would have found that bug! &g

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-03-25 Thread Sam Hughes
My workaround like is something like `type String struct{string}. It can be reasonably treated as a string for most cases in which as string is needed, and it lets you convert back conveniently from any scope in which it's reasonable for your program to know the difference. On Friday, March

Re: [go-nuts] Is there any way to produce etcd watch chan be closed

2022-03-25 Thread Sam Hughes
As written above, if that's the main thread, it is guaranteed to freeze in a deadlock every time. I don't see a goroutine kicked off, so I'm assuming you're trying to run that on the main thread, and you will be 100%, always, forever stuck on the `case wch := <- ach {` line. Channel reads are

[go-nuts] Re: I have just published my iterator library iter_go : migrated for generics

2022-03-25 Thread Sam Hughes
Hey. I'm a rando internet jerk that just wrote you an issue! I know I can't quite use your package, but I did point out an easy improvement I think you could make, that'd make stacking iterators into pipelines a little easier. On Wednesday, March 23, 2022 at 5:14:10 AM UTC-5 Serge Hulne wrote:

Re: [go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-24 Thread Sam Hughes
Totally get where @Michael%20Troy is coming from. TypeScript is aware of logical elements as part of ancestry for the current expression, and provides some helpful warnings in cases where the expression can still be visited with incompatible predicates. @axel, it my feel counter-intuitive, but

Re: [go-nuts] Loading Certificate and Key from string not file for HTTPs server

2021-10-08 Thread Sam Caldwell
> control over timeouts (and also your own mux to prevent leaking debug > handlers). > > In practice you may actually want o use crypt/tls.Config.GetCertificate > instead, to allow your server to update certs from your secret store > without a restart. > > On Friday, Octobe

Re: [go-nuts] Loading Certificate and Key from string not file for HTTPs server

2021-10-08 Thread Sam Caldwell
...@computer.org wrote: > On Mon, Sep 13, 2021 at 3:03 PM Sam Caldwell > wrote: > >> Does anyone have any ideas of an easy path to load certificate and key >> files from a string rather than a file? >> >> *Use Case:* >> 1. traditionally we all put a clea

[go-nuts] Loading Certificate and Key from string not file for HTTPs server

2021-09-13 Thread Sam Caldwell
Does anyone have any ideas of an easy path to load certificate and key files from a string rather than a file? *Use Case:* 1. traditionally we all put a cleartext file on disk with our private key and public certificate. If the server is breached, we just regenerate all the things and move

[go-nuts] Vet this! Proposal for language change to implement destructuring and aggregating assignment

2021-09-13 Thread Sam Hughes
Go is very intent on not implicitly casting types. This makes the expression of a destructuring assignment difficult to imagine in Go. The following represents a proposal to express both destructuring assignment (x,y := ZtoXandY(Z)) and aggregating assignment (x := XfromYandZ(y, z)), across

Re: [go-nuts] Re: Where is the display profile from x/net/idna defined

2021-04-06 Thread Sam Whited
Yes sorry, I mean "where is it documented". The other profiles all list the RFC from which the rules are taken, but this one does not. —Sam On Mon, Apr 5, 2021, at 11:58, jake...@gmail.com wrote: > I'm guessing you want to know where the behavior is documented? That I > do no

Re: [go-nuts] Should reads from a net.Conn be made to respect a context deadline

2021-04-06 Thread Sam Whited
se line). But I take your point about the semantics of the context meaning "cancel this action". —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] Go code review site?

2021-04-04 Thread Sam Whited
It's not official or Go-specific, but you could try: https://codereview.stackexchange.com/ —Sam On Sun, Apr 4, 2021, at 09:20, Tong Sun wrote: > I remember I've been to a page/site where people can ask for review for > their open source projects, commits, etc. > > Is there such

[go-nuts] Should reads from a net.Conn be made to respect a context deadline

2021-04-04 Thread Sam Whited
the function could keep blocking, defying user expectation I've gone back and forth a couple of times on how I'd expect this to behave and I couldn't find any obvious examples in the standard library that would suggest there's a convention so I'd love to get other opinions. —Sam -- Sam Whited

[go-nuts] Where is the display profile from x/net/idna defined

2021-04-04 Thread Sam Whited
where it's defined. Thanks for the help. —Sam [1]: https://pkg.go.dev/golang.org/x/net/idna#Display [2]:https://tools.ietf.org/html/rfc5895 -- Sam Whited -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

Re: [go-nuts] using the xml package with data with complex name spacing

2020-12-14 Thread Sam Whited
_yeast.owl#; because you put that in the tag. If you change the namespace in the struct to the correct one everything will work. —Sam On Sun, Dec 13, 2020, at 22:25, 'Dan Kortschak' via golang-nuts wrote: > I'm needing to consume some XML which has a namespace > identifier reused. --

[go-nuts] Re: Internal Compiler error when building go1.15 using go1.14.4

2020-08-28 Thread Sam Mortimer
is that the 1.15 sources and 1.14.4 > binaries will do no harm to bootstrap. > This is your issue. 1.15 runtime (included within 1.15 sources) will not work with 1.14.4 binaries. Regards, -Sam. -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] draft design for // +build replacement

2020-06-30 Thread Sam Whited
constraints I have to do a find as well. Having one or another but not both would make my life easier in a small but meaningful way. —Sam On Tue, Jun 30, 2020, at 18:56, roger peppe wrote: > One thing I'd really like to see is the eventual deprecation of filename- > based build constraint

Re: [go-nuts] What is empty or nil interface (e.g. interface{})

2020-06-23 Thread Sam Whited
code. —Sam On Mon, Jun 22, 2020, at 22:05, netconnect.m...@gmail.com wrote: > I see this occasionally used as an argument? What's the benefit? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-18 Thread Sam Whited
I should rephrase that, "it's an important discussion *for this community*" and I think it's as important to expose this community to it as it is any other. On Fri, Jun 19, 2020, at 00:20, Ian Lance Taylor wrote: > On Thu, Jun 18, 2020 at 9:04 PM Sam Whited wrote: > > >

Re: [go-nuts] [generics] Replace () with <> or other character

2020-06-18 Thread Sam Mortimer
of separating type parameters in a more visually distinctive way would seem preferable. Regards, -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 gola

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread Sam Whited
, and that is perfectly okay. —Sam On Mon, Jun 15, 2020, at 21:53, sanye wrote: > > Because there are hundreds or thousands of initiatives to support > > suffering and dying people in African, Asian, Eastern European, and > > what else countries that will never be suppo

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Sam Whited
(at least within the United States, I certainly can't speak for everywhere else). —Sam On Mon, Jun 15, 2020, at 10:05, Marvin Renich wrote: > In what way does not having the banner affect how welcome people feel > on the Go lists and websites? As long as the discussions on these > lists

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Sam Whited
If the argument were what specific charity to put in the banner this might be a discussion worth having, however I get the impression that many of these people are arguing against including a banner at all. On Mon, Jun 15, 2020, at 10:04, Robert Engels wrote: > I think a more specific point to be

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Sam Whited
diverse and equitable community, and Go is as much a community of people as it is a language. —Sam On Mon, Jun 15, 2020, at 09:43, Marvin Renich wrote: > My opinion, and the way I interpreted Peter's original post, is that > this banner is extremely inappropriate, independent of its

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Sam Whited
This is an important issue about the Go Community and who feels welcomed here, which is also covered by this mailing list. On Mon, Jun 15, 2020, at 09:18, K Davidson wrote: > Please keep posts limited to things about go. -- You received this message because you are subscribed to the Google

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-15 Thread Sam Whited
awareness march and ask "what's wrong with you, don't you know that all cancers matter?!". Of course you wouldn't. So ask yourself why people are so willing to do that with this issue in particular. —Sam On Mon, Jun 15, 2020, at 08:58, Space A. wrote: > Agree with Peter. It's not the right p

Re: [go-nuts] political fundraising on golang.org!

2020-06-14 Thread Sam Whited
to a respected non-profit, is not, so I still don't understand your point). —Sam On Sun, Jun 14, 2020, at 16:44, Eric S. Raymond wrote: > It is the injection of politics into a list where politics does > not belong. -- You received this message because you are subscribed to the Google

Re: [go-nuts] political fundraising on golang.org!

2020-06-14 Thread Sam Whited
. —Sam On Sun, Jun 14, 2020, at 10:10, Robert Engels wrote: > I agree it is an important social issue, but in this particular case I > believe the funds are directed to specific political parties so the > boundary between supporting social issues and political contributions > is murky. I a

Re: [go-nuts] political fundraising on golang.org!

2020-06-14 Thread Sam Whited
on this already and who often are dismissed by the very people who need to hear their message, is part of the problem. We don't want to be part of the problem, so let's do our part, however small, with the platforms we have. —Sam -- You received this message because you are subscribed to the Google

[go-nuts] Re: GO on multi-processor systems

2020-06-10 Thread Sam Mortimer
On Wednesday, June 10, 2020 at 1:03:41 PM UTC-7, joe mcguckin wrote: > > I read somewhere that the default # of GO threads is the number of cores > of the cpu. > > What about where there are multiple cpus? My servers have 2, 6 core > Xeons. With hyper threading, it looks like 24 cores available

Re: [go-nuts] Re: gzip.Reader.Read does not fill the given buffer

2020-06-09 Thread Sam Whited
implement buffering on top of it, etc. It's probably pretty rare that you actually want to use ReadFull, or at least, I don't find myself reaching for it very often. —Sam On Tue, Jun 9, 2020, at 12:51, Amit Lavon wrote: > Thank you!! io.ReadFull is just what I needed (and what I actua

Re: [go-nuts] compress/bzip2:Why is there only a decompression function, no compression function.

2020-06-08 Thread Sam Whited
See: https://github.com/golang/go/issues/4828 On Mon, Jun 8, 2020, at 05:09, lziqia...@gmail.com wrote: > Why is there no bzip2 compression algorithm, what is the reason? Do you > need to add it? —Sam -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-23 Thread Sam Whited
or similar techniques, but these could break at any moment and you should avoid them at all costs. —Sam On Sat, May 23, 2020, at 15:34, adithyasasha...@gmail.com wrote: > Is there a way to create a global variable inside go routine stack? so > that i can access any time, without passing around b

Re: [go-nuts] Benchmarking code that mutates its input data

2020-03-18 Thread Sam Whited
that but we don't want that setup to > show in the timing for the benchmark. > > Does anyone know of a solution to this? Just call b.ResetTimer() after setting up your data: https://godoc.org/testing#B.ResetTimer —Sam -- Sam Whited -- You received this message because you are

Re: [go-nuts] Re: RFC Package structuring

2020-03-03 Thread Sam Whited
sioned. For example, I keep a separate module for "example" or "demo" directories so that their dependencies don't wind up in my libraries go.mod file. This isn't a problem though because I'll never tag or version the demos, they're just there to give you an example of how to use t

Re: [go-nuts] Question about the zero-value design: Why pointers zero value is not the zero value of what they points to?

2020-02-17 Thread Sam Whited
I think you need to run your example; the behavior is the same: trying to make an assignment to the non-nested map will panic contrary to what your comment says. > panic: assignment to entry in nil map —Sam On Mon, Feb 17, 2020, at 10:35, Michel Levieux wrote: > Hi Kloster08, > >

Re: [go-nuts] Question about the zero-value design: Why pointers zero value is not the zero value of what they points to?

2020-02-14 Thread Sam Whited
The zero value is a zeroed chunk of memory with the given type. If the zero value of the pointer were a pointer to something else, that something else would have to be allocated and pointed too and the pointer itself would lose the nice property of being a zeroed chunk of memory (it wouldn't be a zer

Re: [go-nuts] Requesting help with the code

2020-01-27 Thread Sam Whited
nt to use one of the formatting functions, for example: fmt.Printf("%f Degrees to Fahrenheit is = %f\n", Degrees, fahrenheit) For more information, see the fmt documentation: https://godoc.org/fmt —Sam -- Sam Whited -- You received this message because you are subscribed

Re: [go-nuts] Is it possible to get code coverage information in a way that does not assume you can see color?

2020-01-09 Thread Sam Whited
hout any other way of identifying > uncovered lines. The title text of lines that are covered is "1" and the title text of lines that are not covered is "0". This isn't ideal, but maybe you could feed the HTML through a program that would rewrite this to something visible to

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

2019-12-16 Thread Sam
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] tell

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
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 Whited -- You

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

2019-10-11 Thread Sam Whited
set, it should default to being on. https://github.com/go-resty/resty/blob/v2.0.0/go.mod —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-

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

2019-10-11 Thread Sam Whited
annoying, but we're stuck with it, unfortunately. —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. To v

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

2019-10-01 Thread Sam Whited
ations from a folder or embedded filesystem (eg. using statik [2] or pkgzip [3]). Currently it is compatible with Diesel and supports PostgreSQL, but it could likely be made to support whatever you're using easily enough. —Sam [1]: https://godoc.org/code.soquee.net/migration [2]: https://god

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

2019-09-20 Thread Sam Whited
by far the simplest solution that won't lead to headaches later. —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

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

2019-09-10 Thread Sam Whited
that they now have to jump through hoops to use your library. —Sam On Tue, Sep 10, 2019, at 13:10, Darko Luketic wrote: > The answer is apparently > https://github.com/gin-gonic/gin/issues/2039#issuecomment-527997733 > > > Add this to your go.mod file: `replace github.com/ugorji/go v1.1.4 &g

Re: [go-nuts] Existing production-ready libraries for parallelizing HTTP requests?

2019-08-20 Thread Sam Fourman Jr.
I am also in the same boat as tom, there is certainly a demand for this type of library. -- Sam Fourman On Tue, Aug 20, 2019 at 3:33 PM 'Thomas Bushnell, BSG' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I am of the opinion that a case like this is best handled by simply

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 re

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

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://godo

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

2019-07-15 Thread Sam Whited
GitHub, but they likely have an email. This is probably the best place to push back against Google slowly reeling in Go and trying to more tightly couple it with the corporation. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

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

2019-07-15 Thread Sam Whited
ontributors". 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 "golang-nuts&q

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 the link! —Sam

[go-nuts] Simple web components and other libraries

2019-07-12 Thread Sam Whited
ey 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, send an email to golang-nuts+unsubscr...@googl

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

2019-07-12 Thread Sam Whited
ht put into it; an actual proposal would need a lot more work than what I've done here to make sure it's complete and integrates well with the rest of the language. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

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

2019-07-12 Thread Sam Whited
it about how union or sum types would work in Go using a similar syntax. My initial thoughts are here in case this is of interest to anyone else: https://blog.samwhited.com/2019/06/go-and-sum-types/ —Sam -- You received this message because you are subscribed to the Google Groups "golang

[go-nuts] Re: Want to know differance between two code snippets defined here

2019-06-06 Thread Sam Mortimer
I suspect it's the classic that I think everyone does at least once - in the second code block the for loop reuses the same storage on each iteration for the variable site. Try adding: site := site ..just before your append to verify this. Cheers, -Sam. On Thursday, June 6, 2019 at 6:49:00

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

2019-05-29 Thread Sam Whited
be in charge of the Go team in 10 or 20 years, and they may be less principled than the current team. We also don't know how Google will have changed, or what kinds of pressures might be put on the Go team from a future over- zealous Google executive who wants a hand in the proposal process

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

2019-05-26 Thread Sam Whited
lished it as "code.soquee.net/pkgzip" in case it's useful to you or anyone else here. The repo will likely move once SourceHut supports separate organizations, but the vanity import will remain the same. —Sam P.S. Note that this package was just thrown up and DNS may not have propa

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

2019-05-23 Thread Sam Whited
'm certainly glad they did this, but most people will never change the default options (or won't even know to change the options since this behavior is silent) and the main proxy and sum file service is owned by Google. —Sam -- You received this message because you are subscribed to the G

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

2019-05-23 Thread Sam Whited
I apologize for the rambling nature of this post; I somehow sent this while working on a revision, I should really figure out what keyboard shortcut I keep accidentally hitting to do that, especially when I haven't toned down the language yet. Oh well, please pardon the lack of polish. —Sam

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

[go-nuts] Re: Go documentation - how to determine what implements an interface?

2019-05-15 Thread Sam Mortimer
There is guru ( https://docs.google.com/document/d/1_Y9xCEMj5S-7rv2ooHpZNH15JgRT5iM742gJkw5LtmQ/edit) but it's intended for editors not humans. I suppose that means perhaps you could use one of the editors that uses guru ? Regards, -Sam. src/io/io.go:#5381 is where io.ReadSeeker is defined

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

2019-04-25 Thread Sam Whited
m. If you allow people to do that, they'll end up trying to nest it 5 levels deep. Go tries not to give people the tools to shoot themselves in the foot for some tiny perceived advantage. —Sam -- You received this message because you are subscribed to the Google Groups "golang-nuts&

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

2019-04-22 Thread Sam Whited
ry 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 subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

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

2019-04-22 Thread Sam Whited
e 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://godoc.org/golang.org/x/crypto/arg

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

2019-04-11 Thread Sam Whited
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 it, send an em

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

2019-03-24 Thread Sam Whited
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 an email

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

2019-03-19 Thread Sam Whited
ething 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 -- You receive

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

2019-03-19 Thread Sam
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 Personal C

[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_MACHINE,

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

2019-03-19 Thread Sam
1: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 th

[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

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

  1   2   3   >