[go-nuts] Best practices for using methods on types to write SQL

2018-12-20 Thread Nick
best ways to organise my code to do this cleanly and reusably would be very welcome indeed - as I say, I'm new enough to Go that maybe I'm still thinking about this all wrong! Thanks in advance, Nick -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] I have an issue in go after make

2019-03-08 Thread Nick
this command: $ sudo rm -rf /home/nada/.cache/go-build Then you should be able to build your project with a simple: $ go build No sudo needed. Hope this gets you on your way :) Nick -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] I have an issue in go after make

2019-03-08 Thread Nick
bout Linux basics, sudo, permissions, stuff like that. Plenty to learn, all useful stuff :) Also, you replied just to me, I'm cc-ing the list again, so the answers are in the list archive in case it helps others. Nick Quoth Nada Saif: > Thank you, now I could build a hello world go program

Re: [go-nuts] [ANN] Fyne reaches 1.0

2019-03-20 Thread Nick
acks for each platform? I'm sure you have good reasons for doing it the way you are, I'm just keen to learn! Congratulations to all involved once again, and I look forward to using Fyne soon :) Nick -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] godoc-static - Generate static documentation for your packages

2020-02-10 Thread Nick
ne it would be more liable to break with future versions of godoc which change the output. Anyway, good job, I may use it myself soon, and will let you know how I get on. Nick -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

Re: [go-nuts] Re: Where is the version number for a golang module declared?

2020-03-12 Thread Nick
ements in the go.mod file perfectly good replacements for these use cases? I get the feeling I'm missing something... I agree that anything that penalises people for not using Google services is problematic, but I don't see how that's happening here. Nick -- You received this

Re: [go-nuts] modules and indirect

2020-04-14 Thread Nick
Quoth Jérôme LAFORGE: > I am surprised that go mod tidy doesn't remove all unnecessary > dependencies from the go.mod. > > It raises some questions: > - Is it unsafe to do this kind of process to ensure that all unnecessary > dependencies are removed? > - Why go mod tidy doesn't remove them? > - H

Re: [go-nuts] Image Resize and Crop

2020-05-11 Thread Nick
Quoth Vivi: > How do you advice to resize and crop JPEG and PNG or probably WebP images > without rely on 3rd parties dependencies? > > It was hard to find a good snippet or could be useful to have basic API > function in Go standard library since it's a common feature. I'd encourage you to consi

Re: [go-nuts] [ANN] CGo-free sqlite database/sql driver 1.4.0 for linux/amd64 released

2020-08-27 Thread Nick
similar performance as it's just translated-from-C? What happens if one (erroneously) tries to build a project that uses this library, using a non-supported architecture? Will go complain? Thanks, anyway, looks very cool, I look forward to learning more! Nick -- You received this message b

Re: [go-nuts] Announcing godocs.io, a maintained fork of godoc.org

2021-01-21 Thread Nick
Hi Drew, Quoth Drew DeVault: > With the help of some volunteers, we have already made modest, > conservative improvements to godoc.org. Some features have been > updated to work with JavaScript disabled, dead links and obsolete tools > have been pruned, and our fork should be easier to use on your

Re: [go-nuts] Golang JPEG2000 implementation / Gauging community interest in supporting it?

2021-11-05 Thread Nick
Cheerleading and testing, though, that much I can happily offer :) Nick -- 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] What's go's convention for specifying the equivolent of configure --prefix?

2022-12-01 Thread Nick
On Thu, Dec 01, 2022 at 06:21:37PM +0800, Glen Huang wrote: > Const is the ideal choice, but how do users of my program specify the path > when > they compile it? I don't think this is something for which there is a "canonical Go way", so I'd say something like a tiny makefile that sets the path

[go-nuts] Correct way to bump a Go library to v2

