[go-nuts] Re: golang as ML backend v/s C++

2024-04-14 Thread Matt Parker
- python -> c++ is one less layer of complexity to reason about than python -> c -> go - the go runtime is great for developer ergonomics, but is going to cost more flops than equivalent code in c++ because of features like garbage collection. additionally the concurrent features of go are great

Re: [go-nuts] Is json.Marshal deterministic?

2024-04-14 Thread Matt Parker
one of my favorite examples of this is google's protojson package, where the output of `json.Marshal` is [deliberately nondeterministic](https://protobuf.dev/reference/go/faq/#unstable-json) to prevent users from attempting to rely on that property On Tuesday, April 9, 2024 at 9:10:42 AM UTC-4 N

Re: [go-nuts] Help me study resources or guides

2023-04-28 Thread Matt KØDVB
You can find my video class at https://www.youtube.com/playlist?list=PLoILbKo9rG3skRCj37Kn5Zj803hhiuRK6; people seem to like it Matt > On Apr 26, 2023, at 9:45 PM, Nyilynn Htwe wrote: > > I am starting to learn GO programming language with this course > <https://w

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
does. In fact > the JVM supports dynamic dispatch to make this as efficient as possible. > Then the JIT optimizes it even more based on runtime behavior. > > On Nov 22, 2022, at 10:18 AM, Matt KØDVB wrote: > >  > But see https://en.wikipedia.org/wiki/Self_(programming_language) &g

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
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 view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/A

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
The correct answer is actually “yes” because neither classes nor inheritance are necessary or sufficient for “object-oriented” programming. https://www.youtube.com/watch?v=jexEpE7Yv2A Sent from my iPad > On Nov 22, 2022, at 9:02 AM, Ayan George wrote: > >  > > The Go FAQ begins the answer t

Re: [go-nuts] BUGFIX-66: Algorithmic Puzzles in Go

2022-11-13 Thread Matt Harden
Sounds fun! Go doesn't prevent race conditions and those can result in undefined behavior, so I don't think you're safe just restricting imports and limiting CPU and memory. You need to run code in a sandbox of some sort. I would look at what the Go playground does. On Fri, Nov 11, 2022, 10:47 BU

[go-nuts] Who are the Go maintainers?

2022-11-09 Thread Matt Hickford
https://go.dev/doc/contribute says "Only Go maintainers (also referred to as “approvers”) can cast a +2 vote." Who are the Go maintainers? Is this the same set of people as https://github.com/orgs/golang/people (seems to be mostly Googlers and ex-Googlers)? Or a subset? -- You received this mess

[go-nuts] [Discussion] Apache Arrow/Parquet and Go

2022-09-14 Thread Matt Topol
out to the Go Slack and tagging on Twitter and LinkedIn, but haven't had much luck getting any responses. I'm hoping I can get more engagement on this mailing list and find some great use-cases I can incorporate into examples or tutorials for the talk. Thanks very much to all who resp

[go-nuts] Type switch on generic parameter

2022-08-11 Thread &#x27;Matt Rosencrantz' via golang-nuts
le? Thanks! Matt -- 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 view this discussion on

[go-nuts] Re: [unicode] Missing Katakana runes in rangetable?

2022-06-27 Thread Matt Sherman
Ah, I was barking up the wrong tree on this, please disregard. It’s an extending character, which by itself (I infer) is not categorized as Katakana. On Monday, June 27, 2022 at 10:51:07 PM UTC-4 Matt Sherman wrote: > Hi there, I stumbled across a surprising discovery that > unic

[go-nuts] [unicode] Missing Katakana runes in rangetable?

2022-06-27 Thread Matt Sherman
Hi there, I stumbled across a surprising discovery that unicode.Is(unicode.Katakana, 'ー') returns false. This is code point U+30FC, and appears in the Katakana code block . Looking at the rangetable

[go-nuts] How to skip over or fix type-checking errors in the standard library?

2022-05-18 Thread Matt Mueller
f you need any additional information or code. Thanks! Matt -- 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.co

[go-nuts] Tracing across local subprocesses?

2022-02-17 Thread Matt Mueller
Hi there, I was wondering if anyone has a solution for tracing across local subprocesses in Go? Can the standard library do this somehow? OpenTelemetry seems a bit overkill for this use case. Thanks! Matt -- You received this message because you are subscribed to the Google Groups "g

