[go-nuts] Re: Creating “.msg” file for Outlook in Golang

2018-11-01 Thread Tamás Gulácsi
2018. november 2., péntek 6:00:33 UTC+1 időpontban Navindra Kumar a következőt írta: > > I want to create a file in Microsoft Outlook .msg format on my local > machine by using Golang so that when a user clicks on the .msg file it > could open in MS Outlook. Please help if anybody has done it. >

[go-nuts] Re: Large (binary or text) File transfers over rpc

2018-11-01 Thread Tamás Gulácsi
2018. november 2., péntek 6:21:47 UTC+1 időpontban Anirudh Vyas a következőt írta: > > Hello there - > > I am looking for example/help for using rpc to do file downloads - I am > not sure if this is possible, or recommended or if there is a > better/cleaner way. I like the robust nature of RPCs

[go-nuts] Large (binary or text) File transfers over rpc

2018-11-01 Thread Anirudh Vyas
Hello there - I am looking for example/help for using rpc to do file downloads - I am not sure if this is possible, or recommended or if there is a better/cleaner way. I like the robust nature of RPCs and have written a few good, performant distributed systems in them - was hoping/wondering if

[go-nuts] Creating “.msg” file for Outlook in Golang

2018-11-01 Thread Navindra Kumar
I want to create a file in Microsoft Outlook .msg format on my local machine by using Golang so that when a user clicks on the .msg file it could open in MS Outlook. Please help if anybody has done it. -- You received this message because you are subscribed to the Google Groups "golang-nuts" g

[go-nuts] Re: discuss database/sql feature request: add ability to retrieve driver.Driver by registered driver name.

2018-11-01 Thread Daniel Theophanes
Driver name issue: https://golang.org/issue/12600 But I think I would prefer to solve: https://golang.org/issue/18080 Now with connectors (sql.OpenDB) drivers may not have a "name". I would love a working proposal that would take the place of ocsql, or at least provide it hooks to work without w

Re: [go-nuts] Heap of structs

2018-11-01 Thread Space A.
https://tour.golang.org/ пятница, 2 ноября 2018 г., 1:10:25 UTC+3 пользователь Alex Dvoretskiy написал: > > I managed to implement it. It turned out to be easier... I was thinking > about using pointers to struct instead of variables.. > > On Thursday, November 1, 2018 at 12:49:55 PM UTC-7, Nath

[go-nuts] error building go from source

2018-11-01 Thread DrGo
wondering if anyone ran into this issue trying to build go1.11.1 or tip *➜ **src* *git:(**26957168c4**) **✗* ./all.bash Building Go cmd/dist using /usr/local/Cellar/go/1.11.1/libexec. Building Go toolchain1 using /usr/local/Cellar/go/1.11.1/libexec. go: warning: "bootstrap/cmd/..."

Re: [go-nuts] struct type assertion

2018-11-01 Thread Bruno Albuquerque
item.(record) (in the specific case). On Thu, Nov 1, 2018 at 3:59 PM Alex Dvoretskiy wrote: > Is it possible to implement type assertion from interface to struct?: > > https://play.golang.org/p/xK4mlF32_NR > > -- > You received this message because you are subscribed to the Google Groups > "gol

[go-nuts] struct type assertion

2018-11-01 Thread Alex Dvoretskiy
Is it possible to implement type assertion from interface to struct?: https://play.golang.org/p/xK4mlF32_NR -- 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 golan

Re: [go-nuts] Surprising number of threads

2018-11-01 Thread Ian Lance Taylor
On Thu, Nov 1, 2018 at 2:58 PM, Michael MacInnis wrote: > > On Thursday, November 1, 2018 at 12:20:39 PM UTC-4, Ian Lance Taylor wrote: >> >> >> Every blocking cgo call requires a thread. Also every Go program has >> a supporting thread that monitors the programs. If you see only 4 >> threads fo

Re: [go-nuts] Heap of structs

2018-11-01 Thread Alex Dvoretskiy
I managed to implement it. It turned out to be easier... I was thinking about using pointers to struct instead of variables.. On Thursday, November 1, 2018 at 12:49:55 PM UTC-7, Nathan Fisher wrote: > > Is there a specific issue you’re experiencing in trying to implement it? > > Suggestions/obser

Re: [go-nuts] Surprising number of threads

2018-11-01 Thread Michael MacInnis
On Thursday, November 1, 2018 at 12:20:39 PM UTC-4, Ian Lance Taylor wrote: > > > Every blocking cgo call requires a thread. Also every Go program has > a supporting thread that monitors the programs. If you see only 4 > threads for that program then I think we're doing pretty well. > > Ian

