Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-02-10 Thread 'Ivan Burak' via golang-nuts
xpect in the line, then Fscanln is not what you should be > using. > > On Saturday, 8 February 2025 at 21:39:01 UTC Ivan Burak wrote: > >> The correct documentation for current Fscanln() behavior shoud be like >> this >> Fscanln scans text read from r, storing suc

Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-01-28 Thread 'Ivan Burak' via golang-nuts
Hi Jan Thank you for the test enhancing. Please read my answer to Howard https://groups.google.com/g/golang-nuts/c/tzvKTyaugEk/m/5h2Sm03bDgAJ thanks ivan On Monday, January 27, 2025 at 9:37:46 PM UTC+3 Jan Mercl wrote: > On Mon, Jan 27, 2025 at 6:54 PM 'Ivan Burak' via golang-

Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-01-28 Thread 'Ivan Burak' via golang-nuts
umes etc.), so we have to code based on estimates n, n^2, n^3 ... and we don't know the real n. thanks ivan On Monday, January 27, 2025 at 11:29:32 PM UTC+3 Howard C. Shaw III wrote: > In your example, you are repeatedly reading one 'item' from the line. This > is the source

Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-01-27 Thread 'Ivan Burak' via golang-nuts
erous just continue to read till the newline. So concerning the documentation after successful reading the first value in a line we should continue the scanning. [image: FscanlnErr.png] `ivan` On Monday, January 27, 2025 at 7:36:39 AM UTC+3 Ian Lance Taylor wrote: On Sun, Jan 26, 202

[go-nuts] Fscan() eats 1st char in scanning values

2025-01-26 Thread 'Ivan Burak' via golang-nuts
Fscanln() eats a first char in every 2nd, 3rd and other words in any line Thanks Ivan -- 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-nu

[go-nuts] Encrypting credentials config file in production and pseudo key rotation

2022-09-30 Thread Ivan Buljan
Hello World This relates to that never ending question of securing the credentials in production/staging envs, that is, avoiding storing them as plain text I am wondering if anyone could share their thoughts about the following approach we are thinking of taking. Here we go: During build phas

Re: [go-nuts] gofmt 1.19 reformats comments in a way which breaks go-swagger

2022-08-18 Thread Ivan Porto Carrero
I think that indenting everything should work, we are detecting the yaml marker, collect all the lines in the comment until we see a thing that starts with swagger: or the comment block ends and then proceed to uncomment and remove the indentation based on the first line after the --- marker.

[go-nuts] gollvm: meaningless "unsupported llvm::CallingConv::ID"

2021-01-14 Thread Ivan Serdyuk
structs/unions. Also there are OS specific issues - so it more about OS-convention-alignment triple. I would propose some re-design, to offer a purpose specific output, depending on developer's goals. So the output would help to navigate against the next step. Ivan Ivan -- You received

Re: [go-nuts] gollvm: Issues on Alpine linux. Tentative definition has type 'struct sigstack' that is never completed, in sysinfo.c

2021-01-09 Thread Ivan Serdyuk
A patch could be submitted On Wednesday, November 18, 2020 at 4:27:20 AM UTC+2, Ian Lance Taylor wrote: > > On Tue, Nov 17, 2020 at 6:11 AM Than McIntosh > wrote: > > > > > > /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/sysinfo.c:462:1: > > error: tentative defi

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-08 Thread Ivan Serdyuk
CC'ing to Jayesh, Sreenivas, Adarsh from Intel. I am BCC'ing to Sameeran, Tejas from AMD. On Thu, Jan 7, 2021 at 12:21 AM Ivan Serdyuk wrote: > I assume that this should be enforced by CMake - so some build flag would > be provided. So the "default" schema would b

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
o > /home/oceanfish81/Desktop/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/unicode/graphic.go > /home/oceanfish81/Desktop/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/unicode/letter.go > /home/oceanfish81/Desktop/workarea/llvm-project/llvm/tools/gollvm/gofrontend

Re: [go-nuts] Generics and formatting