2018-04-12 Thread Nick Snyder
I am about to bump a Go library to v2. Here are some objectives that I have: 1. New import path for v2 2. Want it to work with go and vgo. 3. Prefer to avoid keeping v1 code around in master branch. (1) and (2) are actually pretty easy. I just put the code in a new v2 dir at the root of my proje

Re: [go-nuts] Correct way to bump a Go library to v2

2018-04-13 Thread Nick Snyder
> If you wanna support go both for v1 and v2 using current import path then > you've no choice - you have to keep both version in master. Yeah, this seems to be the case. There is an option to use gopkg.in to get alternate import path for v1. > This way users of go+v1 will have to rewrite import

Re: [go-nuts] Generics of Kith and Kin

2019-04-11 Thread Nick Keets
In the same spirit, here is an interesting post about generics in Swift: https://forums.swift.org/t/improving-the-ui-of-generics/22814 Swift if a more complex language and fairly different from Go, but it may be of interest to people that are thinking about generics. On Wed, Apr 10, 2019 at 3:27

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-05-31 Thread Nick Keets
On Thu, May 30, 2019 at 9:26 PM Ian Lance Taylor wrote: > One of my guidelines for an acceptable generics proposal is that > people can write Min and Max. Your proposal admits that it doesn't > permit that. I think that is a problem. I'm fine with the general > idea of "do 80% of the job" but

[go-nuts] json inline

2016-09-27 Thread Nick Leli
After inspecting some Kubernetes code , I see the json `inline` used throughout to create persistent structs. This topic appears to be a proposal

[go-nuts] [ANN] crc16

2016-10-13 Thread Nick Patavalis
Hi, Cleaned this up and put it in a repo... just in case someone else might find it useful, as well: https://github.com/npat-efault/crc16 Package crc16 is a Golang implementation of the 16-bit Cyclic Redundancy Check, or CRC-16 checksum. The package's API is almost identical to the standard-

[go-nuts] Append consecutive slices, same underlying array

