Re: [go-nuts] Re: Looking for a specialized proxy package

2023-03-16 Thread Matthew Zimmerman
: > Thanks, Matthew. I know what RPC is, but have never considered it as a > way to serve http from behind a NAT. I should say that the IOT's are part > of a product that's been in the market for several years. My client likes > the web interface we built and wants users t

Re: [go-nuts] Re: Looking for a specialized proxy package

2023-03-15 Thread Matthew Zimmerman
Honestly I'd probably use grpc and keep a constant connection from the IOT to the cloud. No ports/services required on the client at all and the server can still request things in real time. Like: https://www.talentica.com/blogs/part-3-building-a-bidirectional-streaming-grpc-service-using-golang/

Re: [go-nuts] Struggling w/ use of a waitgroup

2022-10-02 Thread Matthew Zimmerman
First reason I notice, if there's an error opening your file, wg.Done() is never called. On Sun, Oct 2, 2022, 1:36 PM Robert Solomon wrote: > https://go.dev/play/p/gIVVLsiTqod > > I'm trying to understand concurrency, so I modified a small routine I came > across quite a while ago. It's a grep

Re: [go-nuts] cannot convert fs.FS zip file to io.ReadSeeker (missing Seek)

2022-09-21 Thread Matthew Zimmerman
I've got this same challenge. The contents of any file within a zip needs to be read as a stream, hence why there is no underlying seek method available (assuming to handle the decompression properly) So if you want to seek in a file within a zip, you need to read into a buffer first. You don't h

Re: [go-nuts] [gofrontend] Generics support?

2022-04-14 Thread Matthew Singletary
Thanks Ian! On Thu, Apr 14, 2022 at 2:29 PM Ian Lance Taylor wrote: > On Thu, Apr 14, 2022 at 3:51 AM Lanzhiguan Huang > wrote: > > > > Just curious about will the gofrontend support generics or it is > already supported? > > I'm working on it, but it's going slowly. > > Ian > > -- > You re

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-09 Thread Matthew Walster
On Wed, 9 Feb 2022 at 23:36, E Z wrote: > I noticed a phenomenon while maintaining my golang application, the local > timezone of the application always keep the value when it starts, the local > timezone will not change even though I change the system timezone. It looks > like the golang time pa

Re: [go-nuts] Does crypto/AES work on hardware that doesn't have the aes instruction set? Hello, Will crypto/aes, cipher/GCM work on hardware without embedded aes support?

2021-12-03 Thread Matthew Walster
Whoops, yes, there is a feature flag there I missed "supportsAES" etc. It appears to be gated on that instruction being present, at which time the operation becomes roughly constant time. M On Fri, 3 Dec 2021, 08:53 Matthew Walster, wrote: > Sure, it's enabled in

Re: [go-nuts] Does crypto/AES work on hardware that doesn't have the aes instruction set? Hello, Will crypto/aes, cipher/GCM work on hardware without embedded aes support?

2021-12-03 Thread Matthew Walster
Sure, it's enabled in a build constraint: https://cs.opensource.google/go/go/+/refs/tags/go1.17.3:src/crypto/aes/cipher_asm.go It's not an exact science, there's no testing for the instruction afaict, it's just that anything running the amd64 architecture has the aesni instructions. I assume like

Rp6thoe: [go-nuts] How to implement this in golang?

2021-06-29 Thread Matthew Winfield
I'm getting ready to submerge myself into coding python java c++ all of it I could use some pointers as to methods and tips On Tue, Jun 29, 2021, 6:27 AM LetGo wrote: > I have a proxy written in python with some logic that I would like to > implement in a golang tool of mine, but I don't really

[go-nuts] Inverting a template

2021-03-24 Thread Matthew Walster
ut some hideous regex? Is that something that's possible with the template package that I haven't discovered? Matthew Walster -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] About the efficency of modifying map elements.

2021-03-17 Thread Matthew Holiday
Isn't this really just another form of issue 3117 ? On Wed, Mar 17, 2021 at 3:19 PM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Wed, Mar 17, 2021 at 10:06 PM tapi...@gmail.com > wrote: > >> For simple scenarios, compiler op

Re: [go-nuts] Go PostgreSQL? pg versus pgx

2021-02-22 Thread Matthew Holiday
b 22, 2021 at 7:56 AM Paul Förster wrote: > Hi Matthew, > > > On 22. Feb, 2021, at 15:28, Matthew Holiday > wrote: > > > > From the "status" section at the bottom of the README for pq: > > > > "This package is effectively in maintenance mode

Re: [go-nuts] Go PostgreSQL? pg versus pgx