2021-01-06 Thread Ivan Majeru
If I understand right the panic is because the `m := NewMap[string, int]` is a function not a function call and after that you try to assign to this function `m[int]`. This works https://go2goplay.golang.org/p/NOaPH-dJyWd . On Tue, 2021-01-05 at 08:10 -0800, Brian Candler wrote: > I don't know if t

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
u have that set up, it > should take care of the problem running "llc" from capture-fcn-attributes. > > Than > > > On Wed, Jan 6, 2021 at 3:14 PM Ivan Serdyuk > wrote: > >> I think a caught an error: >> >> $ ./capture-fcn-attributes >>> llc

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
86-pc-linux-gnu isn't listed as a target in > driver/ArchCpusAttrs.h. > > From the root of your repo, try > > $ cd tools > $ go build capture-fcn-attributes.go > $ ./capture-fcn-attributes -o ../driver/ArchCpusAttrs.h > > and then give the gollvm build another t

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
") else() message(SEND_ERROR "Arch ${llarch} not yet supported") endif() diff --git a/driver/Driver.cpp b/driver/Driver.cpp index 8debbab..aa83fb1 100644 --- a/driver/Driver.cpp +++ b/driver/Driver.cpp @@ -76,7 +76,7 @@ std::string Driver::installedLibDir() llvm::sy

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
Than, I could perform "git diff" and provide the generated file. I could also compress & share the build folder. What else would be required? Ivan On Wednesday, January 6, 2021 at 5:07:06 PM UTC+2 th...@google.com wrote: > > It would be helpful if you could put up a CL that

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2021-01-06 Thread Ivan Serdyuk
Ping On Friday, January 1, 2021 at 5:45:02 AM UTC+2 Ivan Serdyuk wrote: > Happy New Year, Than. > > So I have rebuilt llvm-goc, after applying > https://go-review.googlesource.com/c/gollvm/+/270219. > Here > <https://drive.google.com/file/d/1qDSKwKORZjH824gVeSXUknVm0rpK