2016-10-20 Thread Nick Patavalis
Hi, It seems that the built-in append does not check for a situation like the following, and needlessly copies data, when it could avoid it. func appendBytes(a, b []byte) []byte { if len(b) == 0 { return a } // Shouldn't append() check for somethi

[go-nuts] Re: Append consecutive slices, same underlying array

2016-10-20 Thread Nick Patavalis
Opened issue here: https://github.com/golang/go/issues/17530 /npat On Thursday, October 20, 2016 at 5:22:27 PM UTC+3, T L wrote: > > yes, you are right. You can file an issue at > https://github.com/golang/go/issues > > On Thursday, October 20, 2016 at 9:11:14 PM UTC+8, Nick

[go-nuts] Re: do i need to wait all child routine exit

2016-10-25 Thread Nick Patavalis
Hi, You don't *need* to wait for the goroutines to exit, per se, but, as far as I can tell, your code will panic when it "return"s and one of the still-running resolver goroutines try to send to the closed channel. One solution would be *not to close the channel upon return*. The channel will

Re: [go-nuts] Re: do i need to wait all child routine exit

2016-10-25 Thread Nick Patavalis
On Tuesday, October 25, 2016 at 5:17:10 PM UTC+3, Axel Wagner wrote: > > I suggest using errgroup > (and/or context.Context in > general) instead of rolling your own cancellation and timeout logic. It > shoul

[go-nuts] Stopping a server

2016-10-27 Thread Nick Patavalis
Hi, I'm writing a package that allows the user to create and start server instances. A server instance is created like this: srv := pkg.NewServer( ... params ... ) and started like this: err := srv.Start() Start does not normally return (unless an unrecoverable error occurs). The user code

[go-nuts] Re: Stopping a server

2016-10-27 Thread Nick Patavalis
On Thursday, October 27, 2016 at 6:35:40 PM UTC+3, Peter Mogensen wrote: > > It's a valid question whether Context is the concept to use for starting > and stopping server instances. ... I'm not fully convinced. It seems to > me it's more meaningfull for more transient things like Requests. On Thu

Re: [go-nuts] Re: Stopping a server

2016-10-27 Thread Nick Patavalis
Hi, On Thu, Oct 27, 2016 at 9:34 PM, Peter Mogensen wrote: > > Technically that depends on the Server implementation. > But in the provided http.Server extension, the answer is "nothing": > > func (srv *Server) Shutdown() { > srv.runlock.Lock() > defer srv.runlock.Unlock() >

Re: [go-nuts] Re: Stopping a server

2016-10-27 Thread Nick Patavalis
On Thu, Oct 27, 2016 at 11:11 PM, Peter Mogensen wrote: > > The problem you seem to be trying to solve here is for the caller of > Shutdown() to know when the Server has exited Serve(). > The way to do that under "my" semantics to implement a Server letting you > wait for it to be ready to acknowl

Re: [go-nuts] Re: Stopping a server

2016-10-28 Thread Nick Patavalis
On Fri, Oct 28, 2016 at 8:15 AM, Peter Mogensen wrote: > > The point being that it's up to the user of the interface how to specific > Server implementation should work. > Yes, of course, but an interface with just two methods (Serve / Stop) is not enough to provide race-free semantics (unless yo

Re: [go-nuts] Re: Stopping a server

2016-10-28 Thread Nick Patavalis
By considering the server creation and starting out-of scope, rog's approach in-effect assumes that a worker instance is the same as a worker "run". Once a worker "w" is created it is considered "running" and once it's stopped, there is no way to re-start it. You must create a new instance. This si

Re: [go-nuts] Re: Stopping a server

2016-10-28 Thread Nick Patavalis
On Oct 28, 2016 14:32, "roger peppe" wrote: > > Yes, that's right. The main difference from a context is that a context provides > no way to know when things shut down. This, I think, is by design - things > like ErrGroup provide that functionality when needed. Yes, exactly. /npat (sent from my

Re: [go-nuts] Re: Stopping a server

2016-10-28 Thread Nick Patavalis
On Oct 28, 2016 14:48, "Peter Mogensen" wrote: > > So ... bottom line ... defining Server objects as one-shot/single-use allows you to define the Kill()/Shutdown() semantics to simply exhaust that single-use. (an being idempotent) ... making it irrelevant whether the server has actually been start

[go-nuts] Version Control entire GOPATH

2016-11-12 Thread Nick Stogner
I would like to version control my entire GOPATH to store all of my go code in a monolithic repository. (see http://danluu.com/monorepo/ or https://blog.gopheracademy.com/advent-2015/go-in-a-monorepo/) The problem that I run into: how to manage dependencies with "go get" ?.. I would like to ven

[go-nuts] Re: Version Control entire GOPATH

2016-11-13 Thread Nick Stogner
which accomplish this: https://github.com/nstogner/gomono. After installing them in the client repo, the gophers should be able to proceed along without worrying about how they use go-get... Let me know what you think. On Saturday, November 12, 2016 at 12:00:08 PM UTC-5, Nick Stogner wrote

[go-nuts] implement 'error operator' in go similar to rust?

2016-11-16 Thread Nick Evgeniev
hi, I've just read about 'error operator - ?' introduced in rust https://www.infoq.com/news/2016/11/rust-113-released and ... do you think we could see something like this in go as well? It could eliminate lot's of 'idiomatic if spaghetti' in go programs... hopefully it's less complex than ge

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-22 Thread Nick Patavalis
Hi, There is no direct mapping of what you can do with virtual functions in other OO languages, and Go. There are different compromises you have to make; because of this, synthetic examples will probably not help much. That being said, in the case of your last example I would make Output() a

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-23 Thread Nick Patavalis
hetic ones. /npat On Wednesday, November 23, 2016 at 6:08:00 AM UTC+2, Tong Sun wrote: > > No Nick, making Output() a member method won't work. > See my OP and Jesse's answer. I.e., I have to change it from a member > function to a pure function. > > On Tue, Nov 22, 20

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-23 Thread Nick Patavalis
Wed, Nov 23, 2016 at 4:05 AM, Nick Patavalis > wrote: > >> Hi, >> >> In your *second* example, making Output() a method of Animal will work, >> since it uses only the members (fields) of Animal, and not the fields of >> specific animals (or any behavior that v

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-23 Thread Nick Patavalis
On Wednesday, November 23, 2016 at 5:17:11 PM UTC+2, Tong Sun wrote: > > Can you make it work on play.golang.org, from this code > https://play.golang.org/p/QjCtD9rGpa, according to your plan? > For this specific example, something like this: https://play.golang.org/p/FsorWRaLKk /npat -- You

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-23 Thread Nick Patavalis
​ As I said ​ ​ before, Go's flavor of OO is different from that of other languages. Don't try to map concepts one-to-one, or you will end up with very contrived solutions. Always look at the big picture (why am I doing this?) and don't get side-tracked by synthetic examples. Most important is def

Re: [go-nuts] Re: Thinking OO virtual function in Go

2016-11-24 Thread Nick Patavalis
Hi, On Thu, Nov 24, 2016 at 9:33 AM, Haddock wrote: > > Here is another blog that shows a way how to do this: > http://objectscape.blogspot.de/2013/09/inner-pattern-to-mimic-method.html > Clever! I would like, though, to underscore the conclusion reached by the original post author: My preli

Re: [go-nuts] Thinking OO virtual function in Go

2016-11-24 Thread Nick Patavalis
On Thu, Nov 24, 2016 at 10:00 AM, Haddock wrote: > > This is merely resorting to a shared function. This does not really > cover overwriting in the OO sense. The article I mentioned shows how > to do this: > http://objectscape.blogspot.de/2013/09/inner-pattern-to-mimic-method.html Not really! Ton

[go-nuts] Re: net/http best way to get request/response header size

2016-12-13 Thread Nick V
For what it's worth, MaxHeaderSize only works for POST/PUT requests. On Tuesday, December 13, 2016 at 11:19:06 AM UTC-8, Tamás Gulácsi wrote: > > 2016. december 13., kedd 14:57:47 UTC+1 időpontban kaitoY Kors a > következőt írta: >> >> Hello, >> >> In the current implementation of net/http and ne

[go-nuts] How to be safe in Go?

2016-06-23 Thread Nick Pavlica
waiting for you code to blow up. Every programmer I know has had a bad day, and can easily make these types of mistakes. So how do you protect against them in Go? Your guidance is greatly app

Re: [go-nuts] How to be safe in Go?

2016-06-24 Thread Nick Pavlica
For example: go run --chk_concurrent mylib.go Notice: "net/http" calls concurrent operations on the Handle function. ----

[go-nuts] is there any plan to reduce native call overhead in go?

2016-07-14 Thread Nick Evgeniev
Hi, Is there any plan to reduce (remove) significant overhead for native calls in GO? With recent advances in minimizing gc pauses go becomes more attractive for low latency things... but hundreds nanoseconds overhead imposed on every C call makes it pointless :( -- You received this message

Re: [go-nuts] Re: Go is for everyone

2016-07-20 Thread Nick Sarbicki
c coding concepts and to start designing solutions. Teach go next to learn more about how languages work and get closer to the hardware. As an aside: for those discussing the ability to teach a topic using your students level of understanding instead of your own more specialised perspective. The t

Re: [go-nuts] Re: Go is for everyone

2016-07-21 Thread Nick Sarbicki
> > If go run is the primary starting point you wouldn't need the GOPATH > configured. > > What I think would be interesting is the ability that most scripting > languages provide which is to just start coding. No functions requiring > definition and perhaps an auto-import of fmt, strings, io,

[go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread Nick Rio
Thank you for reply. No guys, it's me using too many memories, not Goroutine. However, I believe if I can make those code in epoll-style, I can then build a task queue to handle those connections one by one in a queue when they back to active. For example, start one *accepter* goroutine + few

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
t; > > *From:* golan...@googlegroups.com [mailto: > golan...@googlegroups.com ] *On Behalf Of *Nick Rio > *Sent:* 2017 March 05, Sun 23:28 > *To:* golang-nuts > *Subject:* [go-nuts] Re: How can I implement a TCP server using a model > which similar to epoll (or kqueue, IOCP) rather than ju

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
Hi Konstantin, Thank you for the hit. I'll look into it. On Monday, March 6, 2017 at 5:25:47 PM UTC+8, Konstantin Khomoutov wrote: > > On Mon, 6 Mar 2017 12:01:43 +0300 > Konstantin Khomoutov > wrote: > > > > The application is working right now. Current work for me is to > > > found a way to

Re: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
6, 2017 at 6:58:50 PM UTC+8, John Souvestre wrote: > > Ni Nick. > > > > Is 1GB too much? What is your target for number of connections and max > memory size? > > > > You are using about 100KB per connection? Is there any way to reduce > this? The go

Re: [go-nuts] How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread Nick Rio
ead. > This won't be efficient in a tight loop, but if you know a point where may > clients idle it may be worth it. > > //jb > > > On 6 Mar 2017, at 09:26, Nick Rio > > wrote: > > > > The application is working right now. Current work for me

RE: [go-nuts] Problem compiling from source

2017-05-14 Thread Nick Treleaven
Thanks for the suggestion but I'm afraid it didn't work. Any other ideas? Nicholas Treleaven -Original Message- From: Ian Lance Taylor [mailto:i...@golang.org] Sent: 14 May 2017 14:06 To: Nick Treleaven Cc: golang-nuts Subject: Re: [go-nuts] Problem compiling from source O

Re: [go-nuts] CGO & Plugins

2017-06-03 Thread Nick Groenen
on plugins earlier this year. The "caveats" section has some remarks and references you might find interesting in this context. You can find it at https://nick.groenen.me/posts/2017/01/09/plugins-in-go-18/ -- Nick Groenen https://nick.groenen.me/ -- You received this message because y

Re: [go-nuts] compress/flate

2020-07-20 Thread Nick Keets
Updating those 2 lines would be the least of our problems if this value ever changes. On Fri, Jul 17, 2020 at 12:33 PM Jan Mercl <0xj...@gmail.com> wrote: > On Fri, Jul 17, 2020 at 11:23 AM Heisenberg wrote: > > > > Constant definition in token.go: > > > > literalType = 0 << 30 > > > > The only

Re: [go-nuts] still struggling to understand modules

2021-02-23 Thread Nick Keets
Hello rob, here's what I do. For every dir in ~/go/src run go mod init with the dir name. e.g.: cd ~/go/src/foo go mod init foo cd ~/go/src/bar go mod init bar ... If package foo depends on libfoo (also in ~/go/src) you can add a replace line in foo's go.mod e.g. echo "replace libfoo => ../libfo

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-08 Thread Nick Keets
t; and then use replace, and then remember to not commit the replace because someone else may have the code in a different location, etc etc. Imagine if it was the other way around: my_source_location/ ProjectA/ go.mod module ProjectA replace /home/nick/src/ProjectA =>

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-08 Thread Nick Keets
On Thu, Apr 8, 2021 at 2:08 PM 'Carla Pfaff' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Thursday, 8 April 2021 at 12:48:28 UTC+2 nick@gmail.com wrote: > >> But what if you don't even have a domain for your source code? Sure you >>

Re: [go-nuts] SignatureDoesNotMatch error when S3 object name contains “=”

2021-04-16 Thread Nick White
t gets sent with the new code - maybe the '=' was escaped in some manner. Nick -- 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] Map to struct and vice versa

2021-05-17 Thread Nick Keets
Is there an easy way to go from a map to a struct and vice versa? e.g. going from: m := map[string]interface{}{"a": "x", "b": 5} to an instance of: type T struct { A string B int } I can do this going through JSON (marshal the map, unmarshal into struct), but is there a more direc

Re: [go-nuts] Re: Map to struct and vice versa

2021-05-17 Thread Nick Keets
Thanks everyone for your responses. structs is interesting, but archived, pre modules even. Using reflect directly also doesn't seem that bad and I do want error handling, so it looks like nothing beats JSON in terms of UI. On Mon, May 17, 2021 at 6:22 PM Howard C. Shaw III wrote: > The example

Re: [go-nuts] What's go's convention for specifying the equivolent of configure --prefix?

2022-12-03 Thread Nick White
On Thu, Dec 01, 2022 at 08:42:46PM -0800, hey...@gmail.com wrote: > Using a Makefile makes sense. > > And thanks for bringing embed to my attention. I never knew it exists. Sounds > like it can solve my problem. Yeah, embed is brilliant, I'm glad it can help you. One thing I forgot to mention is

Re: [go-nuts] Pass SQL null values to Parquet

2023-01-22 Thread Nick White
. Whether this is the easiest way to pass to parquet, I don't know, but I'd imagine it shouldn't be too bad. Nick -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails f

[go-nuts] mmapping over Go heap

2024-01-10 Thread Nick Zavaritsky
Hi, Packages offering memory mapped files in golang follow one of the two possible routes: 1) memory is accessed via io.Reader (e.g. golang.org/x/exp/mmap); 2) mapped memory is directly exposed as []byte; accessing it after munmap leads to SIGSEGV or worse (e.g. github.com/edsrzf/mmap-go). I'

Re: [go-nuts] I saw the news today, oh boy

2025-05-18 Thread Nick White
Thanks for all your great work and patience in helping people in this community for all this time, Ian. The rest of us will have to step up to keep this place as active and useful as it is! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Nick White
n this constrained bit of the template, and then forget all about them, then 2 has the advantage of making it clear that you won't be using these variables for anything else later. Nick -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Re: [ANN] pygor: yet another Python to Go regurgitator

2018-10-20 Thread Nick Craig-Wood
Very interesting :-) It looks like a useful tool for producing a first rough cut of a python program. -- Nick On 20/10/18 05:16, Raffaele Sena wrote: Inspired by ESR pytogo (and tired of writing python code), I went the complete opposite way and came up with pygor: https://github.com/raff

Re: [go-nuts] tbsp - Spoon-feed your table-based tests!

2016-08-25 Thread Nick Craig-Wood
already something out there like this - I totally > missed that subtests were coming in 1.7 until I saw the release notes, > so I'm playing catchup. Could you do a backwards compatibility mode so it would work in go 1.5 and 1.6? If so that would be really useful! -- Nick Craig-Wood -- h

Re: [go-nuts] Speeding up Go Report Card

2016-09-05 Thread Nick Craig-Wood
process-in-linux So I'd check to see if you are running out of threads, or memory because of lots of threads. > The server we run this on is a Digital Ocean droplet with 1 GB of RAM > (would upgrading it help?) > > We normally only see issues on repositories with a very large numbe

[go-nuts] Copying http.DefaultTransport

2016-09-14 Thread Nick Craig-Wood
https://play.golang.org/p/l2mkCTZSzL Is there a better way? Should making an http.Transport with the default settings in be something the standard library should support? Maybe a NewDefaultTransport() function? -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message becaus

Re: [go-nuts] file or folder encryption tool

2016-09-19 Thread Nick Craig-Wood
ithub.com/ncw/rclone for code. What you would do is configure a crypt remote using a directory on your disk. You can then rclone copy /path/to/unencryptedfiles remote: It perhaps isn't exactly the workflow you want but it is written in Go! It uses the go port of secret box for encrypting st

Re: [go-nuts] Slow compile times

2016-10-04 Thread Nick Craig-Wood
> go install github.com/coreos/pkg/capnslog > > > But this does not help me here. Has anybody an idea to fix this 'issue'? try `go test -i` to install the dependencies for the test. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message bec

Re: [go-nuts] Architect a daemon program

2016-10-12 Thread Nick Craig-Wood
named as`myprog`) to fork into the background > (if possible) with the "start" command-line option. You could try this https://github.com/sevlyar/go-daemon This implements the daemonization by re-running the executable with an environment variable. -- Nick Craig-Wood -- http:/

[go-nuts] What are the consequences of go install -ldflags "-s"

2016-11-04 Thread Nick Craig-Wood
Why wouldn't I want to do this? Any insight much appreciated. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- 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,

Re: [go-nuts] What are the consequences of go install -ldflags "-s"

2016-11-04 Thread Nick Craig-Wood
On 04/11/16 14:55, Ian Lance Taylor wrote: > On Fri, Nov 4, 2016 at 7:39 AM, Nick Craig-Wood wrote: >> I know I can build go binaries passing the `-s` flag to the linker to >> strip them and make them smaller. In my tests (with rclone) it makes it >> 60% of the size so a si

Re: [go-nuts] Slow 64 bit integer division on amd64

2016-11-13 Thread Nick Craig-Wood
> > > > > > -- > Michael T. Jones | Chief Technology Advocate > | m...@google.com | +1 650-335-5765 > > -- > You received this message because you are subscribed to the Google > Groups "golang-nuts&q

Re: [go-nuts] How to hide command line argument from ps

2016-06-23 Thread Nick Craig-Wood
ey are only user readable, which means root or another process running as the same user could read them. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from thi

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2016-06-30 Thread Nick Craig-Wood
ally do this well > in Go. > > Cheers, > > Inspectre > > -- > You received this message because you are subscribed to the Google > Groups "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to golang-nut

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2016-06-30 Thread Nick Craig-Wood
I forgot to add - don't call `wg.Add(1)` inside the go routine - it is racy! If you are trying to start a pool of go routines, you can find that none of them get scheduled before you run the wg.Wait(). -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message be

Re: [go-nuts] Get all attributes with zero value using reflection

2016-08-03 Thread Nick Craig-Wood
Interface() { aField.Set(bField) } } } I won't attempt to modify it to do exactly what you asked as that would require reading the reflect docs again ;-) -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message because you are subscribed