[go-nuts] Looking for New Maintainers: The Gorilla Toolkit

2021-12-12 Thread Matt Silverlock
ing-a-github-repository/archiving-repositories> the repos. Please reply on GitHub if you're interested in getting involved: https://github.com/gorilla/mux/issues/659 Cheers, Matt -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] Anyway to wrap or tweak a test file before running go test?

2021-11-03 Thread Matt Mueller
Hey, thanks. I'm aware of this approach. I'm hoping for some technique that automatically injects, since it can be cumbersome to inject all your dependencies by hand. Similar to google/wire, but without the generated file sitting in the filesystem next to your test. Matt On

[go-nuts] Re: Go on AWS Lambda?

2021-11-03 Thread Matt Mueller
and you prefer writing your backend code in Go over the other options. Two libraries that make deploying Go functions to AWS very easy: - https://github.com/apex/up - https://github.com/apex/apex (deprecated but still works great) Hope this helps, Matt On Tuesday, November 2, 2021 at 8:43:0

[go-nuts] Anyway to wrap or tweak a test file before running go test?

2021-11-03 Thread Matt Mueller
uld either manipulate the file in memory and pass it to go test, or wrap it somehow in a separate go test file someplace else. I'm trying to make this as transparent to the developer as possible. Just like how go test works. Any ideas? Thanks! Matt -- You received this message because yo

Re: [go-nuts] Right way to fan out work loads

2021-09-08 Thread Matt KØDVB
com/watch?v=SPD7TykYy5w> In it I explain how to manage/limit concurrency when the work is I/O bound (which is your case). Matt > On Sep 7, 2021, at 6:36 PM, David Belle-Isle wrote: > > > Hi, > > I've been facing this question for a while and never managed to find the &

[go-nuts] Re: Is there a workflow engine written in GO

2021-08-11 Thread Matt Bragaw
GitHub - uber/cadence: Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way. On Thursday, October 26, 2017 at 6:56:40 AM UTC-7 nma...@gmail.com

Re: [go-nuts] string matching

2021-04-01 Thread Matt KØDVB
Use a capture group regex := regexp.MustCompile(`.*\bCore Count: (\d+)`) result := regex.FindAllStringSubmatch(raw, -1) https://play.golang.org/p/r_TxhVZVfzE See also https://www.youtube.com/watch?v=XCE0psygwj8 > On Apr 1, 2021, at 12:32

Re: [go-nuts] Help with tcpserver

