[go-nuts] Re: google civic api

2018-11-20 Thread Alex Dvoretskiy
I need the other states, CA, IL... and the other districts 3, 5, 15...: "ocd-division/country:us/state:wi/cd:3" "ocd-division/country:us/state:ca/cd:6" "ocd-division/country:us/state:il/cd:7" I think it's not quite possible to unmarshal this... perhaps use string functions to get congressional di

Re: [go-nuts] google civic api

2018-11-20 Thread robert engels
You need to know the congressional district you were querying, in this case 3, then the parent key is: > ocd-division/country:us/state:wi/cd:3 and the full record > "ocd-division/country:us/state:wi/cd:3": { >"name": "Wisconsin's 3rd congressional district", >"officeIndices": [ > 3

Re: [go-nuts] Re: PDF to Image/SVG in Golang

2018-11-20 Thread waTR
Here is some example code that converts PDFs (all pages) to JPG, and uploads to s3 for good measure! Brilliant ! https://github.com/catherinelu/evangelist/blob/master/server.go On Monday, 16 May 2016 22:37:28 UTC-7, Bogdan Bursuc wrote: > > Ghostscript is the way to go on this: is the fastest

[go-nuts] Re: PDF to Image/SVG in Golang

2018-11-20 Thread waTR
Here is an article/tutorial for how to do this with ImageMagick: https://golangcode.com/convert-pdf-to-jpg/ On Monday, 16 May 2016 13:10:38 UTC-7, waTR wrote: > > ImageMagick is looking like the way to go. However, there is also this: > https://github.com/yob/pdfreader > > > > On Monday, 16 Ma

[go-nuts] Re: go language sensitive editor?

2018-11-20 Thread Alex Dvoretskiy
If you using vim: https://github.com/fatih/vim-go On Tuesday, November 20, 2018 at 12:52:11 PM UTC-8, Pat Farrell wrote: > > I know, this is both a FAQ and an unanswerable question. I'm an old > programmer who has used nearly every editor known to man. I am not a fan of > whole-universe IDEs, bu

[go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Alex Dvoretskiy
If you using vim, keep using it: https://github.com/fatih/vim-go On Tuesday, November 20, 2018 at 11:28:03 AM UTC-8, Alex Dvoretskiy wrote: > > > > file, err := os.Open(inputFile) > if err != nil { > log.Fatal(err) > } > defer file.Close() > scanner := bufio.NewScanner(file) > address := "" > > sc

Re: [go-nuts] New issue: internal compiler error: 'xfunc_22': panic during fuse while compiling xfunc_22

2018-11-20 Thread Ian Lance Taylor
Thanks. I can recreate the error with 1.11.2, but the file compiles with tip. I would guess that this is https://golang.org/issue/28616, which should be fixed in 1.11.3. Ian On Tue, Nov 20, 2018 at 12:21 AM, Jan Mercl <0xj...@gmail.com> wrote: > Hi list, > > can someone please paste the issue r

[go-nuts] google civic api

2018-11-20 Thread Alex Dvoretskiy
Hello, I'm writing a tool for extracting congressional district. Getting http JSON response from google civic api. I need only one line *"name": "Wisconsin's 3rd congressional district" *How web developers usually proceed with such task? { "normalizedInput": { "line1": "9732 570th Avenue",

Re: [go-nuts] Position(s) available at FireEye

2018-11-20 Thread Miguel Angel Rivera Notararigo
Hi Dave, do you have space for a Jr Go developer? -- 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, visi

Re: [go-nuts] Re: go language sensitive editor?

2018-11-20 Thread Justin Israel
On Wed, Nov 21, 2018, 12:37 PM wrote: > I recommend Sublime Text with the GoSublime > addon package. There's a free > trial for Sublime Text . > I started with this, and have also tried AnacondaGo for Sublime, but went back

[go-nuts] Re: go language sensitive editor?

2018-11-20 Thread fredistic
I recommend Sublime Text with the GoSublime addon package. There's a free trial for Sublime Text . -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Re: go language sensitive editor?

2018-11-20 Thread robert engels
I used both VSCode and Intellij/GoLand. I suggest Intellij/GoLand for anything but trivial projects. The refactoring and navigation tools are far superior to those available in VS code, and it makes working in larger projects with lots of dependencies far easier IMO. > On Nov 20, 2018, at 3:15

Re: [go-nuts] Re: go language sensitive editor?

2018-11-20 Thread Rob Pike
Ed is the standard text editor. -rob On Wed, Nov 21, 2018 at 8:15 AM wrote: > > Another vote for VS Code. I'm a hobbyist and have tried lots of editors. > > On Tuesday, November 20, 2018 at 1:52:11 PM UTC-7, Pat Farrell wrote: >> >> I know, this is both a FAQ and an unanswerable question. I'm

[go-nuts] Re: gob limitation or bug?

2018-11-20 Thread Roberto Zanotto
The encoding/decoding protocol is not stateless: the first time a new type is seen, some type information is transmitted and the Encoder/Decoder objects keep track of that. My guess is that the thing gets messed up by the fact that you are encoding once and decoding twice. I would rewrite your

[go-nuts] Re: go language sensitive editor?

2018-11-20 Thread bucarr
Another vote for VS Code. I'm a hobbyist and have tried lots of editors. On Tuesday, November 20, 2018 at 1:52:11 PM UTC-7, Pat Farrell wrote: > > I know, this is both a FAQ and an unanswerable question. I'm an old > programmer who has used nearly every editor known to man. I am not a fan of >

Re: [go-nuts] go language sensitive editor?

2018-11-20 Thread Ian Lance Taylor
On Tue, Nov 20, 2018 at 12:52 PM, Pat Farrell wrote: > > I know, this is both a FAQ and an unanswerable question. I'm an old > programmer who has used nearly every editor known to man. I am not a fan of > whole-universe IDEs, but can use them. I also speak vi/vim pretty fluently. > > What editors

Re: [go-nuts] go language sensitive editor?

2018-11-20 Thread Jan Mercl
On Tue, Nov 20, 2018 at 9:52 PM Pat Farrell wrote: > I know, this is both a FAQ and an unanswerable question. I'm an old programmer who has used nearly every editor known to man. I am not a fan of whole-universe IDEs, but can use them. > I also speak vi/vim pretty fluently. (g)vim + vim-go: http

Re: [go-nuts] go language sensitive editor?

2018-11-20 Thread Mark Volkmann
I'm sure you'll get lots of opinions on this. VS Code is working great for me. On Tue, Nov 20, 2018 at 2:52 PM Pat Farrell wrote: > I know, this is both a FAQ and an unanswerable question. I'm an old > programmer who has used nearly every editor known to man. I am not a fan of > whole-universe I

[go-nuts] go language sensitive editor?

2018-11-20 Thread Pat Farrell
I know, this is both a FAQ and an unanswerable question. I'm an old programmer who has used nearly every editor known to man. I am not a fan of whole-universe IDEs, but can use them. I also speak vi/vim pretty fluently. What editors do folks use for go? I'd like something that can complete func

Re: [go-nuts] Determining latest released Go version

2018-11-20 Thread Caleb Mingle
Perhaps something built using these may work (sorting the go1* tags descending?): https://go.googlesource.com/go/+refs https://go.googlesource.com/go/+refs?format=JSON https://go.googlesource.com/go/+refs?format=TEXT Kinda brittle to tie this to tag names, but it may be less brittle than parsing H

Re: [go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Ian Lance Taylor
On Tue, Nov 20, 2018 at 11:43 AM, Alex Dvoretskiy wrote: > > Yes, it's encoded in UCS-2, UTF-16. > > Should I just change encoding to UTF-8? Yes. > What if I can't change encoding? One approach is to use https://godoc.org/golang.org/x/text/encoding/unicode with https://godoc.org/golang.org/x/te

Re: [go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Robert Engels
You can’t just “change the encoding”. You need to read the strings as utf16. See https://gist.github.com/bradleypeabody/185b1d7ed6c0c2ab6cec > On Nov 20, 2018, at 1:43 PM, Alex Dvoretskiy wrote: > > Yes, it's encoded in UCS-2, UTF-16. > > Should I just change encoding to UTF-8? > > What if I

Re: [go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Alex Dvoretskiy
Yes, it's encoded in UCS-2, UTF-16. Should I just change encoding to UTF-8? What if I can't change encoding? On Tuesday, November 20, 2018 at 11:36:24 AM UTC-8, Ian Lance Taylor wrote: > > On Tue, Nov 20, 2018 at 11:30 AM, Alex Dvoretskiy > > wrote: > > go version go1.10 windows/386 > > Is y

Re: [go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Ian Lance Taylor
On Tue, Nov 20, 2018 at 11:30 AM, Alex Dvoretskiy wrote: > go version go1.10 windows/386 Is your input file encoded using UCS-2 aka UTF-16? Ian -- 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] scanner.Text() every other character is null.

2018-11-20 Thread Robert Engels
Your file is probably utf16 so 2 byes for every character. > On Nov 20, 2018, at 1:28 PM, Alex Dvoretskiy wrote: > > > > file, err := os.Open(inputFile) > if err != nil { > log.Fatal(err) > } > defer file.Close() > scanner := bufio.NewScanner(file)

[go-nuts] Re: scanner.Text() every other character is null.

2018-11-20 Thread Alex Dvoretskiy
go version go1.10 windows/386 -- 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.goo

Re: [go-nuts] Determining latest released Go version

2018-11-20 Thread Janne Snabb
Parsing HTML is exactly what I wanted to avoid doing :) but I haven't found any alternatives so far. For some reason https://api.github.com/repos/golang/go/releases does not return anything. It does work for other projects on Github. Janne Snabb sn...@epipe.com On 20/11/2018 03.51, Tamás Gul

[go-nuts] scanner.Text() every other character is null.

2018-11-20 Thread Alex Dvoretskiy
file, err := os.Open(inputFile) if err != nil { log.Fatal(err) } defer file.Close() scanner := bufio.NewScanner(file) address := "" scanner.Scan() scanner.Scan() address = scanner.Text() fmt.Println([]byte(address)) I'm reading string from file, but getting null value inserted as every other

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Michel Levieux
Oh. Okay ! Yeah sorry I think my mind got stuck with the notion of "abstract definition" of any type and did not see the concrete use they could be subject to. I see what you mean : https://play.golang.org/p/8P3IJElTS7d would effectively not work. I think I didn't have the full picture of this.

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Burak Serdar
On Tue, Nov 20, 2018 at 7:59 AM Michel Levieux wrote: > > I'm not quite sure I understand your example . > According to me a contract on a structure type only defines what the > structure type should have (aka the minimum number of fields and their > respective types). When you define a function

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Michel Levieux
I'm not quite sure I understand your example . According to me a contract on a structure type only defines what the structure type should have (aka the minimum number of fields and their respective types). When you define a function with a generic type, the only thing the compiler should check is t

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Burak Serdar
On Tue, Nov 20, 2018 at 7:36 AM Michel Levieux wrote: > > Yes, but you can just specify the concract like : > > contract doubleLinkedListNode { > X struct { > *X > *X > } > } > > which defines a type X containing at least two pointers to values of type X. > You'd do the sa

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Michel Levieux
Yes, but you can just specify the concract like : contract doubleLinkedListNode { X struct { *X *X } } which defines a type X containing at least two pointers to values of type X. You'd do the same currently for a function type --> func (int, int, string), which takes two

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Burak Serdar
On Tue, Nov 20, 2018 at 6:27 AM Michel Levieux wrote: > > I guess X is the type that is represented by the struct, the meaning being : > "the type X is a struct that contains a field that is a pointer to a value of > the same type". > > EDIT : I think the "next" word, which is here the name of t

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Burak Serdar
On Tue, Nov 20, 2018 at 4:38 AM komuW wrote: >> >> A contract can also be written in terms of a struct: >> >> contract linkedListNode { >> X struct { >> next *X >> } >> } > > > In this example taken from the linked document; what is X? X is the name of the struct type. This struct satisfi

Re: [go-nuts] Re: Types are contract -, v2

2018-11-20 Thread Michel Levieux
I guess X is the type that is represented by the struct, the meaning being : "the type X is a struct that contains a field that is a pointer to a value of the same type". EDIT : I think the "next" word, which is here the name of the field, can even be omitted. The relevant information here is to k

[go-nuts] Re: Types are contract -, v2

2018-11-20 Thread komuW
> > A contract can also be written in terms of a struct: > > contract linkedListNode { > X struct { > next *X > } > } > > In this example taken from the linked document; what is X? On Tuesday, 20 November 2018 05:38:31 UTC+3, Burak Serdar wrote: > > Hi, > > A while ago I sent an email

Re: [go-nuts] Where is the very first g/m/p?

2018-11-20 Thread 'Axel Wagner' via golang-nuts
Using objdump, the actual program start is _rt0_amd64_linux (on that platform, obviously), which, if you follow it, pretty much does nothing but call runtime•rt0_go

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

2018-11-20 Thread 'yinbingjun' via golang-nuts
sqlx does not support mutiple sql and results. > On Nov 20, 2018, at 14:26, Reto Brunner wrote: > > 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") >