[go-nuts] Understanding go garbage collector

2023-06-02 Thread Ilya
I am trying to dive deeper into golang and started looking at golang GC implementation. I have read the article and try to wrap my head around it. Lets look at the Reasoning

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

2020-12-02 Thread Kostarev Ilya
$ git checkout master in source tree provide me `io/fs` On Thu, Dec 3, 2020 at 3:10 AM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > No, that's not really possible. The stdlib is packaged with the Go > compiler and is very interdependent. > It also wouldn't help you a l

[go-nuts] Go-kit middlewares

2017-09-05 Thread Ilya Novikov
Hello!I would like to understand how middleware works in go-kit. I want to write a middleware auth processor but do not understand how to describe the logic of the process. That is, I need to take the cookie values ​​from the context and perform the rights check? After all, in middleware com

Re: [go-nuts] strings and when to use them

2017-05-11 Thread Ilya Kostarev
On Wed, 10 May 2017 10:05:56 -0700 (PDT) Zachary Kaplan wrote: > can somebody please explain to me when a function > should to return a string as opposed to, say a []byte? thanks > Just a few examples. Strings can be keys in map[string]something, []byte can't be a key due to them are non compara

[go-nuts] How to pass value in nested template if possible?

2017-03-13 Thread Ilya Kostarev
;inner"}}{{end}}`)).ExecuteTemplate(os.Stdout, "outer", "foo"); err != nil { print(err) } which write instead of desired "foo". Error isn't spawned. Am I missing something? Cheers. __ Ilya -- You received this message because you are subscribed to

Re: [go-nuts] Re: correct/working 9p2000 library in Go?

2017-02-24 Thread Ilya Kostarev
Hi, David thanks for the code, slightly offtopic, seems you heavily use Acme which can explore 9p file system directly without mounting, but I forget the syntax on plan9port and can't find appropriate documentation. Can you kindly give me a hint. Cheers __ Ilya On 02/24/2017 10:20 AM,

Re: [go-nuts] How could the body for a func be "provided by runtime"?

2017-02-09 Thread Ilya Kostarev
It's documented. From lang spec https://golang.org/ref/spec#Function_declarations "A function declaration may omit the body. Such a declaration provides the signature for a function implemented outside Go, such as an assembly routine." On Thu, 9 Feb 2017 04:15:00 -0800 (PS

Re: [go-nuts] [ANN] Memo: take a note in CUI

2017-02-09 Thread Ilya Kostarev
is too hulky bulky. __ Ilya On Wed, 8 Feb 2017 15:51:08 -0800 (PST) mattn wrote: > Hi list. > > I wrote new app to take a note in CUI. This is smaller, easy, fast, > pretty, seamless for taking notes. Moving the directory into local > Dropbox may be useful. One of the feature,

Re: [go-nuts] How to use embedded type to implement functional options for group of related types

2017-02-08 Thread Ilya Kostarev
.SetTable(table) } } make code at least compile and run. __ Ilya -- 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] Re: Is there something wrong with performance of select in a for loop

2017-02-06 Thread Ilya Kostarev
Seems for me, you don't do any selection like in JS code, even any polling. Sure it would perform better. (Maybe I'm missing something, not so proficient in nodejs) On 02/06/2017 08:56 AM, fwang2...@gmail.com wrote: For compared with nodejs: if I remove all the serverDone case, only left the t

Re: [go-nuts] How do you take a cipher.StreamWriter and pass it to a io.Reader

2017-02-02 Thread Ilya Kostarev
You can use io.TeeReader to connect them all. Also to simultaneously read from one file, encrypt, and write to another file on the fly you seems to need a bit of concurrency func (b2h *B2Handler) EncyptandUpload(iv []byte, fileName string, outputFileName string) { key := []byte("example key

Re: [go-nuts] How do you take a cipher.StreamWriter and pass it to a io.Reader

2017-02-02 Thread Ilya Kostarev
Try to construct an io.Pipe maybe pReader, pWriter := io.Pipe() writer:= &cipher.StreamWriter{S: stream, W: pWriter} UploadFile(outputFileName, metadata, pReader) writer.Write(src) On 02/02/2017 10:27 PM, Justin C wrote: I have a encryption function that gives a cipher.StreamWrit

Re: [go-nuts] testing.Benchmark Unanswered StackOverflow question. Looks like a bug.

2017-01-27 Thread Ilya Kostarev
On 01/27/2017 05:20 PM, Ian Lance Taylor wrote: Please file an issue at https://golang.org/issue/new. Thanks. Ian Ian, done, issued. -- 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 i

[go-nuts] testing.Benchmark Unanswered StackOverflow question. Looks like a bug.

2017-01-27 Thread Ilya Kostarev
ooks like a bug, or documentation incorrectness/incompleteness. __ Ilya Kostarev -- 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...@goog

Re: [go-nuts] Re: Why a single go routine with sleep is using 100% cpu (1 core)

2016-09-11 Thread Ilya Kostarev
tions however `default` most likely be an essence. CPU load is a cost of `select` which is quite expensive operation. __ Ilya Kostarev -- 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] Re: Can't understand untyped constant behavior

2016-09-11 Thread Ilya Kostarev
are integer constants. Manlio Hi Manio. Things are not so simple, say const x, y = int 5, 3 / /explicitly var f float32 = x / y just doesn't compile with an error "cannot use x / y (type int) as type float32 in assignment" __ Ilya Kostarev -- You receiv

[go-nuts] Can't understand untyped constant behavior

2016-09-08 Thread Ilya Kostarev
package main import "fmt" func main() { const x, y = 5, 3 var f float32 = x / y fmt.Println(f) } output 1 https://play.golang.org/p/FH1f793gWI How this doesn't produce 1.6 Would be thankful for explanation. __ Ilya Kostarev -- Yo

Re: [go-nuts] Re: Broadcasting via channel

2016-09-04 Thread Ilya Kostarev
On 09/05/2016 12:14 AM, Jason E. Aten wrote: Or perhaps it is because sync.WaitGroup and sync.Cond (condition variables) exist. They aren't select{}-friendly, but they usually do the job. Yes they aren't select{}-friendly. sync.Cond for example looks like right choice but just blocks. --

[go-nuts] Broadcasting via channel

2016-09-03 Thread Ilya Kostarev
nal = closed //... signal = blocked Does it considered meaningful or/and at least safe? -- Ilya Kostarev -- 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 ema