[go-nuts] Generics and parentheses

2020-07-15 Thread Nick Craig-Wood
In my mind the use of [ ] clashes horribly with the array declaration syntax. When I see [int] in particular my brain says, ah array declaration of size int, what, no wait... This makes [identifier] mean two different things depending on whether indentifier is a const integer or whether identi

[go-nuts] Re: Considering dropping GO386=387

2020-07-15 Thread Nick Craig-Wood
I make a GO386=387 build for rclone, eg https://github.com/rclone/rclone/issues/437 People love running rclone on ancient computers to rescue data off them I guess. This would affect a very small percentage of users and there are always older versions of rclone they can use so I'm not too both

Re: [go-nuts] Re: Making temporary changes to 3rd party modules without breaking go install

2023-02-27 Thread Nick Craig-Wood
This is super annoying - you'll see me in the bug report you linked! The way to work around it is to fork the upstream repo into your own repository, apply the one line patch there, then change all the package lines and go.mod to point to your new repo. After you've done all that then in the

[go-nuts] Using underscore in return statements - a small convenience idea

2023-08-23 Thread Nick Craig-Wood
// Sometimes you end up typing this having to return // a value you made up but don't care about. func f1() (int, error) { return -1, errors.New("something went wrong") } // Or maybe like this with named return values. func f2() (a int, err error) { return a, errors.New("something went wrong") }

[go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread Nick Craig-Wood
Ah ha! I thought there would be a related issue I couldn't find :-) `zero` would remove most of the pain though IMHO `_` looks neater in the return statements! Thanks for the pointer Brian. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un