2021-03-30 Thread Matt Harden
Why are you using channels for this? I see some issues in the code, but without knowing what you're actually trying to accomplish, it's hard to give advice. To do exactly what you described, I would simply change handleDeviceConnection() to look similar to this: func handleDeviceConnection(c net.

[go-nuts] What's the BUG in the flag package?

2021-03-24 Thread Matt Mueller
. Any ideas what the bug could be? Maybe this can be removed and I should open a PR? Thanks! Matt -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to g

Re: [go-nuts] What does `go install path/to/main.go` do with GO111MODULE=on?

2021-03-10 Thread Matt Mueller
TC+1 Kurtis Rader wrote: > Do you have environment var GOBIN set? Check the output of "go env GOBIN". > See https://golang.org/ref/mod#mod-commands. > > On Wed, Mar 10, 2021 at 2:59 PM Matt Mueller wrote: > >> Hey folks, >> >> I'm trying to install a c

[go-nuts] What does `go install path/to/main.go` do with GO111MODULE=on?

2021-03-10 Thread Matt Mueller
nymore. It doesn't error, but I don't know where it installed the binary. Not in $GOPATH/bin. I've read the documentation for `go help install`. It pointed me to `go help modules`, but then I got lost after that. Any pointers would be greatly appreciated. Thanks! Matt -- You rece

Re: [go-nuts] Few questions regarding Generics

2021-02-22 Thread Matt KØDVB
Make Map a function not a method (not sure it can be made a method they way you’re trying): package main import ( "fmt" "strconv" ) type List[T any] []T func ToList[T any](v []T) List[T] { return List[T](v) } func Map[T, U any](l List[T], f func(v T) U) List[U] {

[go-nuts] [ANN] New Go video course on YouTube

2021-02-21 Thread Matt KØDVB
I've just completed my project to make a recording of my Go class and the videos are all now available (ad-free) on YouTube: https://www.youtube.com/playlist?list=PLoILbKo9rG3skRCj37Kn5Zj803hhiuRK6 This class is suitable for folks who already know how to program in another language.It covers th

[go-nuts] Recommendation for Fuzzed Types without Native On-Disk Format

2021-02-08 Thread Matt Proud
e should be an obvious choice under my nose that I am somehow omitting. And no, I don't want testing/quick for this, even though it can generate plenty of complex composite types at runtime. With warm regards, Matt T. Proud -- You received this message because you are subscribed to t

Re: [go-nuts] Unsupported File Format error while building for linux-amd64 on mac os

2021-01-05 Thread Matt Joiner
I found this, which worked without GOPATH assumptions: https://blog.filippo.io/easy-windows-and-linux-cross-compilers-for-macos/ On Monday, 1 October 2018 at 7:32:23 pm UTC+10 Ankit Gupta wrote: > Tamas, > > I installed docker on mac and cross compiled using xgo like you suggested. > Worked per

Re: [go-nuts] Looking for a Go-Lang Developer

2020-12-23 Thread Matt Harden
Since Go version 1.0 was not released until March 2012, you might find it hard to find people with 10 years of experience with it. On Wed, Dec 23, 2020 at 1:07 PM Kavya S wrote: > Hi Everyone, > > Happy Holidays! > > Urgent requirement for a GO Language Developer with 7-10 years of > experience

Re: [go-nuts] Performance issue with os.File.Write

2020-12-23 Thread Matt Harden
On Tue, Dec 22, 2020 at 11:21 AM komuW wrote: > The bufio package also uses a max buffer of 64KB: > https://go.googlesource.com/go/+/go1.15.6/src/bufio/scan.go#80 > That limit is for bufio.Scanner. It doesn't have anything to do with bufio.Reader and bufio.Writer, which don't have any particular

Re: [go-nuts] [generics] use of new predeclared name `any`

2020-12-23 Thread Matt Harden
Although "any" is a new predefined identifier, I still find that conceptually simpler than assigning a second meaning to "_". On Wed, Dec 23, 2020 at 9:27 AM Ian Lance Taylor wrote: > On Wed, Dec 23, 2020 at 9:03 AM LeoY wrote: > > > > Following the blog post about generics in Go, I want to joi

Re: [go-nuts] [generics] combining different instances of the same generic type

2020-12-02 Thread Matt Joiner
The conversation has drifted a little from generics, I've replied inline below: On Wed, 2 Dec 2020 at 20:56, roger peppe wrote: > On Wed, 2 Dec 2020 at 09:15, roger peppe wrote: > >> Also your delayed blocks don't wait for the preceding set of futures to >>> be exhausted before proceeding, I th

Re: [go-nuts] Can we "go get" unreleased standard library packages?

2020-12-02 Thread Matt Mueller
you just have to wait for go1.16. A beta should be released soon > (probably next week, AIUI). > > > On Thu, Dec 3, 2020 at 12:32 AM Matt Mueller wrote: > >> Hey there, I'd like to try the io/fs package on Go 1.15. Is there an easy >> way to do this? >> >> I t

[go-nuts] Can we "go get" unreleased standard library packages?

2020-12-02 Thread Matt Mueller
Hey there, I'd like to try the io/fs package on Go 1.15. Is there an easy way to do this? I tried without much expectation: go get -u github.com/golang/go/src/io/fs But was greeted with this error: go: found github.com/golang/go/src/io/fs in github.com/golang/go/src v0.0.0-20201202201757-2d02

Re: [go-nuts] [generics] combining different instances of the same generic type

2020-12-01 Thread Matt Joiner
sult[T]]. >>> >>> >>> There's no reason why interface types won't still play a large role in >>> the future where Go has generics, and that's >>> how I'd probably represent timeoutOrResult there, with a dynamic type >>> switc

[go-nuts] [generics] combining different instances of the same generic type

2020-11-29 Thread Matt Joiner
I had a muck around with go2 generics with my toy-ish futures package https://github.com/anacrolix/futures. The go1 implementation is in master, and a working go2 implementation in the go2 branch (using channels of different types instead of the attempt that follows). The package provides one f

Re: [go-nuts] Re: Give the zero time value a location, and it won't survive a roundtrip to JSON?

2020-11-28 Thread Matt Harden
On Fri, Nov 27, 2020 at 4:14 PM 'Robert Ma' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Is this because the 2-second offset of LMT gets lost in RFC 3339 > representation? > Yes, that's exactly it. > On Fri, Nov 27, 2020 at 6:33 PM Robert Ma wrote: > >> Hi all, >> >> Time is compli

Re: [go-nuts] Re: Generating code into module cache?

2020-10-21 Thread Matt Mueller
nalysis > running from the repository (like sourcegraph or githubs hover info) might > not understand the code anymore. > >> > >> But, yeah. In general, you can put *any* go code in an appropriate > .zip-file and serve it up as a module. You don't even have to publ

[go-nuts] Re: Generating code into module cache?

2020-10-20 Thread Matt Mueller
7;m working on a project with a lot of code generation. I'd love to: >> >> - get the code generation out of the way when you don't care about it >> - be able to vendor the generated code when you do care about it >> >> That led me to an idea about generating

[go-nuts] Generating code into module cache?

2020-10-20 Thread Matt Mueller
cache. Do you see any downside in doing this? Thanks! Matt -- 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. T

[go-nuts] Re: Why does x/tools/go/packages use `go list` under the hood?

2020-08-17 Thread Matt Mueller
I think I got it. It looks like `go list` uses an internal cache to make its use really fast. Hopefully this package gets merged into the stdlib and we can take advantage of the cache directly! On Monday, August 17, 2020 at 11:22:52 PM UTC+2 Matt Mueller wrote: > Hi folks, > > I wa

[go-nuts] Why does x/tools/go/packages use `go list` under the hood?

2020-08-17 Thread Matt Mueller
formance-wise to not spawn additional processes. Thanks! Matt -- 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.

[go-nuts] Measuring go run and go build times?

2020-07-29 Thread Matt Mueller
t packages are cached and which are not would be very helpful. Also if you have any recommendations for makes this as fast as possible (turning off optimizations, etc.) please let me know! Thanks! Matt -- You received this message because you are subscribed to the Google Groups "gol

[go-nuts] Choosing thread for goroutine?

2020-07-19 Thread Matt Mueller
lizing the computation. This seems random and causes a loss in parallelism since these goroutines will remain on the same thread through their lifetime. Are there any workarounds with this issue? Thanks! Matt -- You received this message because you are subscribed to the Google Groups "gola

Re: [go-nuts] TLS dial error pkg variables - Best way to logically detect the type of tls failure

2020-06-07 Thread Matt Harden
I suspect your (possibly wrapped) error will be of type x509.UnknownAuthorityError, so you should be able to check for it with errors.As: var uaerr x509.UnknownAuthorityError if errors.As(err, &uaerr) { // handle as an unknown authority error } On Tue, Jun 2, 2020 at 8:22 AM Kevin Chadwick wro

[go-nuts] Re: [ANN] Unicode text segmentation

2020-05-07 Thread Matt Sherman
Sorry, bad link. Here it is: https://github.com/clipperhouse/uax29 On Thursday, May 7, 2020 at 12:06:18 PM UTC-4, Matt Sherman wrote: > > Hi gophers, I’ve implemented Unicode text segmentation for Go: > https://github.com/clipperhouse/uax29/words > > It tokenizes text into word

[go-nuts] [ANN] Unicode text segmentation

2020-05-07 Thread Matt Sherman
Hi gophers, I’ve implemented Unicode text segmentation for Go: https://github.com/clipperhouse/uax29/words It tokenizes text into words, sentences or graphemes according to the Unicode spec . I’d been tokenizing text in ad hoc ways, and then learned that there

Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-17 Thread Matt Sherman
generate canonical x/text files, such as including the Unicode > and CLDR versions. > > The top-level file gen.go is used to orchestrate building x/text and > captured dependencies between packages. > > I may have some designs laying around for the API. > > On Thu, 16 A

Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-16 Thread Matt Sherman
/gen.go On Thu, Apr 16, 2020 at 1:52 PM wrote: > Yes that would be interesting. Especially if it can be generated from the > Unicode raw data upon updates. > > On Wed, 15 Apr 2020 at 23:56 Ian Lance Taylor wrote: > >> [ +mpvl ] >> >> On Wed, Apr 15, 2020 at 2:30 PM

[go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-15 Thread Matt Sherman
Hi, I am working on a tokenizer based on Unicode text segmentation (UAX 29 ). I am wondering if there would be an interest in adding range tables for word break categories t

Re: [go-nuts] JWT validation only in Middleware

2019-09-27 Thread Matt-Klaus Mush
While trying to make Go my #1 backend language, I decided to build an API authentication app, since most of the applications I work on require it. Have a look at my code on Github (at https://github.com/mmattklaus/go-jwt-demo), and see how I approached it. I documented every bit. Hopefully, it'll

Re: [go-nuts] Avoiding resource leaks with racing channels

2019-07-08 Thread Matt Harden
Only a buffered channel can "hold" anything. If the channel is unbuffered, then you are guaranteed that another goroutine has at least received the item you sent when the send statement returns. On Mon, Jul 8, 2019 at 9:42 PM Burak Serdar wrote: > On Mon, Jul 8, 2019 at 10:14 PM Daniel Eloff wr

[go-nuts] gorilla/websocket - Looking for a New Maintainer

2019-06-29 Thread Matt Silverlock
I think I've posted about this before (or Gary has!), but we're looking for a new maintainer to take over the gorilla/websocket project. We've tried for a while (over a year) to find a new maintainer and haven't had any real bites. Some context: - It'

Re: [go-nuts] [ANN] Simple DNS Server implemented in Go

2019-06-25 Thread Matt Harden
I realize this is a learning exercise for you, but in case you're interested, the DNS message types are implemented for you in https://godoc.org/golang.org/x/net/dns/dnsmessage. On Tue, Jun 25, 2019 at 1:36 PM Eric S. Raymond wrote: > Daniel Lorch : > > I have implemented a simple authoritative

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

2019-05-28 Thread Matt Farina
r I didn't realize was helping with the reviews. I wonder, would it make sense to document this list of people in the proposal review process? Call it my over-documentation bias that I've gotten from CNCF projects. Where the people who own something are documented. - Matt -- You r

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

2019-05-28 Thread Matt Farina
Thanks for the details, Russ. On Tuesday, May 28, 2019 at 11:53:09 AM UTC-4, Russ Cox wrote: > > On Mon, May 27, 2019 at 7:08 PM Matt Farina > wrote: > >> 1) when a company runs a project without much publicly documented process >> but does as they choose, isn't

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

2019-05-27 Thread Matt Farina
> Ian mentioned that "Google" as a company doesn't actually choose to do a > lot. The Go team is largely autonomous in their decision making and isn't > being influenced by executives. > So, to put it another way: If the only role the company plays is to > provide paychecks to some Go develope

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

2019-05-27 Thread Matt Farina
from multiple companies with differing concerns on it. But, that's just wondering. I use Go. Gonna start something new in go soon, too. -- Matt Farina mattfarina.com Go in Practice <http://goinpracticebook.com/> - A book of Recipes for the Go programming language. Code Engineered <htt

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

2019-05-27 Thread Matt Farina
This whole conversation illustrates the difference between open source and open governance. Go is open source but the governance is controlled by Google. This compares to something like Kubernetes that is both open source and open governance. Should Go be open governance? It sounds like this is

Re: [go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory

2019-05-17 Thread Matt Layher
ave pointer type. https://github.com/WireGuard/wgctrl-go/pull/54 Seems to work fine, and no more Cgo! On Friday, May 17, 2019 at 1:22:36 PM UTC-4, Jan Mercl wrote: > > > > On Fri, May 17, 2019, 19:09 Matt Layher > > wrote: > >> Thanks for the insight, this is very us

Re: [go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory

2019-05-17 Thread Matt Layher
Thanks for the insight, this is very useful information. Perhaps I'll look into the mmap route. - Matt On Friday, May 17, 2019 at 12:54:28 PM UTC-4, Ian Lance Taylor wrote: > > On Fri, May 17, 2019 at 7:44 AM Matt Layher > wrote: > > > >> Pointers passed to un

Re: [go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory

2019-05-17 Thread Matt Layher
It appears that the driver does not retain the internal pointers, but it also seems that my current use of Cgo is pretty unobtrusive (just malloc and friends) so I'm not too concerned about ridding myself of it either. - Matt On 2019-05-17 11:48 a.m., Robert Engels wrote: I only meant th

Re: [go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory

2019-05-17 Thread Matt Layher
to potentially alleviate my above concern: https://github.com/WireGuard/wgctrl-go/pull/49/commits/05d446d3d7b2e376424e57a5167205a325d61781, so I am using a bit of Cgo at this point. Although I'd rather not if it were deemed safe to go with my original pure Go approach. Thanks for your

[go-nuts] Passing structures containing other pointers to ioctl: Go vs Cgo memory

2019-05-16 Thread Matt Layher
rectly with Linux APIs; never a pointer to a structure that also contains other pointers to other memory. I'm a little shaky on Cgo since I've mostly gotten by without it during my time writing Go. Thanks for your time. - Matt -- You received this message because you are subscribed to t

Re: [go-nuts] binary.Read cgo fields

2019-05-06 Thread Matt Harden
n the Go side. You could serialize/deserialize using a language independent format like protobufs (there are many of these formats). Then you can serialize the data from any language, and deserialize it in any other language. On Sat, May 4, 2019 at 10:50 AM Matt Harden wrote: > >>

Re: [go-nuts] binary.Read cgo fields

2019-05-03 Thread Matt Harden
Why do you think binary.Read should handle padding for you? Based on the documentation, it would be a bug if it did. On Tue, Apr 30, 2019 at 4:42 AM Immueggpain S wrote: > I guess I have no other choice then? BTW binary.Read shoud handle padding > automatically. > > On Mon, Apr 22, 2019 at 10:53

Re: [go-nuts] Re: Flushing keyboard buffer (cross platform) ?

2019-05-03 Thread Matt Harden
You may want http://godoc/github.com/pkg/term/termios. It looks like it supports Tcflush on UNIX, including Solaris: https://github.com/pkg/term/blob/master/termios/termios_solaris.go#L63. On Fri, May 3, 2019 at 9:45 AM gbarr wrote: > For BSD systems I think you need to use TIOCFLUSH instead of

Re: [go-nuts] What happens to global vars when main() ends ?

2019-05-03 Thread Matt Harden
On Fri, May 3, 2019, 17:28 wrote: > Does Go GC destroy all global vars prior to the end of main() ? > What do you mean by "destroy"? Go is not an object oriented language and doesn't have the concept of a destructor. So no, it doesn't, but it also doesn't need to. May I ask, what led you to as

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

2019-04-24 Thread Matt Harden
On Wed, Apr 24, 2019 at 8:42 PM David Koblas wrote: > IMHO I've wanted a switch expression, rather than a switch statement for a > while. > I've wanted that too, but what we already have really isn't that bad. > value := switch test { > case true => "red" > case false => "blue" > } > > value

Re: [go-nuts] Re: Should SIGTERM be included in the os package?

2019-04-16 Thread Matt Harden
I think the docs on os.Signal explain it: The only signal values guaranteed to be present in the os package on all systems are os.Interrupt (send the process an interrupt) and os.Kill (force the process to exit). On Windows, sending os.Interrupt to a process with os.Process.Signal is not implement

Re: [go-nuts] Concurrency safe struct access

2019-04-14 Thread Matt Harden
No, you don't need sync/atomic. The mutex is sufficient. By the way, you should put the mutex inside of guardedState, next to the data being guarded. Had you done that originally, Go Vet would have complained about you passing guardedState by value (mutexes should never by copied). https://play.go

Re: [go-nuts] net.Conn types: File vs SyscallConn method

2019-03-25 Thread Matt Layher
oking File. So my question still stands, as far as I know. On Monday, March 25, 2019 at 2:36:29 PM UTC-4, Robert Engels wrote: > > File is cross-platform. I am pretty sure no syscall. is guaranteed to > be available on any given platform. > > -Original Message- > Fr

[go-nuts] net.Conn types: File vs SyscallConn method

2019-03-25 Thread Matt Layher
t time to add a deprecation notice to the File method on various package net types, in favor of SyscallConn? Perhaps there's some benefit to File that I'm not seeing. If so, I'd be curious to find out! Thanks, Matt Layher (@mdlayher) -- You received this message because you

Re: [go-nuts] Re: Persistence of value, or Safely close what you expected

2019-03-13 Thread Matt Harden
On Wed, Mar 13, 2019 at 4:01 PM Andrey Tcherepanov < xnow4fippy...@sneakemail.com> wrote: > Roger, it is not that I wondering it is async assignments are bad, it is > more of a question "why does it have to be SO complicated"? > > (please forgive me for a long ranty post) > > There were couple of

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

2019-02-24 Thread Matt Harden
You don't have to use an xml.Decoder. You may be able to use the `xml:",any"` tag for this case. type Response struct { XMLName xml.Name Return string `xml:"return"` } type Outer struct { XMLName struct{} `xml:"outer"` Responses []Response `xml:",any"` } https://play.golang.org/p/j4w4-1uuYa

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Matt Ho
Would you mind also posting the network tuning parameters you're using along with the os? I know that when I do perf testing for go on linux, I typically need to update a number of tcp related kernel parameters before I get meaningful numbers. M -- You received this message because you are s

Re: [go-nuts] performance optimization

2019-01-14 Thread Matt Ho
Can you describe what task it is that needs to be updated every microsecond? It seems like there should be a better to resolve the underlying need. M -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] Custom dialer for go-mail/mail?

2019-01-13 Thread Matt Harden
It looks like the thing to do is set mail.NetDialTimeout (see https://godoc.org/github.com/go-mail/mail#pkg-variables). Unfortunately, the socks proxy module doesn't appear to support timeouts. If you don't need connection timeouts, though, it should work to create your own DialTimeout that ignore

Re: [go-nuts] regexp: is there a way to match single byte ?

2018-12-29 Thread Matt Harden
I don't believe the regexp package allows matching of bytes rather than utf-8 sequences. On Sat, Dec 15, 2018 at 3:05 AM Tamás Gulácsi wrote: > For such a simple match, I'd use two bytes.Index with an if in a for cycle. > > -- > You received this message because you are subscribed to the Google

Re: [go-nuts] Pure functions and Go2

2018-12-16 Thread Matt Harden
In my opinion, it's even more useful to the programmer to know that a function is pure, than it is to the compiler. If checked by the compiler, the annotation is also useful to ensure that the function remains pure as it is modified over time. On Fri, Dec 14, 2018 at 2:57 PM 'Axel Wagner' via gola

Re: [go-nuts] When set time.Location, will be detected Data Race

2018-12-05 Thread Matt Harden
Just wrapping a write with a mutex is not enough; you have to wrap all the reads as well. In this case that's not possible because there are reads of time.Local all over the place. Anyway, as has been said, time.Local should never be written to in user code. On Fri, Nov 30, 2018 at 7:46 AM Agniva

[go-nuts] Safe to treat time.Local != time.LoadLocation("your current timezone")?

2018-10-18 Thread Matt Mueller
w("offset use a specific timezone") } But I'm just not sure if the user happens to specify the timezone that matches time.Local that this may evaluate as true. From preliminary tests, it seems like it should be fine, but I'd like to double-check. Thanks! Matt -- You re

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-06 Thread Matt Sherman
Thanks Ian, was hoping you’d weigh in. Perhaps a compromise position would be that these type groups/classes/contracts are not language builtins but in the stdlib? contracts.Comparable, etc. If we really don’t want to see the dot, we import with _. And, for a first implementation, only the std

Re: [go-nuts] Generics as builtin typeclasses

2018-09-04 Thread Matt Sherman
@Matthias I don’t mention it in my post but I think that’d be fine, e.g.: type Set(type T comparable) []T type OrderedSlice(type T orderable) []T On Tuesday, September 4, 2018 at 3:52:50 PM UTC-4, Matthias B. wrote: > > On Tue, 4 Sep 2018 11:57:02 -0700 (PDT) > Matt Sherma

[go-nuts] Re: Generics as builtin typeclasses

2018-09-04 Thread Matt Sherman
eric) T { > > > or > > func Sum(x []T Numeric) T { > > > > Jon > > On Tuesday, September 4, 2018 at 11:57:02 AM UTC-7, Matt Sherman wrote: >> >> Here’s a riff on generics focused on builtin typeclasses (instead of user >> contracts): https://c

[go-nuts] Generics as builtin typeclasses

2018-09-04 Thread Matt Sherman
Here’s a riff on generics focused on builtin typeclasses (instead of user contracts): https://clipperhouse.com/go-generics-typeclasses/ Feedback welcome. -- 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] How to make UDP server performance better?

2018-08-30 Thread Matt Harden
The time spent in the syscall would include time blocked, waiting for a packet to arrive. I would look at the other parts of the profile for possible improvements. The kernel may also be dropping packets if there is not enough buffer space to receive them into; see the SO_RCVBUF socket option. Mayb

Re: [go-nuts] Re: os.WriteFile not writing files in long running process

2018-08-29 Thread Matt Harden
>From the program's perspective the file is indeed flushed on close. The kernel deferring writes to disk can only have any effect if the system crashes, and the files will be flushed to disk within a short time anyway. You absolutely do NOT need to call fsync every file on close unless you require

[go-nuts] Re: Custom types for use with range (Go 2)

2018-08-07 Thread Matt Sherman
Sorry for late reply: yes, it’s sugar, and a first implementation might be to have the compiler simply rewrite it like a macro, as in your example. And I realize that my example was more verbose than need be. We don’t call an iterator on arrays, maps, etc, so my example should have been: for t

[go-nuts] wireguardctrl: enables control of WireGuard devices on multiple platforms

2018-08-07 Thread Matt Layher
been a fun project so far, and I'd appreciate your feedback. Thanks! - Matt -- 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.

[go-nuts] [show] A lemmatizer for Go

2018-05-27 Thread Matt Sherman
uch a package useful? What for? The source & docs are here <https://github.com/clipperhouse/jargon> and I made a playground here <https://clipperhouse.com/jargon/>. Cheers, - Matt -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

Re: [go-nuts] Closing os.Stdin while trying to read from it?

2018-03-19 Thread Matt Mueller
Thanks for the great info! Out of curiosity, how is Go handling ctrl+d (sending EOF to stdin) right now? Is it part of the special case? A more generic way to ask this is: Is it possible to programmatically tell os.Stdin that we've reached EOF while you're trying to read from it? On Friday,

Re: [go-nuts] glr support in goyacc?

2018-03-18 Thread Matt Harden
I believe Ian was saying he's not aware of anybody working on adding GLR support to goyacc. On Mon, Mar 12, 2018 at 1:23 AM David Wahlstedt < david.wahlstedt@gmail.com> wrote: > There are people working on it. This for instance: > https://github.com/chemikadze/asn1go > > Furthermore, if you w

Re: [go-nuts] Re: [Advice needed] How to vendor common dependencies for plugins

2018-03-18 Thread Matt Harden
Do you have to use plugins? I would avoid them whenever possible. What benefit do you expect to get from using them? On Sun, Mar 11, 2018 at 1:03 AM Jay Guo wrote: > Bump.. any thoughts? Thanks! > > - J > > > On Thursday, March 8, 2018 at 2:03:37 PM UTC+8, Jay Guo wrote: >> >> Golang gurus, >> >

[go-nuts] Closing os.Stdin while trying to read from it?

2018-03-15 Thread Matt Mueller
Hey folks, I'm trying to figure out how to cancel reading from stdin programmatically. Basically the same way that ctrl+d works on OSX. I would have thought this would work, but this program will just run forever: package main import ( "io/ioutil" "os" "time" ) func main() { go func()

[go-nuts] Re: Possible to stream database/sql rows to text/template?

2018-02-16 Thread Matt R.
Oh nice! I was using it with github.com/gin-gonic/gin which was giving me an error about writing bytes exceeding Content-Length, which the library was setting for me. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

[go-nuts] Re: Possible to stream database/sql rows to text/template?

2018-02-15 Thread Matt R.
Ah! Should have thought of that. After implementing it, however, I realized that it's not very conducive to HTTP requests, in which the Content-Size header is expected to be sent, and thus, how can I know the content size of a response until I've rendered the whole thing? Thanks anyways! --

[go-nuts] Possible to stream database/sql rows to text/template?

2018-02-14 Thread Matt R.
I'm interested in streaming results from a *database/sql* query to a template rendered with *html/template*. More specifically, for performance reasons, I'm interested in streaming an array of results from the database straight to text/template without allocating a slice beforehand. My idea is

[go-nuts] Re: Inheritance and OOP: Go one better

2018-02-13 Thread Matt Ho
I’m not sure how an interface doesn’t satisfy what you’re looking for. Can you describe your use case in a little more detail? -- 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

  1   2   3   4   >