Re: [go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2020-12-31 Thread Ivan Serdyuk
/oceanfish81/Desktop/workarea/llvm-project/llvm/tools/gollvm/gofrontend/libgo/go/internal/unsafeheader/unsafeheader.go currently Gollvm is not supported on architecture i686 /home/oceanfish81/Desktop/workarea/release/./bin/llvm-goc: *unable to determine target CPU features for target i686-pc-linux-gnu*

[go-nuts] gollvm: capture-fcn-attributes.go generates the header file with improperly chosen CPU model (i686; yonah)

2020-12-04 Thread Ivan Serdyuk
utes -cpu yonah -triples i686-pc-linux-gnu and got // triple: i686-pc-linux-gnu static const CpuAttrs attrs0[] = { // first entry is default cpu { "i686", "+cx8,+x87"}, { "yonah", "+cx8,+fxsr,+mmx,+sse,+sse2,+sse3,+x87"}, { "", "" } // senti

Re: [go-nuts] Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

2020-11-28 Thread Ivan Serdyuk
gure" would be patched properly)? What about cross-compiling (Linux x86_64 -> Linux 64bit RISC-V ) ? Ivan On Tue, Nov 24, 2020 at 4:20 PM Ian Lance Taylor wrote: > On Tue, Nov 24, 2020 at 6:14 AM Richard W.M. Jones > wrote: > > > > One thing I'm missing: Why does g

Re: [go-nuts] Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

2020-11-24 Thread Ivan Serdyuk
Richard, could you tell why gold linker is not available on RISC-V port of Fedora 33? On Sat, Nov 21, 2020 at 12:10 PM Ivan Serdyuk wrote: > Wei, Carlos: adding you to this discussion. > > Carlos, please ask your questions. What was not understood, regarding my > attempt? > >

Re: [go-nuts] Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

2020-11-21 Thread Ivan Serdyuk
Wei, Carlos: adding you to this discussion. Carlos, please ask your questions. What was not understood, regarding my attempt? Hence that QEMU's host OS could be, say, Fedora 32+ x86_64. Ivan On Sat, Nov 21, 2020 at 5:36 AM Ivan Serdyuk wrote: > Hello. > > It is just a brief sur

[go-nuts] Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

2020-11-20 Thread Ivan Serdyuk
pc (since RISC-V assumes some extensions, to cover such demands) - I feel that it might have more sense to get rid of overlaying, for the end-user use cases (which gollvm project itself achieves). Ivan -- You received this message because you are subscribed to the Google Groups "golan

[go-nuts] gollvm: Issues on Alpine linux. Tentative definition has type 'struct sigstack' that is never completed, in sysinfo.c

2020-11-15 Thread Ivan Serdyuk
Hello. I was trying to check what is required to build gollvm on Alpine linux (it has musl instead of glibc). Look like recently revealed set of minimal requirements allowed to build the configuration file (for Ninja). heading to

Re: [go-nuts] Build kubernetes with gollvm

2020-09-26 Thread Ivan Serdyuk
ckages? What is required to patch, within the reflect2 package, so Kubernetes could be compiled via gollvm? Ivan On Sat, Jul 20, 2019 at 5:32 AM Yuan Ting wrote: > OK, I will check out the reflect2 package and take a look. Thanks a lot > for your direction! > > Best, > Ting &

Re: [go-nuts] [proposal] Make go compiler work with different syntax versions in same project to support adaptivity

2020-08-10 Thread Ivan Ivanyuk
Ok, thanks for the clarification. On Mon, Aug 10, 2020 at 9:38 PM Ian Lance Taylor wrote: > On Mon, Aug 10, 2020 at 1:30 AM Ivan Ivanyuk > wrote: > > > > Thank you for answering > > > > Why does it take so long to implement generics then? There is already an &

Re: [go-nuts] [proposal] Make go compiler work with different syntax versions in same project to support adaptivity

2020-08-10 Thread Ivan Ivanyuk
Thank you for answering Why does it take so long to implement generics then? There is already an instrument in playground that works fine. Why not just roll it out and improve design, if needed, in next version? Having generics in 2021 means many projects will choose other languages in 2020, whic

Re: [go-nuts] Failed to build gollvm in a docker container

2020-07-28 Thread Ivan Serdyuk
Yuan, do you have any progress here? Ivan On Thursday, May 28, 2020 at 6:47:41 AM UTC+3 Yuan Ting wrote: > Thanks for your correction, overriding CMAKE_C_FLAGS and CMAKE_ASM_FLAGS > with "-fcf-protection=none" works for me. > I also try to build gollvm from a clean slate (by

Re: [go-nuts] Build kubernetes with gollvm

2020-07-28 Thread Ivan Serdyuk
Yuan, are you still working on gollvm based port of k8s? Ivan On Saturday, July 20, 2019 at 5:32:03 AM UTC+3 Yuan Ting wrote: > OK, I will check out the reflect2 package and take a look. Thanks a lot > for your direction! > > Best, > Ting > > On Friday, July 19, 2019 at 1

[go-nuts] Re: [generics] Zero value

2020-06-19 Thread Ivan Ivanyuk
What about something like int.CreateZeroValue(), or T.CreateZeroValue() and CreateZeroValueInterface? On Thursday, June 18, 2020 at 7:34:55 PM UTC+3, bruno...@gmail.com wrote: > > First, congratulations on the working compiler! Very cool to try out > generics in Go. > > I was experimenting

[go-nuts] Re: Dlopen without Cgo on Darwin (#18296)

2019-12-13 Thread &#x27;Ivan Trubach' via golang-nuts
I plan to finish FFI (the Call/Invoke method) and add dladdr(3) for the sake of completeness, and then the usual README/LICENSE stuff. Still not sure what to do about the C to Go callbacks. Though it seems doable now (runtime.cgocallback). -- You received this message because you are subscribe

Re: [go-nuts] Dlopen without Cgo on Darwin (#18296)

2019-12-13 Thread &#x27;Ivan Trubach' via golang-nuts
Sure, I will. The dyld package should work for dlsym C calls, however I don’t think it’s possible to do callbacks with the functionality runtime exposes (i.e. I am talking about API that sys/windows package provides). So, yeah, while there is no need for Darwin dlopen in x/sys/unix, we still nee

[go-nuts] Dlopen without Cgo on Darwin (#18296)

2019-12-12 Thread &#x27;Ivan Trubach' via golang-nuts
Hi, I’ve stubbled upon issue 18296 (dlopen/dlsym without CGo). The discussion focuses on Linux, but since Go on Darwin already co-exists with libSystem, wouldn’t it be trivial to add Darwin dlopen support to e.g. x/sys/unix? I’ve also set up a small standalone dlopen demo: https://github.com/tie

Re: [go-nuts] golang multiple go routines reading from a channel and performance implications

2019-11-21 Thread Ivan Bertona
You are totally right on that, sorry. It's just > 4k. On Thu, Nov 21, 2019 at 7:13 PM burak serdar wrote: > On Thu, Nov 21, 2019 at 4:59 PM Ivan Bertona wrote: > > > > 1) Yes if you set NumberOfWorkers high enough (> 4k / num CPUs), and > your machine is actu

Re: [go-nuts] golang multiple go routines reading from a channel and performance implications

2019-11-21 Thread Ivan Bertona
whether this would work with your actual workload, again the only way is to try and measure. Best, Ivan On Thursday, November 21, 2019 at 3:24:26 PM UTC-5, Michael Jones wrote: > > Agree. Essentially I'm saying the "channel aspect" is not an issue. > > On Thu, Nov 21,

Re: [go-nuts] Automated Gerrit reviews

2019-07-12 Thread Ivan Borshukov
would be great to have a bot commenting on the change itself, leaving an option for the submitter to resolve the discussion (possibly with explanation why). Thanks, Ivan On Fri, 12 Jul 2019 at 15:55, wrote: > https://github.com/heppu/go-review > > I wrote small tool which takes vario

[go-nuts] Re: go: how to input two-dimensional string array form keyboard??

2019-06-11 Thread Ivan Fraixedes
Could you post your non-working peice of code? it should help to understand what's the problem. On Monday, 10 June 2019 07:19:02 UTC+2, shine sun wrote: > > Firstly, I try to input N and M from keyboard, creating a two-dimensional > string array (var nums [N][M]string). Then, for i := 0; i < N;

[go-nuts] Re: Go will shine on huge web projects, but how about simple ones?

2019-06-07 Thread Ivan Bertona
Perl script in production, even if it was for a simple project. My bet is that if you actually port the Perl script to a Go program that does more or less the same thing you'll see more or less the same performance (because the example is fundamentally I/O-bound). Best, Ivan On Frid

Re: [go-nuts] [48]byte should be make to empty

2019-06-07 Thread ivan . fraixedes
Or even just declare the var without any value assignation because it's zero value is an array of zero byte value, which is 0. var array [48]byte On Thursday, 6 June 2019 17:38:14 UTC+2, Michel Levieux wrote: > > Hi, > > It is not quite clear what you are trying to do, but if I understand it >

Re: [go-nuts] If Go is using libc instead of syscalls on macOS now, why is it not shown via otool -L?

2019-05-03 Thread Ivan Medoedov
Thanks very much. This is all very interesting. On Sat, May 4, 2019 at 2:20 AM wrote: > I don't have hard numbers on slowdowns. It will depend a lot on the binary > in question. > At the time I checked the compiler and linker and it did not slow those > down (to the accuracy of our benchmarks).

[go-nuts] Is it possible to use the Go linker to link C object files?

2019-05-03 Thread ivan . medoedov
Go linker is amazing. It's the only truly cross platform linker. Is it possible to use it to create binaries from object files compiled with C? For example main.c: int main() { puts("Hello"); return 0; } gcc -c -o main.o main.c go tool link main.o main.o: not package main -- You received t

Re: [go-nuts] If Go is using libc instead of syscalls on macOS now, why is it not shown via otool -L?

2019-05-03 Thread ivan . medoedov
I know that calling C functions via cgo is relatively expensive because of the goroutines, so there must be some optimizations/tricks to make all these libc calls fast. On Saturday, May 4, 2019 at 12:21:27 AM UTC+2, ivan.m...@gmail.com wrote: > > Indeed, it works with Go 1.12. I have 3 different

Re: [go-nuts] If Go is using libc instead of syscalls on macOS now, why is it not shown via otool -L?

2019-05-03 Thread ivan . medoedov
Indeed, it works with Go 1.12. I have 3 different Go versions, and my aliasing was messed up. Sorry. > No. The Linux kernel, fortunately, supports static linking and provides a stable syscall API. There is no reason to make this change on GNU/Linux. Good to know, thanks. So Linux, BSD, Plan9

[go-nuts] If Go is using libc instead of syscalls on macOS now, why is it not shown via otool -L?

2019-05-03 Thread ivan . medoedov
f /usr/lib/libSystem.B.dylib is linked, I get nothing. Is it because Go uses its own linker that's not supported by macOS tools? P.S. Are there plans to do the same transition for Linux for consistency and stability? Thanks. -Ivan -- You received this message because you are subscr

Re: [go-nuts] Is Go a single pass compiler?

2019-02-27 Thread ivan . medoedov
Thanks, Ian. I remember reading in some compiler book that languages should be designed for a single pass to reduce compilation speed. Go proves that wrong :) It's amazingly fast, looks like computers are pretty good at traversing AST trees. On Wednesday, February 27, 2019 at 11:50:05 PM UTC+1

[go-nuts] Is Go a single pass compiler?

2019-02-27 Thread ivan . medoedov
Hello, In Go functions can be used before they are defined, but as I understand, it's still possible to have a single pass compiler. Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emai

Re: [go-nuts] Alternative of defer?

2019-02-08 Thread Ivan Bertona
even when a package uses panic > internally, its external API still presents explicit error return values. > > But yes, agree with the problem in the situation that you describe > > On Fri, Feb 8, 2019 at 4:24 PM Ivan Bertona wrote: > >> What's suboptimal with the first one (or t

Re: [go-nuts] Alternative of defer?

2019-02-08 Thread Ivan Bertona
What's suboptimal with the first one (or the second one) is that if performOperation1() panics the lock will not be released. It may or may not be a problem depending on the situation. Your assessment of defer used with locks is correct - it works well only if the lock doesn't need to be releas

[go-nuts] Re: Request Content Length zero when copy from another Request

2019-02-06 Thread ivan
What you are seeing here is an edge case caused by the fact that the first NewRequest wraps your strings.Reader into a ioutil.NopCloser. When NewRequest is called the second time, the type switch no longer matches a type for which the length is known, so ContentLength is left to 0, which accord

Re: [go-nuts] Why not a mixture of value and pointer receiver?

2019-01-23 Thread Ivan Fraixedes
Perhaps There is a handy exception, though. When the value is addressable, the > language takes care of the common case of invoking a pointer method on a > value by inserting the address operator automatically. In our example, the > variable b is addressable, so we can call its Write method wi

Re: [go-nuts] go test linking time issue

2019-01-11 Thread Ivan Tolstosheyev
It's go version go1.11.2 linux/amd64 now. We are flexible with go versions. On Fri, Jan 11, 2019 at 5:52 PM Ian Lance Taylor wrote: > On Fri, Jan 11, 2019 at 5:49 AM wrote: > > > > I'm working on pretty big golang project. This project consists of > several hundreds of packages, most of them ar

[go-nuts] Re: scanner.Scan is holding my goroutine ;(

2018-12-13 Thread Ivan Korjavin
hank you! On Friday, December 14, 2018 at 3:28:20 AM UTC+5, Ivan Korjavin wrote: > > I have a goroutenie with scanner.Scan > It looks like: > > ``` > cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) // 10s > scanner := bufio.NewScanner(cnn) > for scanner.Scan() { > ...

[go-nuts] scanner.Scan is holding my goroutine ;(

2018-12-13 Thread Ivan Korjavin
I have a goroutenie with scanner.Scan It looks like: ``` cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) // 10s scanner := bufio.NewScanner(cnn) for scanner.Scan() { ... } ``` cnn is a net.Conn there My problem is when I call cnn.Close() (and I tried cnn.SetReadDeadline(time.Now()) in addition

[go-nuts] Re: [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-12-01 Thread ivan . corrales
Last weeks I've been working on improving performance in Koazee. I put in practice all your advices and even though I don't have a second release ready, I wrote an article to share my experience trying to improve performance https://www.linkedin.com/pulse/go-performance-tips-iv%C3%A1n-cor

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-13 Thread ivan . corrales
Thanks a million rog! I completely understand what you say. Regarding to the performance, I didn't expect as bad performance as I found yesterday when running my benchmark test and I will be focused on being able to improve it as much as I can. I found a way to improve performance in primitiv

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-12 Thread ivan . corrales
Hey Bakul again, I've been having a look at kona, and the project looks so good, I will look in deep trying to get some good ideas as you recommend me, In regards to the code generation, I've never done to be honest, but obviously the performance should be better. By the way, @Marko_Ristin c

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-12 Thread ivan . corrales
Hey Bakul thank you so much for your feedback, It's so great receive these kind of suggestions, I will create the required issue for implementing it. Cheers! El lunes, 12 de noviembre de 2018, 12:17:12 (UTC+1), Bakul Shah escribió: > > On Nov 11, 2018, at 11:27 AM, Iván Corrales Solera < >

[go-nuts] Re: Reproducible builds and rewriting buildid in binary

2018-09-16 Thread Ivan Daniluk
Wrong link to the related Go's issue. It's https://github.com/golang/go/issues/16860. On Sunday, September 16, 2018 at 2:49:19 PM UTC+3, Ivan Daniluk wrote: > > I needed to find a way to create reproducible builds, regardless of the > dev environment user uses. Lucki

[go-nuts] Reproducible builds and rewriting buildid in binary

2018-09-16 Thread Ivan Daniluk
I needed to find a way to create reproducible builds, regardless of the dev environment user uses. Luckily, Go gives almost everything needed for that out-of-the-box, and there is a great blog post by Filippo on the topic: https://blog.filippo.io/reproducing-go-binaries-byte-by-byte. If we have

[go-nuts] [ANN] configuration file database mollydb

2018-04-17 Thread ivan . corrales . solera
Hey guys, A few weeks ago I was working on implementing a database that managed configuration files (in the very first version would only deal with yml) . This database provide a GraphQL Api which could be used to access to information but also to register hooks. I have some ideas to make

[go-nuts] Avoiding html/template's escaping of the + in

2018-03-31 Thread ivan
Hi I have an HTML template where I'd like to provide tags externally. I'd like to leverage html/template's escaping for href. Therefore, it seemed easiest to just create a struct with fields for rel, href, title and type. Trying to just use string types means I get everything escaped. Surpris

[go-nuts] Re: [mysql] 2017/12/23 11:09:37 packets.go:141: write tcp 127.0.0.1:20630->127.0.0.1:3306: write: broken pipe

2017-12-24 Thread Ivan Mladenovic
Write:broken pipe is usually an indication that an idle connection has been closed by the server. There is an API in database/sql package for this reason. See https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime Assuming you are using MySQL, MariaDB, you can read current timeout settin

Re: [go-nuts] Github wiki pages publicly editable

2017-12-14 Thread Ivan Borshukov
Forwarding to the mailing list this time. Cheers. On Dec 14, 2017 18:14, "Ivan Borshukov" wrote: Ok, thanks. If so, I want to announce the change that I've maid. It is regarding the rate limiting section [0]. The wiki page states that when the created ticker is Stop-ed, the cr

Re: [go-nuts] Variadic assignable values and covariance

2017-12-14 Thread Ivan Kurnosov
er 2017 at 12:59, Jesse McNelis wrote: > On Fri, Dec 15, 2017 at 8:18 AM, Ivan Kurnosov wrote: > > Why does this code not compile: https://play.golang.org/p/f5fMvO8Ns7 > > func f(items ...interface{}) { > > fmt.Println(items) > > } > > The spec also says: > >

[go-nuts] Variadic assignable values and covariance

2017-12-14 Thread Ivan Kurnosov
Why does this code not compile: https://play.golang.org/p/f5fMvO8Ns7 package main import ( "fmt" ) func f(items ...interface{}) { fmt.Println(items) } func main() { f("a", "b", "c") tab := []interface{}{"d"} f("a", "b", "c", tab...) } The spec says: > Otherwise, the value passed is a

[go-nuts] Github wiki pages publicly editable

2017-12-14 Thread Ivan Borshukov
Hello, I've noticed that I'm able to edit the wiki pages on https://github.com/golang/go/wiki and I wonder whether this is intentional. Cheers, Ivan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Golang on Android

2017-11-22 Thread ivan . matmati
Hi there, I'm sure you already tried to find an apk to run your go code on your Android tablet. Certainly, like me you hit a wall. But I've juste discovered something unnoticed by most of us. You can install golang on Android ! How ? Look at my post : https://www.linkedin.com/groups/3712244 Bye

[go-nuts] Re: [ANN] roger, an app configuration library experiment

2017-10-09 Thread Ivan Fraixedes
Thanks for this library, I also found some of those missing features that you listed in the README. On Monday, 9 October 2017 00:56:32 UTC+2, Alex Buchanan wrote: > > My weekend project for that past couple weeks has been roger: > https://github.com/buchanae/roger > > This is another take on app

[go-nuts] github.com/golang/glog: Using replacement flag packages

2017-06-25 Thread Ivan Vučica
Hello, Since glog's readme recommends firing off an email to golang-nuts to report possible issues, here I go. I really like the idea of specifying flags in flagfiles and environment variables. This Go package seems to let me do that, while staying pretty much API-compatible with the standard fla

Re: [go-nuts] Implicit cast of string vs. []byte

2017-06-24 Thread Ivan Bertona
I see, thank you! On Saturday, June 24, 2017 at 5:46:55 PM UTC-7, Ayan George wrote: > > > On 06/24/2017 08:16 PM, Ivan Bertona wrote: > > Hello, > > > > When I try to compile this piece of code: > > > > I think it violates the second assignability r

[go-nuts] Implicit cast of string vs. []byte

2017-06-24 Thread Ivan Bertona
tring() b, err = GetBytes() } I get this error: tmp/sandbox008752331/main.go:19: cannot assign string to s (type MyString) in multiple assignment Does anyone know why implicit casting from []byte to MyBytes works, but it doesn't for string to MyString? Best, Ivan -- You received this mess

[go-nuts] How to find all func X calls using AST parser/types?

2017-06-09 Thread Ivan Daniluk
Hi, let's say you want to find all calls to the specific function (strconv.Atoi, for example) using AST. It's kinda easy to do using Info.Uses, but how to go from Object in Uses to the whole expression with call? Let's say, we have a code: package main import "strconv" var fn = strconv.Ato

[go-nuts] encoding/asn1: Accept the non-PrintableString character underscore

2017-05-09 Thread Ivan Borshukov
her than forking the x509 and asn1 packages or building with custom standard library. The exact piece of functionality i need is x509.ParseCertificate, which internally relies on asn1.Marshal. Thanks in advance! Regards, Ivan [1] https://github.com/golang/go/issues/14017 [2] https://groups.go

[go-nuts] Re: Turning unicode code string to rune

2017-04-22 Thread Ivan Kurnosov
1. Convert it to a number 2. Use `rune()` On Sunday, April 23, 2017 at 6:51:09 AM UTC+12, Tong Sun wrote: > > Hi, > > Given a unicode code string, be it "4e16", or "0x4e16", or "u4e16", how to > turn it into a single char rune? > > You can finish the code at https://play.golang.org/p/AFIEz3eJVz

Re: [go-nuts] Why sort.IsSorted implemented with decrement?

2017-04-20 Thread Ivan Kurnosov
Speaking low level - how about memory prefetch algorithms (os, hardware)? Do they work equally good when one iterates backward? On Friday, April 21, 2017 at 3:50:39 PM UTC+12, andrey mirtchovski wrote: > > > 297 for i := n - 1; i > 0; i-- { > > "i > 0" is cheaper than "i < n" on some processors

Re: [go-nuts] Why sort.IsSorted implemented with decrement?

2017-04-20 Thread Ivan Kurnosov
@Rob, honestly to me they look the same: func IsSorted(data Interface) bool { n := data.Len() for i := n - 1; i > 0; i-- { if data.Less(i, i-1) { return false } } return true } func IsSortedForward(data sort.Interface) bool { n := data.Len() f

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-24 Thread Ivan Vučica
you can not invoke > reflected RPC calls with the go grpc implementation. Related issues are > https://github.com/golang/protobuf/issues/199 > https://github.com/grpc/grpc-go/issues/866 > > On Thu, Feb 23, 2017 at 1:16 PM, Ivan Vučica wrote: > >> What I want, in the

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-23 Thread Ivan Vučica
What I want, in the end, is to send a gRPC request based on an ASCII or JSON representation of a protobuf, receive a response and display it. Essentially, if you take grpc_cli tool present in the repo of C implementation of gRPC, I would like to implement its "call" functionality. Even though try

[go-nuts] Re: Using React with Golang? and does it make sense?

2017-02-06 Thread ivan
You don't have to use server-side rendering. You can have the React client make ajax requests to your Go backend. On Monday, February 6, 2017 at 12:09:10 PM UTC-5, so.q...@gmail.com wrote: > > Correct me if I'm wrong, but in serving web apps and sites. > > Golang simply fills in the blanks for pr

[go-nuts] Re: Golang and WebAssembly

2016-12-17 Thread Ivan Perevezentsev
Yes, WebAssembly would be really nice replacement for gopherjs, especially for game development. Go already reached realtime garbage collection using native runtime, so theoretically we can make smooth games with 60 FPS. But gopherjs transpiles Go into JavaScript, which adds additional overhead

[go-nuts] Re: playground URL to fetch code only

2016-09-20 Thread Ivan Anfilatov
https://play.golang.org/p/Vg6f0gSs3l.go compile - post request to https://play.golang.org/compile in body request - source response - json вторник, 20 сентября 2016 г., 16:09:47 UTC+3 пользователь Marvin Renich написал: > > Is there a way to take a playground URL, such as > https://play.gola