Re: [go-nuts] Heap of structs

2018-11-01 Thread Bruno Albuquerque
You just need to implement the required methods (Len, Less, Swap) for your type (str is a terrible name, BTW. First time I saw it I though of string, not struct). On Thu, Nov 1, 2018 at 11:57 AM Alex Dvoretskiy wrote: > How can I rewrite this code to use a heap of structs instead of a heap of >

[go-nuts] Re: go client issue with apache SSL

2018-11-01 Thread Valentin Kuznetsov
I found a remedy. Turns out that it is misconfiguration of apache server who supposes to follow the chain of client certificates provided by go client. Surprisingly it is not the case of curl and python clients, i.e. when I used them the apache server was able to recognize client certificates.

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Jamie Clarkson
On Thursday, November 1, 2018 at 6:19:58 PM UTC, Mandolyte wrote: > > Ah, I see. the albrow/fo package is the equivalent of just pasting the > entire function into the contract. > > Could you expand on this a little, I'm not sure I follow? Would it handle the Graph contract? I agree, I had mi

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Jamie Clarkson
On Thursday, November 1, 2018 at 6:19:58 PM UTC, Mandolyte wrote: > > Ah, I see. the albrow/fo package is the equivalent of just pasting the > entire function into the contract. > > I've not looked too closely but not sure I follow this? Is it able to handle the Graph example constraint with t

Re: [go-nuts] Heap of structs

2018-11-01 Thread Nathan Fisher
Is there a specific issue you’re experiencing in trying to implement it? Suggestions/observations: - export the struct (Str instead of str) if you’re exporting the Heap. - same for the fields in the struct unless you have a constructor function (eg New) and appropriate functions to modify/view th

[go-nuts] Heap of structs

2018-11-01 Thread Alex Dvoretskiy
How can I rewrite this code to use a heap of structs instead of a heap of ints? Have: type IntHeap []int Need: type str struct { num int, val string } type Heap []str https://play.golang.org/p/KHhIvKMkNMy -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Ian Denhardt
It looks like it will treat it as generic type definition only if T is not defined elsewhere: https://play.folang.org/p/lN2b6QfgH38 * Commenting out const Size = ... -- results in an error about a missing type parameter * Deleting the Size constant and declaring a function named Size -- r

Re: [go-nuts] Go Performance

2018-11-01 Thread robert engels
Final update on this, using a technique from my HFT days, by spinning the main routing thread longer before parking I reduced the latency numbers with Java to: duration avg 186828 min 152425 max 968440 which are back inline with the original that did not use the intermediary queue. It did not m

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Mandolyte
Ah, I see. the albrow/fo package is the equivalent of just pasting the entire function into the contract. I agree, I had mixed feelings about contracts too at first. But I came to appreciate, in descending order: - It would be good documentation in godoc - It enables much better error mes

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Mandolyte
I didn't encounter this when I experimented with the package (here ). So not sure. However, as an array, T cannot be a variable, it must be a constant... so perhaps it can be figured out - see https://play.golang.org/ On Thursday, November 1, 2018 at 11:54:31 AM UT

Re: [go-nuts] Re: Go2 Error Handling Feedback

2018-11-01 Thread Burak Serdar
On Thu, Nov 1, 2018 at 5:18 AM Laurent Moussault wrote: > > IMHO, this kind of refactorization actually makes the code less readable, for > everyone but the programmer that just wrote it. Though it may seem obvious at > first what functions like "CopyFile" do, an outsider reading the code will

Re: [go-nuts] Go Performance

2018-11-01 Thread robert engels
Just an update for those who may be interested. With some improvements to the Java side, and using a more realistic test of 1 pub and 1 sub, the results: Java: without SSL, 3450k msgs per sec with SSL, 1300k msgs per sec Go: without SSL, 3600k msgs per sec with SSL, 1800k msgs per sec Clearly

[go-nuts] Re: non-standard json

