Re: [go-nuts] Need help to close/shutdown http server when underlying socket fd explicitly bind used

2024-02-19 Thread Reto
On Sat, Feb 17, 2024 at 10:23:40AM -0800, binbinschen00 wrote: > If I want to bind the socket fd to another interface for the same http > server (meaning same address:port), do I need to close/shutdown the > existing server first and start a new one? Is there a way to just modify > the socket bi

Re: [go-nuts] Need help to close/shutdown http server when underlying socket fd explicitly bind used

2024-02-16 Thread Reto
a more convenient interface with a syscall.RawConn than what you are using. The attached mod seems to work, maybe try that? Cheers, Reto -- 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] wtf

2023-08-27 Thread Reto
On Sat, Aug 26, 2023 at 07:56:30AM -0700, Aln Kapa wrote: > Need some help, what am I doing wrong? You don't understand how defer works would be my guess > func main() { > Handle(true)// error > Handle(false) // no error > HandleWTF(true) // no error ? Why do you expect this to pri

Re: [go-nuts] Packages vs methods

2023-04-04 Thread Reto
On Mon, Apr 03, 2023 at 10:19:49PM -0700, joseph.p...@gmail.com wrote: > Is there an easy way to make > this determination? Sure, use syntax highlighting in your favor. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gr

Re: [go-nuts] GO API to upload a directory in the github

2022-09-28 Thread Reto
stuff or you can interact with the GH API either via rest or grahpql. There's a bunch of info available, say * https://docs.github.com/en/developers/overview/about-githubs-apis * https://github.com/shurcooL/githubv4 Go from there. Cheers, Reto -- You received this message because you

Re: [go-nuts] Whats wrong with my builder pattern

2021-12-05 Thread Reto
alue), so changes it makes will be >invisible to the caller. You have a non pointer receiver, you modify a copy. Cheers, Reto -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving e

Re: [go-nuts] Makefiles for Go Programs

2021-08-23 Thread Reto
On Mon, Aug 23, 2021 at 06:12:43PM -0700, Michael Ellis wrote: > Three cheers for mage . It's more verbose than make > but it's pure Go. I use it to build and test projects that include > generated html/css/js supported by a Web Assembly clients communicating > with a ser

Re: [go-nuts] Re: How to manage replace directives in go.mod files when code versioning ?

2021-04-27 Thread Reto
On Mon, Apr 26, 2021 at 11:59:47PM -0700, christoph...@gmail.com wrote: > Thank you for pointing this out. I wasn’t aware of it. But the question > still holds for published main programs. If you have such a tight dependency that you need to develop them in parallel (and hence need replace directi

Re: [go-nuts] Go 1.16 and modules

2021-03-28 Thread Reto
On Mon, Mar 29, 2021 at 11:18:28AM +1100, Amit Saha wrote: > "Module-aware mode is enabled by default, regardless of whether a > go.mod file is present in the current working directory or a parent > directory. More precisely, the GO111MODULE environment variable now > defaults to on. To switch to t

Re: [go-nuts] golang.org/x/sys and unsafe usage

2021-02-28 Thread Reto
fe constraints, I started reading the stdlib and it's kinda hard to argue for a patch upstream if the go stdlib uses the exact same pattern ;) Greetings, Reto -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] golang.org/x/sys and unsafe usage

2021-02-27 Thread Reto
yscall. Why is this valid? Thanks in advance. Regards, Reto -- 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] sql string not interpolated as expected

2021-01-03 Thread Reto
o do is not what it's doing. You ask the sql engine to escape the input you give it. So your question becomes `where label_name in ('"carnivore", "mammal", "vertebrate"')` Meaning the string exactly as given as single element. Maybe that helps: https://

Re: [go-nuts] Re: Generics - please provide real life problems

2020-12-25 Thread Reto
You are repeatedly starting new threads, keeping the same subject as already existing ones. Don't do that please, if you respond to a certain topic keep the thread intact. That way all the conversation is in a single place. -- You received this message because you are subscribed to the Google G

Re: [go-nuts] can "Run" in play.golang.org automatically include imports and format?

2020-05-30 Thread Reto
On Sat, May 30, 2020 at 01:13:16AM -0700, Sathish VJ wrote: > Is there a reason why play.golang.org needs separate buttons for Run, > Format, and Imports? Is there any reason for or anybody not doing those > automatically? Say someone has issues with their code and pastes it to play.golang.org. Y

Re: [go-nuts] Store function name as JSON?

2020-04-29 Thread Reto
You need to capitalize your struct fields in other words. > after striking out I thought about switching it to a string and doing a > switch.. but let me know maybe i'm just doing something wrong with the > callback definition Yes, enter a string and switch on that. Greetings, Reto -