2021-02-22 Thread Matthew Holiday
>From the "status" section at the bottom of the README for pq: "This package is effectively in maintenance mode and is not actively developed. Small patches and features are only rarely reviewed and merged. We recommend using pgx which is actively maintained." On Mon, Feb 22, 2021 at 7:19 AM Paul

Re: [go-nuts] Error handling

2021-02-20 Thread Matthew Holiday
ou know by looking at the code, or even compiling the > code, that all possible errors returned by a function are handled? That to > me is biggest difficult in reading (or using) others Go code. Exceptions > (well written) handle this by declaring all possible error (or categories) >

Re: [go-nuts] Error handling

2021-02-20 Thread Matthew Holiday
Roger beat me to it. But allow me to rephrase, "The users of Go for a long time have resisted any changes to its simple, clear method of error handling despite it being a major concern of folks who don't use Go much." * * I'm referring to the original survey, which was worded along the lines of

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-05 Thread Matthew Holiday
See also this graphical cheat sheet: https://ueokande.github.io/go-slice-tricks/ On Fri, Feb 5, 2021 at 2:09 AM Brian Candler wrote: > See: https://github.com/golang/go/wiki/SliceTricks#delete > (and lots of other neat tricks there). > > There's no need to add new syntax or functions when the ex

Re: [go-nuts] Code compiles with unused var block

2021-02-03 Thread Matthew Holiday
You are correct sir, and unfortunately, go vet doesn't find it either. But if you lint your code with golangci-lint ( https://github.com/golangci/golangci-lint) the deadcode linter will find it for you. On Wed, Feb 3, 2021 at 9:35 AM Danny Hart wrote: > Hello all, > > Very new gopher here (also

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Matthew Zimmerman
3, 2020 at 11:43 PM Robert Engels >> wrote: >> >>> Yes, that is why you need to create your own protocol. Use the gob to >>> encode to a buffer then send the buffer on each of the connections using >>> your protocol. >>> >>> On Dec 23, 202

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Matthew Zimmerman
My understanding is that gob streams are unique. >From https://golang.org/pkg/encoding/gob/ "A stream of gobs is self-describing. Each data item in the stream is preceded by a specification of its type, expressed in terms of a small set of predefined types." In my own rudimentary understanding/te

[go-nuts] Why must a HTTP handler not modify the request?

2020-10-30 Thread Matthew Byrne
The net/http documentation says "Except for reading the body, handlers should not modify the provided Request". I am writing a proxy and I would like to know more about why this is forbidden. Is it just a matter of good hygiene or is there a risk of something more serious like a race condition

Re: [go-nuts] Using GTSM with GRPC

2020-07-23 Thread Matthew Walster
m open to suggestions for alternative ways of preventing that connection from being DoSed. Matthew Walster -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: [go-nuts] What should be a silly protoc golang question

2020-07-22 Thread Matthew Walster
t; generates it inside the proto's directory with a directory structure like: > Have you tried using an option like: --go_opt=paths=source_relative Matthew Walster -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscri

[go-nuts] Using GTSM with GRPC

2020-07-22 Thread Matthew Walster
e the TCP AO (RFC5925) instead, but considering that GRPC (via MTLS) gives me all the authentication I need for the data, that seems overkill and prone to opaque issues. I'm essentially only worried about spoofed packets coming in trying to reset the TCP connection. Open to any suggestions, many than

Re: [go-nuts] Re: Json Parse Data [unexecpted non whitespace 1 to 28]