2018-11-01 Thread gary . willoughby
If the file is consistent parse the Json part out of each line and just unmarshal it. On Thursday, 1 November 2018 16:14:17 UTC, Alex Dvoretskiy wrote: > > Is there is a way to read a file line by line and extract JSON data from > it? > > > Example: > > file: > ` > value1: {"field1": "123, "fie

Re: [go-nuts] Surprising number of threads

2018-11-01 Thread Ian Lance Taylor
On Thu, Nov 1, 2018 at 7:24 AM, Michael MacInnis wrote: > > While running a Go program that uses Cgo, I noticed a surprising number of > threads. I believe the code below demonstrates what I'm seeing minus (what I > hope are) extraneous details. > > package main > > // #include > import "C" > > f

[go-nuts] non-standard json

2018-11-01 Thread Alex Dvoretskiy
Is there is a way to read a file line by line and extract JSON data from it? Example: file: ` value1: {"field1": "123, "field2": "123"} value2: {"field1": "456", "field2": "879"} ` I need to extract the struct in a loop: type s struct { field1 string field2 string } --

[go-nuts] Surprising number of threads

2018-11-01 Thread Michael MacInnis
While running a Go program that uses Cgo, I noticed a surprising number of threads. I believe the code below demonstrates what I'm seeing minus (what I hope are) extraneous details. package main // #include import "C" func main() { for { C.nanosleep(&C.struct_timespec{tv_sec: 0, t

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Ian Denhardt
Quoting Mandolyte (2018-11-01 06:30:30) > - it uses square brackets instead of (type .. ) for the type parameters What does it do with `type Foo [T] int`? The draft design cites this ambiguity (is it a generic type with an unused parameter, or an array of length T?) as the reason for not using sq

Re: [go-nuts] json.Marshal

2018-11-01 Thread robert engels
Capital Letters = export > On Nov 1, 2018, at 9:22 AM, Alex Dvoretskiy wrote: > > No, no need to export, unless fields have weird names. Fields must be with > capital letters: > > https://play.golang.org/p/zMeKqW-4JT9 > > On Wednesday, October 31, 2018 at 11:12:05 PM UTC-7, kortschak wrote: >

Re: [go-nuts] json.Marshal

2018-11-01 Thread Alex Dvoretskiy
No, no need to export, unless fields have weird names. Fields must be with capital letters: https://play.golang.org/p/zMeKqW-4JT9 On Wednesday, October 31, 2018 at 11:12:05 PM UTC-7, kortschak wrote: > > https://play.golang.org/p/Se8wXfYZVZG > > You need to export the field: > ``` > Struct va

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Jamie Clarkson
Thanks, that looks like a cool project - however I'd disagree that not using contracts is relevant to the question. My interest was mainly in what would need to be implicitly generated by the compiler in order to support contracts (such as the mutual recursive types above), not specifically t

[go-nuts] joomcode/errorx: a comprehensive library for errors and error handling

2018-11-01 Thread p . ivanov
Hi everyone! I'd like to present errorx, a package for dealing with errors in Go. This is a package we're very happy with at Joom, and we hope it can also benefit a wider Go community. Package: https://github.com/joomcode/errorx Godoc: https://godoc.org/github.com/joomcode/errorx -- You receiv

[go-nuts] Power assembly for "Reed-Solomon Erasure Code engine in Go"

2018-11-01 Thread Amit Ghatwal
Hi All, Does anyone have a prior experience working on "ppc64le/power" assembly . I have been trying to understand the process for creating optimized go code for power(ppc64le) in here https://github.com/klauspost/reedsolomon

Re: [go-nuts] Go2 Error Handling Feedback

2018-11-01 Thread Jan Mercl
On Thu, Nov 1, 2018 at 10:17 AM Henry wrote: > About error handling, I prefer the Go1 error handling approach. It is simple, readable, and scalable. Everything is laid out in plain sight and there is no hidden alternate execution paths. Thanks for expressing thoughts I share. Signed. -- -j -

[go-nuts] Re: Go2 Error Handling Feedback

2018-11-01 Thread Laurent Moussault
IMHO, this kind of refactorization actually makes the code less readable, for everyone but the programmer that just wrote it. Though it may seem obvious at first what functions like "CopyFile" do, an outsider reading the code will have to check the source to know for sure what is going on. Whe

Re: [go-nuts] Code generated by generics draft

2018-11-01 Thread Mandolyte
You can use https://github.com/albrow/fo and see what code it generates. Conceptually, I imagine will it be close to what the draft spec would produce. Some differences and limitations: - it uses square brackets instead of (type .. ) for the type parameters - it is limited to a single main() pack

[go-nuts] Go2 Error Handling Feedback

2018-11-01 Thread Henry
Hi, I am concerned with the direction Go2 is going. If anything, Go2 should reduce and consolidate features from Go1 rather than adding new ones. Remember that C++ and Java too were once simple languages and people keep adding stuffs instead of consolidating features. About error handling, I

[go-nuts] [ANN] go-mutesting v1.1 - Mutation testing for Go source code

2018-11-01 Thread Markus Zimmermann
Hi gophers! I would like to announce v1.1 of go-mutesting https://github.com/zimmski/go-mutesting/releases/tag/v1.1 Changes from 1.0 to 1.1 - Mutator for the comparison operators “<”, “<=”, “>” and “>=” to catch off-by-one problems - Complete blacklist of reserved and built-in keywords tha