Re: [go-nuts] Re: Windows syscall.Open() change to fix os.Rename() & .Remove()

2019-08-04 Thread Reto
>They did: >https://github.com/golang/go/issues/32088#issuecomment-502850674 No, that's not a member of the go team. >TL;DR; setting it by default would move the things to a little bit more > >POSIXy, but >possibly creating more hiddent deviations. yeah but that wasn't my question was it? --

Re: [go-nuts] Re: Windows syscall.Open() change to fix os.Rename() & .Remove()

2019-08-04 Thread Reto
On Wed, Jul 31, 2019 at 07:00:46PM -0700, Liam wrote: > In this issue, Microsoft suggested that Go on Windows switch to Unix-like > behavior in Go 1.14: > https://github.com/golang/go/issues/32088 > > I believe this will change early in pre-release 1.14. May I inquire as to why you believe that?

Re: [go-nuts] Is it possible to simplify this snippet?

2019-05-01 Thread Reto
Granted, only if they are mutually exclusive... Sorry, I missed the part of your mail mentioning that -- 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+

Re: [go-nuts] Is it possible to simplify this snippet?

2019-05-01 Thread Reto
On Wed, May 01, 2019 at 09:05:19AM -0700, jake6...@gmail.com wrote: > There is nothing wrong with the code you presented. It is clear and readable. > If you find that it clutters the function too much, then make it into it's > only utility function. But it is wrong, even from a readability perspe

Re: [go-nuts] the Dominance of English in Programming Languages

2019-04-28 Thread Reto
In my view you don't necessarily need to speak English, although it helps a lot. Go uses utf-8 for all identifiers, so assuming you treat the keywords as blobs and just remember when to use which you should be fine. The issue being more that all existing packages worth using are written with Eng

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

2019-04-24 Thread Reto
On Wed, Apr 24, 2019 at 04:24:41PM -0500, Andrew Klager wrote: > Is this so bad? Yes, it's horrible as you'll loose any type information you had. Meaning the next thing you naturally had to do was type cast it, which isn't the nicest syntax to begin with. By then it's probably more work than just

Re: [go-nuts] [RFC][Gomobile] Wrote a series of posts on Gomobile

2019-04-24 Thread Reto
On Tue, Apr 23, 2019 at 08:46:15PM -0700, Girish Koundinya wrote: > Any feedback is welcome :) Well, for starters please return early from functions instead of nesting it 4 levels deep, like in the example below (getContacts) https://gist.githubusercontent.com/koundinya/a0d18ba4b830e3bb86f65aced0

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Reto Brunner
On Mon, Mar 11, 2019 at 07:46:27PM +0700, Shulhan wrote: > I like to read email before sleep, keeping up-to-date with recent discussion > and what not. How are you able to cope with mailing lists? I find list messages seriously unreadable with the gmail app, due to the lack of threading. -- Yo

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Reto Brunner
On Mon, Mar 11, 2019 at 04:36:32AM -0700, Manlio Perillo wrote: > I consider polite to use the interleaved reply style and to trim the > original message as much as possible. It requires time and thinking, > something that seems to be rare nowadays. And yet you are right now also not doing it, ad

Re: [go-nuts] improve the reflection of golang

2018-11-19 Thread Reto Brunner
If you want to do that, there's already a package for it: https://github.com/jmoiron/sqlx ``` people := []Person{} db.Select(&people, "SELECT * FROM person ORDER BY first_name ASC") ``` -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

Re: [go-nuts] Re: os.remove is slow

2017-12-04 Thread Reto Brunner
But why? Why does it matter if you are in the same dir or not when you glob? On Mon, Dec 4, 2017, 20:34 Gabriel Forster wrote: > Ding ding ding! We have a winner! Thank you so much. That made a huge > difference. It is now running ~20 seconds. > > The key is being in the same directory. > > > O

Re: [go-nuts] [security] Go 1.8.4 and Go 1.9.1 are released

2017-10-04 Thread Reto Brunner
God no, My system is managed by a *package manager* and I want it to stay that way On Thu, Oct 5, 2017, 03:40 Bakul Shah wrote: > Would it make sense for Go to update itself? Something > like "go update " that fetches a platform > specific release, does some basic sanity tests and > if all goes

Re: [go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread Reto Brunner
God no! Only because bradfitz has a problem with Reddit doesn't mean that all others do Squatting /r/golang and not handing moderation over would be a very unfair move to those who liked *and still like* Reddit If you don't wanna be a mod, fair enough, step down but leave us in peace! -- You r

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread Reto Brunner
At the CoC team, You do realize that reddit is not actually yours to govern yes? Reddit is being reddit... everywhere you can just post "anomalously" the atmosphere is rather more, well, outspoken than on a public mailing list. Why don't you just deal with it and accept that there are other menta