2020-04-28 Thread Matthew Zimmerman
Ali, that demo doesn't run given there's no http environment in the playground. I assume this issue is not HTTP specific. Something more like this (obviously change your data where it doesn't parse what you want): https://play.golang.org/p/RACYspxInyA Also, please don't store or recreate passwor

Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Matthew Zimmerman
Reported, thank you! https://github.com/golang/go/issues/38624 On Thu, Apr 23, 2020 at 12:16 PM Ian Lance Taylor wrote: > On Thu, Apr 23, 2020 at 7:30 AM Matthew Zimmerman > wrote: > > > > I was really confused by this error for ~10 minutes or so. Usually when > this ha

[go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Matthew Zimmerman
I was really confused by this error for ~10 minutes or so. Usually when this happens to me, I missed a closing/opening brace somewhere or I forgot to add () after my anonymous function declaration to actually run it. This time though all the braces were lining up and I had () there appropriately.

Re: [go-nuts] Re: escape analysis question

2020-03-05 Thread &#x27;Matthew Dempsky' via golang-nuts
Some of the issues in that doc should be addressed now (e.g., the first two), but the "Assignment to indirect escapes" case still applies. The issue here is we don't do any points-to analysis during escape analysis, so we conservatively assume "*p = x" might assign x to the heap. Ideally, I think

[go-nuts] JSON Encoding partial

2020-02-14 Thread Matthew Zimmerman
I have a fairly complex struct that I'm using the mongo driver ( github.com/mongodb/mongo-go-driver) to create/maintain/manage schema inside mongodb. So the bson encoder (I have bson and json tags) works great on this same exact struct. I am now also trying to encode this same struct into JSON fo

Re: [go-nuts] net.conn TCP connection

2019-12-27 Thread Matthew Zimmerman
https://golang.org/pkg/io/ioutil/#ReadAll That might be what you want but if you don't know how big it's going to be, you're also easily able to run out of memory. On Fri, Dec 27, 2019, 7:11 PM wrote: > I am looking for a net.conn standard read that would return a data buffer > the exact size o

[go-nuts] Re: mutual TLS authentication (sometimes)

2019-11-20 Thread Matthew Zimmerman
How did I miss that?! Awesome, thanks! On Wed, Nov 20, 2019 at 4:17 AM Anthony Martin wrote: > Matthew Zimmerman once said: > > I've also thought about authenticating on a different domain name > > auth.service then redirecting to data.service or something like that &g

[go-nuts] mutual TLS authentication (sometimes)

2019-11-19 Thread Matthew Zimmerman
I can authenticate users via certificate with tls.Config and RequireAndVerifyClientCert to my CA, that's working just fine. What I'd like to do however is to *only* require and verify the cert if they don't have a valid session cookie. I know that the session is only available after TLS, but the

Re: [go-nuts] Migrating Google App Engine Go app to Go 1.12

2019-09-30 Thread Matthew Zimmerman
My notice said that apps continue to run, you just can't deploy new versions. "Starting on October 1, 2019, as per our deprecation policy , you will

[go-nuts] Previewing Go Docs with Modules

2018-12-21 Thread matthew . ouille
Hey all, I've been using modules for quite some time now. One of the hangups I have is previewing what my godocs will look like. Does anyone know of a way that I can do this, or if I can get godoc to let me view my packages that are module aware? Thanks! -- You received this message because y

Re: [go-nuts] Memory limits

2018-11-21 Thread Matthew Zimmerman
didn’t feel right, but maybe Gos lack of >> generational GC is a real stumbling block here. >> >> On Nov 16, 2018, at 11:58 AM, Matthew Zimmerman >> wrote: >> >> What are the current memory limits? I know it used to be 512gb. Is >> there a difference bet

[go-nuts] Memory limits

2018-11-16 Thread Matthew Zimmerman
What are the current memory limits? I know it used to be 512gb. Is there a difference between the platforms? I couldn't find documentation on this. Thanks! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] invalid months and years in time package

2018-10-23 Thread Matthew Singletary
I believe that the normalization going on is assuming that the date is valid, but the pieces representing that date might individually be invalid. Date validation is usually for building a valid date, but if you know the date is valid (even if the parts aren't), then you can skip validating the par

[go-nuts] Effective Go recommends reading the language specification first

2018-01-16 Thread matthew
It strikes me as odd that Effective Go recommends reading the language specification first. "This document gives tips for writing clear, idiomatic Go code. It augments the language specification, the Tour of Go, and How to Write Go Code, all of which you should read first." Is that really good

Re: [go-nuts] Combine low traffic website

2017-12-09 Thread Matthew Zimmerman
You can also code both sites in one go binary then use the sni TLS extension to determine which website to display. This is exactly how Caddy and every other reverse proxy does it. On Fri, Dec 8, 2017, 11:33 PM Andrew wrote: > Thanks, I'll try Caddy first. > > -- > You received this message bec

[go-nuts] Re: GO Syntax Coloring for BBEdit and TextWrangler

2017-11-08 Thread matthew . boehm
This does not recognize struct methods. Can you improve it? Example: func (p *MyClass) DoSomething(p string, i int) { ... } On Wednesday, November 11, 2009 at 9:54:23 PM UTC-6, ajstarks wrote: > > Here is the Codeless language Module used by BBEdit and TextWrangler > that will provide syntax col

Re: [go-nuts] How to send a POST request from http.Redirect?

2017-10-28 Thread Matthew Zimmerman
I don't believe there are any browsers that support doing this. On Sat, Oct 28, 2017, 3:33 PM Valentin Vidic wrote: > On Fri, Oct 27, 2017 at 09:04:25PM -0700, hkang.sun...@gmail.com wrote: > > I have a question about sending POST request through the http.Redirect > > function. > > The following

Re: [go-nuts] Help with mapping XML to struct

2017-07-14 Thread Matthew Zimmerman
Chidley worked great for me -- https://github.com/gnewton/chidley On Fri, Jul 14, 2017 at 9:37 PM Matt Harden wrote: > The sample document you gave actually doesn't have any attributes at all. > I guess you meant namespaces? > > Are you leaving out the namespace declarations from your sample? Th

Re: [go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-12 Thread Matthew Zimmerman
Why not use struct{}? Is what is recommended for maps to notate a set (only the keys mean something). https://play.golang.org/p/fxtEWejqdh On Tue, Jul 11, 2017, 11:34 PM Rader wrote: > I found the position of `[0]byte` in the struct matters. > type bar2 struct { > A int > _ [0]byte > } > > di

Re: [go-nuts] Go Fonts: request for feedback

2017-02-03 Thread Matthew Singletary
I would just like to say as a user, the fonts are great and i appreciate that they are continuing to work on them at all. Thanks B&H! On Feb 2, 2017 7:25 PM, "Nigel Tao" wrote: Bigelow & Holmes, the designers of the Go Fonts, are preparing an update to those fonts. The changes so far are: • ad

Re: [go-nuts] Memory Limits in Go

2017-01-28 Thread Matthew Zimmerman
I love this. I write some data analysis code and for ease of development and speed I keep the tables I build in memory. Generating those tables takes lots of memory and CPU, so I disabled the GC and manually run GC when the runtime memory stats start to get close to the system limit. Seems to be w

Re: [go-nuts] fmt verb to single quote text

2017-01-05 Thread Matthew Singletary
If you are using it in a fmt string (like your example), you can use the '%q' formatting verb (like this example ). On Thu, Jan 5, 2017 at 11:45 AM bsr wrote: Please see the example https://play.golang.org/p/SeG7oO5Us0 I am doing some javascript codegen a

Re: [go-nuts] gob ignores default values, bug or feature?

2016-12-10 Thread Matthew Zimmerman
Yes, it makes them smaller I agree, however shouldn't the lack of a value on decoding be considered like a zero value was encoded? I think that is the question here. On Sat, Dec 10, 2016, 4:14 AM Jesse McNelis wrote: > On Sat, Dec 10, 2016 at 5:49 PM, Hoping White > wrote: > > Hi, all > > > >

[go-nuts] Gomobile vendoring?

2016-09-07 Thread Matthew Erickson
Hello everyone, We've been running into a vendoring issue regarding our toolset recently. Namely, breaking changes to gomobile will happen within one of our release cycles (such as https://github.com/golang/mobile/commit/2f75be449fbada35ca42f481f9878ba7f02a7e7d ), and cause our builds to bre

Re: [go-nuts] convert a given time in one Timezone to other TimeZone

2016-08-10 Thread Matthew Zimmerman
I don't understand your question, but maybe this helps? https://github.com/mzimmerman/tt On Wed, Aug 10, 2016 at 9:50 AM wrote: > I was trying to find the solution to get a given time in timezone1 using > the time in timezone2. > > Have solution to get the time in other timezone for current tim

Re: [go-nuts] Re: goimports has been updated

2016-07-15 Thread Matthew Singletary
Thanks Brad! -- 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] net/smtp Client.hello() returns a single error and drops the ehlo error entirely

2016-07-05 Thread &#x27;Matthew Altman' via golang-nuts
Should I perhaps create a github issue to address this? On Friday, July 1, 2016 at 3:16:24 PM UTC-6, Ian Lance Taylor wrote: > > On Fri, Jul 1, 2016 at 1:17 PM, 'Matthew Altman' via golang-nuts > > wrote: > > https://github.com/golang/go/blob/master/src/net/smtp/sm

Re: [go-nuts] net/smtp Client.hello() returns a single error and drops the ehlo error entirely

2016-07-01 Thread &#x27;Matthew Altman' via golang-nuts
I believe it can. MTAs are highly configurable to return any sort of errors and/or disconnects on various conditions, thus the postfix smtp-sink capabilities to test out all of those settings, and that's how we encountered this issue. *Matthew Altman* *Sr. Software Engineer* On Fri,

[go-nuts] net/smtp Client.hello() returns a single error and drops the ehlo error entirely

2016-07-01 Thread &#x27;Matthew Altman' via golang-nuts
https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L76-L79 This method can make two distinct SMTP calls. First an EHLO and then a HELO. If the EHLO fails it attempts HELO. However, if the connection was closed remotely after EHLO the HELO will of course also fail but the error message

[go-nuts] net/smtp Client.hello() prematurely sets didHello

2016-07-01 Thread &#x27;Matthew Altman' via golang-nuts
When calling Client.hello(), and the smtp server returns a failure code (this can be reproduced via postfix smtp-sink and a flag of -r HELO,EHLO) another attempt at a Hello is not possible. https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L75 shows that the didHello flag is set bef