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

2018-11-21 Thread Bakul Shah
On 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 do folks use for go? I'd like something that can complete 
> function names, understand imports, and give some assistance.

I use nvi or acme, with some help from go doc and a script "g"
that uses grep -n or grep -rn. nvi when I am mostly just
typing as its keystrokes are in my muscle memory.  acme for
editing, browsing, building. It uses multiple windows quite
well so I can see N files open at once, arranged the way I
want. In contrast, IDEs are much too regimental about how your
screen real-estate should be used and end up using it rather
inefficiently. I don't particularly care for syntax coloring
or function name completion etc.

What would be helpful is if 'go doc' had an -n option to show
filename:linenumer next to the go definitions its shows so
that I can right click on it and see the source file with
cursor on the right line!

-- 
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] Append array to slice of slice behavior puzzles me

2018-11-21 Thread Sam Mortimer
On Wednesday, November 21, 2018 at 2:38:42 PM UTC-8, Sun Frank wrote:
>
> Perfect! Thank you so much for your answer and explanation, : )
>

It is, unfortunately, a very common "gotcha".  More discussion can be found 
here: https://github.com/golang/go/issues/20733

Cheers,
-Sam.


 

> Best Regards
>
> Mail : eliteg...@gmail.com 
> Mobile : 0422 118 452
> TechBlog : http://elitegoblin.github.io
> GitHub: http://github.com/eliteGoblin/
>
>
> andrey mirtchovski > 于2018年11月22日周四 
> 上午9:22写道:
>
>> this is a case of a variable being reused during a range loop.
>> essentially k[:] is optimized to something resembling  (a pointer to
>> the memory location of the backing array) which is appended as such to
>> the [][]int variable. the next iteration it is the same variable in
>> memory, however it's pointing to a different backing array. the
>> address of that variable is added to [][]int again. in order to avoid
>> this you will have to redeclare k inside the loop to ensure a new
>> backing array is used when adding to the slice of slices.
>>
>> maybe the easiest way to explain this is to point you towards this
>> blog post: https://blog.golang.org/go-slices-usage-and-internals and
>> to note that the for loop in your example expands/unrolls to something
>> like this, which breaks what you considered to "work" in your original
>> example:
>>
>> a1 := [3]int{1, 2, 3}
>> a2 := [3]int{4, 5, 6}
>> a3 := [3]int{7, 8, 9}
>>
>> s := make([][]int, 0)
>> a := a1
>> s = append(s, a[:])
>> a = a2
>> s = append(s, a[:])
>> a = a3
>> s = append(s, a[:])
>>
>> fmt.Println(s)
>> On Wed, Nov 21, 2018 at 2:41 PM Sun Frank > > wrote:
>> >
>> > Hi guys, I came across some code that surprised me, but I could not 
>> figured out why it behave like this,
>> >
>> > s := make([][]int, 0)
>> > a1 := [3]int{1, 2, 3}
>> > a2 := [3]int{4, 5, 6}
>> > s = append(s, a1[:])
>> > s = append(s, a2[:])
>> > fmt.Println(s)
>> >
>> > mp := make(map[[3]int]bool)
>> > mp[[3]int{1, 2, 3}] = true
>> > mp[[3]int{4, 5, 6}] = true
>> > mp[[3]int{7, 8, 9}] = true
>> > res := make([][]int, 0)
>> > for k := range mp {
>> > fmt.Printf("key is %+v\n", k[:])
>> > res = append(res, k[:])
>> > fmt.Printf("after append: %+v\n", res)
>> > }
>> >
>> >  or on playground
>> >
>> > the output is:
>> >
>> > [[1 2 3] [4 5 6]]   // this is as expected
>> > key is [1 2 3]
>> > after append: [[1 2 3]]
>> > key is [4 5 6]
>> > after append: [[4 5 6] [4 5 6]]  // Why it get this not [[1 2 3] [4 5 
>> 6]]
>> > key is [7 8 9]
>> > after append: [[7 8 9] [7 8 9] [7 8 9]] // why even this?
>> >
>> >
>> > any thoughts?
>> >
>> >
>> > Thanks!
>> >
>> >
>> >
>> > --
>> > 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...@googlegroups.com .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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] Memory limits

2018-11-21 Thread Matthew Zimmerman
Thanks!  I had run into the limit before, but I had seen it was getting
addressed, I just wasn't sure how. I am not running into any looking now,
just wanted to understand what they changed into as we are planning for the
future with hardware choices. It sounds like the memory limit is removed
completely now.  Thanks to everyone involved!

On Wed, Nov 21, 2018, 7:28 PM  If this is important and wasn't fixed in 1.11 or at tip then please file a
> bug report  with a reproducer at https://github.com/golang/go/issues. An
> issue number will result in the Go team investigating.
>
> On Friday, November 16, 2018 at 1:12:58 PM UTC-5, Robert Engels wrote:
>>
>> This article
>> https://syslog.ravelin.com/further-dangers-of-large-heaps-in-go-7a267b57d487 
>> would
>> imply it is far less than that.
>>
>> I responded that something didn’t feel right, but maybe Gos lack of
>> generational GC is a real stumbling block here.
>>
>> On Nov 16, 2018, at 11:58 AM, Matthew Zimmerman 
>> wrote:
>>
>> What are the current memory limits?  I know it used to be 512gb.  Is
>> there a difference between the platforms?  I couldn't find documentation on
>> this.
>>
>> Thanks!
>>
>> --
>> 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...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
> 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.
>

-- 
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] Memory limits

2018-11-21 Thread rlh
If this is important and wasn't fixed in 1.11 or at tip then please file a 
bug report  with a reproducer at https://github.com/golang/go/issues. An 
issue number will result in the Go team investigating.

On Friday, November 16, 2018 at 1:12:58 PM UTC-5, Robert Engels wrote:
>
> This article 
> https://syslog.ravelin.com/further-dangers-of-large-heaps-in-go-7a267b57d487 
> would 
> imply it is far less than that. 
>
> I responded that something didn’t feel right, but maybe Gos lack of 
> generational GC is a real stumbling block here. 
>
> On Nov 16, 2018, at 11:58 AM, Matthew Zimmerman  > wrote:
>
> What are the current memory limits?  I know it used to be 512gb.  Is there 
> a difference between the platforms?  I couldn't find documentation on this.
>
> Thanks!
>
> -- 
> 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...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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] New issue: internal compiler error: 'xfunc_22': panic during fuse while compiling xfunc_22

2018-11-21 Thread Ian Lance Taylor
On Wed, Nov 21, 2018 at 2:09 AM, Jan Mercl <0xj...@gmail.com> wrote:
> On Wed, Nov 21, 2018 at 1:49 AM Ian Lance Taylor  wrote:
>
>> 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.
>
> Thank you. I failed to find that issue. Glad to hear it's fixed already.
>
> May I suggest to set up an email address, say bugrep...@golang.org, that
> will forward to the issue tracker via a simple bot?

I wonder how long it would take for spammers to discover that?

Reporting a bug to the mailing list seems almost as good.

Ian

-- 
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] Append array to slice of slice behavior puzzles me

2018-11-21 Thread Sun Frank
Perfect! Thank you so much for your answer and explanation, : )
Best Regards

Mail : elitegobli...@gmail.com
Mobile : 0422 118 452
TechBlog : http://elitegoblin.github.io
GitHub: http://github.com/eliteGoblin/


andrey mirtchovski  于2018年11月22日周四 上午9:22写道:

> this is a case of a variable being reused during a range loop.
> essentially k[:] is optimized to something resembling  (a pointer to
> the memory location of the backing array) which is appended as such to
> the [][]int variable. the next iteration it is the same variable in
> memory, however it's pointing to a different backing array. the
> address of that variable is added to [][]int again. in order to avoid
> this you will have to redeclare k inside the loop to ensure a new
> backing array is used when adding to the slice of slices.
>
> maybe the easiest way to explain this is to point you towards this
> blog post: https://blog.golang.org/go-slices-usage-and-internals and
> to note that the for loop in your example expands/unrolls to something
> like this, which breaks what you considered to "work" in your original
> example:
>
> a1 := [3]int{1, 2, 3}
> a2 := [3]int{4, 5, 6}
> a3 := [3]int{7, 8, 9}
>
> s := make([][]int, 0)
> a := a1
> s = append(s, a[:])
> a = a2
> s = append(s, a[:])
> a = a3
> s = append(s, a[:])
>
> fmt.Println(s)
> On Wed, Nov 21, 2018 at 2:41 PM Sun Frank  wrote:
> >
> > Hi guys, I came across some code that surprised me, but I could not
> figured out why it behave like this,
> >
> > s := make([][]int, 0)
> > a1 := [3]int{1, 2, 3}
> > a2 := [3]int{4, 5, 6}
> > s = append(s, a1[:])
> > s = append(s, a2[:])
> > fmt.Println(s)
> >
> > mp := make(map[[3]int]bool)
> > mp[[3]int{1, 2, 3}] = true
> > mp[[3]int{4, 5, 6}] = true
> > mp[[3]int{7, 8, 9}] = true
> > res := make([][]int, 0)
> > for k := range mp {
> > fmt.Printf("key is %+v\n", k[:])
> > res = append(res, k[:])
> > fmt.Printf("after append: %+v\n", res)
> > }
> >
> >  or on playground
> >
> > the output is:
> >
> > [[1 2 3] [4 5 6]]   // this is as expected
> > key is [1 2 3]
> > after append: [[1 2 3]]
> > key is [4 5 6]
> > after append: [[4 5 6] [4 5 6]]  // Why it get this not [[1 2 3] [4 5 6]]
> > key is [7 8 9]
> > after append: [[7 8 9] [7 8 9] [7 8 9]] // why even this?
> >
> >
> > any thoughts?
> >
> >
> > Thanks!
> >
> >
> >
> > --
> > 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.
>

-- 
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] Append array to slice of slice behavior puzzles me

2018-11-21 Thread andrey mirtchovski
this is a case of a variable being reused during a range loop.
essentially k[:] is optimized to something resembling  (a pointer to
the memory location of the backing array) which is appended as such to
the [][]int variable. the next iteration it is the same variable in
memory, however it's pointing to a different backing array. the
address of that variable is added to [][]int again. in order to avoid
this you will have to redeclare k inside the loop to ensure a new
backing array is used when adding to the slice of slices.

maybe the easiest way to explain this is to point you towards this
blog post: https://blog.golang.org/go-slices-usage-and-internals and
to note that the for loop in your example expands/unrolls to something
like this, which breaks what you considered to "work" in your original
example:

a1 := [3]int{1, 2, 3}
a2 := [3]int{4, 5, 6}
a3 := [3]int{7, 8, 9}

s := make([][]int, 0)
a := a1
s = append(s, a[:])
a = a2
s = append(s, a[:])
a = a3
s = append(s, a[:])

fmt.Println(s)
On Wed, Nov 21, 2018 at 2:41 PM Sun Frank  wrote:
>
> Hi guys, I came across some code that surprised me, but I could not figured 
> out why it behave like this,
>
> s := make([][]int, 0)
> a1 := [3]int{1, 2, 3}
> a2 := [3]int{4, 5, 6}
> s = append(s, a1[:])
> s = append(s, a2[:])
> fmt.Println(s)
>
> mp := make(map[[3]int]bool)
> mp[[3]int{1, 2, 3}] = true
> mp[[3]int{4, 5, 6}] = true
> mp[[3]int{7, 8, 9}] = true
> res := make([][]int, 0)
> for k := range mp {
> fmt.Printf("key is %+v\n", k[:])
> res = append(res, k[:])
> fmt.Printf("after append: %+v\n", res)
> }
>
>  or on playground
>
> the output is:
>
> [[1 2 3] [4 5 6]]   // this is as expected
> key is [1 2 3]
> after append: [[1 2 3]]
> key is [4 5 6]
> after append: [[4 5 6] [4 5 6]]  // Why it get this not [[1 2 3] [4 5 6]]
> key is [7 8 9]
> after append: [[7 8 9] [7 8 9] [7 8 9]] // why even this?
>
>
> any thoughts?
>
>
> Thanks!
>
>
>
> --
> 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.

-- 
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] Append array to slice of slice behavior puzzles me

2018-11-21 Thread Miguel Angel Rivera Notararigo
Hi, just add  k := k  after the for-range line

-- 
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.


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

2018-11-21 Thread Serge Voilokov
I am using micro editor: https://github.com/zyedidia/micro . It is 
terminal-based, supports mouse, uses ctrl+zxcv and shift+arrows for text 
manipulation, has a multi cursor feature, syntax highlighting.
Written in golang. Easy to configure and change.
I am using my fork (https://github.com/serge-v/micro) with added features 
for golang development: go to decls, go imports, go install, go complete, 
etc.

On Tuesday, November 20, 2018 at 3:52:11 PM UTC-5, 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 do folks use for go? I'd like something that can complete 
> function names, understand imports, and give some assistance.
>

-- 
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.


[go-nuts] Append array to slice of slice behavior puzzles me

2018-11-21 Thread Sun Frank
Hi guys, I came across some code that surprised me, but I could not figured 
out why it behave like this,

s := make([][]int, 0)
a1 := [3]int{1, 2, 3}
a2 := [3]int{4, 5, 6}
s = append(s, a1[:])
s = append(s, a2[:])
fmt.Println(s)

mp := make(map[[3]int]bool)
mp[[3]int{1, 2, 3}] = true
mp[[3]int{4, 5, 6}] = true
mp[[3]int{7, 8, 9}] = true
res := make([][]int, 0)
for k := range mp {
fmt.Printf("key is %+v\n", k[:])
res = append(res, k[:])
fmt.Printf("after append: %+v\n", res)
}

 or on playground 

the output is:

[[1 2 3] [4 5 6]]   // this is as expected
key is [1 2 3]
after append: [[1 2 3]]
key is [4 5 6]
after append: [[4 5 6] [4 5 6]]  // Why it get this not [[1 2 3] [4 5 6]]
key is [7 8 9]
after append: [[7 8 9] [7 8 9] [7 8 9]] // why even this?


any thoughts? 


Thanks!



-- 
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] Determining latest released Go version

2018-11-21 Thread Janne Snabb
Thanks! I think programmers are more likely to stay consistent than web 
designers — thus this feels a bit better than scraping a web page.


Janne Snabb
sn...@epipe.com

On 20/11/2018 22.06, Caleb Mingle wrote:
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 HTML.


Good luck!

On Tue, Nov 20, 2018 at 11:30 AM Janne Snabb > wrote:


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ácsi wrote:

See whatgithub.com/niemeyer/godeb    does.

-- 
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.



--
mingle.cm  | @caleb_io 
--
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.


--
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: google civic api

2018-11-21 Thread Alex Dvoretskiy
Thanks!

This is so helpful. I got an idea. Now I can get integer congressional id :)

ср, 21 нояб. 2018 г. в 12:14, Caleb Mingle :

> I'm not entirely clear on what you're after, but does this help?
> https://play.golang.org/p/AcNBcUVtXGg
>
> That will return you the name field given a state name.  If you need an
> integer congressional district number, that will require some modification.
>
> If you want this to work without having to provide a state name you could
> use a regular expression or string splitting functions to check if the key
> matches regardless of the state field.
>
> On Tue, Nov 20, 2018 at 10:27 PM Alex Dvoretskiy 
> wrote:
>
>> 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 district number? I can
>> get the state from address.
>>
>>
>> On Tuesday, November 20, 2018 at 4:38:26 PM UTC-8, Alex Dvoretskiy wrote:
>>>
>>> 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",
>>>   "city": "Ellsworth",
>>>   "state": "WI",
>>>   "zip": "54011"
>>>  },
>>>  "divisions": {
>>>   "ocd-division/country:us": {
>>>"name": "United States",
>>>"officeIndices": [
>>> 0,
>>> 1
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi": {
>>>"name": "Wisconsin",
>>>"officeIndices": [
>>> 2,
>>> 4,
>>> 5,
>>> 8,
>>> 9,
>>> 10,
>>> 11
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi/cd:3": {
>>>"name": "Wisconsin's 3rd congressional district",
>>>"officeIndices": [
>>> 3
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi/county:pierce": {
>>>"name": "Pierce County",
>>>"officeIndices": [
>>> 12,
>>> 13,
>>> 14,
>>> 15,
>>> 16,
>>> 17,
>>> 18
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi/county:pierce/council_district:13": {
>>>"name": "Pierce County Supervisor District 13",
>>>"officeIndices": [
>>> 19
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi/county:pierce/place:oak_grove": {
>>>"name": "Oak Grove town"
>>>   },
>>>
>>> "ocd-division/country:us/state:wi/county:pierce/school_district:prescott_school_district":
>>> {
>>>"name": "prescott school district"
>>>   },
>>>   "ocd-division/country:us/state:wi/court_of_appeals:3": {
>>>"name": "WI State Court of Appeals - District III (3)"
>>>   },
>>>   "ocd-division/country:us/state:wi/sldl:93": {
>>>"name": "Wisconsin Assembly district 93",
>>>"officeIndices": [
>>> 7
>>>]
>>>   },
>>>   "ocd-division/country:us/state:wi/sldu:31": {
>>>"name": "Wisconsin State Senate district 31",
>>>"officeIndices": [
>>> 6
>>>]
>>>   }
>>>  }
>>> }
>>>
>>> --
>> 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.
>>
>
>
> --
> mingle.cm | @caleb_io 
>

-- 
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: google civic api

2018-11-21 Thread Caleb Mingle
I'm not entirely clear on what you're after, but does this help?
https://play.golang.org/p/AcNBcUVtXGg

That will return you the name field given a state name.  If you need an
integer congressional district number, that will require some modification.

If you want this to work without having to provide a state name you could
use a regular expression or string splitting functions to check if the key
matches regardless of the state field.

On Tue, Nov 20, 2018 at 10:27 PM Alex Dvoretskiy 
wrote:

> 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 district number? I can
> get the state from address.
>
>
> On Tuesday, November 20, 2018 at 4:38:26 PM UTC-8, Alex Dvoretskiy wrote:
>>
>> 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",
>>   "city": "Ellsworth",
>>   "state": "WI",
>>   "zip": "54011"
>>  },
>>  "divisions": {
>>   "ocd-division/country:us": {
>>"name": "United States",
>>"officeIndices": [
>> 0,
>> 1
>>]
>>   },
>>   "ocd-division/country:us/state:wi": {
>>"name": "Wisconsin",
>>"officeIndices": [
>> 2,
>> 4,
>> 5,
>> 8,
>> 9,
>> 10,
>> 11
>>]
>>   },
>>   "ocd-division/country:us/state:wi/cd:3": {
>>"name": "Wisconsin's 3rd congressional district",
>>"officeIndices": [
>> 3
>>]
>>   },
>>   "ocd-division/country:us/state:wi/county:pierce": {
>>"name": "Pierce County",
>>"officeIndices": [
>> 12,
>> 13,
>> 14,
>> 15,
>> 16,
>> 17,
>> 18
>>]
>>   },
>>   "ocd-division/country:us/state:wi/county:pierce/council_district:13": {
>>"name": "Pierce County Supervisor District 13",
>>"officeIndices": [
>> 19
>>]
>>   },
>>   "ocd-division/country:us/state:wi/county:pierce/place:oak_grove": {
>>"name": "Oak Grove town"
>>   },
>>
>> "ocd-division/country:us/state:wi/county:pierce/school_district:prescott_school_district":
>> {
>>"name": "prescott school district"
>>   },
>>   "ocd-division/country:us/state:wi/court_of_appeals:3": {
>>"name": "WI State Court of Appeals - District III (3)"
>>   },
>>   "ocd-division/country:us/state:wi/sldl:93": {
>>"name": "Wisconsin Assembly district 93",
>>"officeIndices": [
>> 7
>>]
>>   },
>>   "ocd-division/country:us/state:wi/sldu:31": {
>>"name": "Wisconsin State Senate district 31",
>>"officeIndices": [
>> 6
>>]
>>   }
>>  }
>> }
>>
>> --
> 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.
>


-- 
mingle.cm | @caleb_io 

-- 
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.


[go-nuts] Re: Go list returning directory starting with underscore on Ubuntu

2018-11-21 Thread ipoblete
Hi, I have the same problem, but I just want to scan my custom packages, 
when I do the go list. / ... it returns the correct routes, but with the 
underscore at the beginning of the routes, it is worth noting that the 
project does not have it inside the $ GOPATH (my $ GOPATH is in $ HOME / go)

El jueves, 1 de marzo de 2018, 14:22:43 (UTC-3), Michel Hollands escribió:
>
> Hello,
>
> When running go list on Ubuntu the results are weird:
>
> michel@michel-VirtualBox:~/git/grpcurl$ go list .
> _/home/michel/git/grpcurl
> michel@michel-VirtualBox:~/git/grpcurl$ 
>
> Running the same on the Mac returns just grpcurl, which is the correct 
> package.
>
> The Go version is: 
>
> go version go1.10 linux/amd64
>
> The Ubuntu is 16.04.4 LTS which was freshly installed.
>
> Any ideas about what could be wrong?
>
> Thanks in advance,
>
> Michel
>
>

-- 
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: go modules and vendor: redundant features?

2018-11-21 Thread Tyler Compton
> People keep adding stuffs into Go and later find themselves unable to
remove existing features due to the backward compatibility promise. Go 1.11
is a different beast than Go 1.0, and is significantly more complex.

For what it's worth, I don't believe that tooling is covered under
the backward compatibility promise, so it is possible to remove things
without a new major version bump. Of course, this would have to be done
with care, but it's not out of the question. I know that this is a bit of
an aside but it's worth keeping in mind.

On Mon, Nov 19, 2018 at 4:40 PM  wrote:

>
> I recall reading from Russ Cox that vendoring will be removed in the
> future and be replaced by explicit caching with modules.
>
> --
> 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.
>


-- 
Tyler Compton
Student of Software Engineering
Arizona State University

-- 
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] Using git-codereview with GitHub

2018-11-21 Thread Paul Jolly
> There is hub [1].  If you have not heard it, its work by
> repo-branch-commits,

Thanks, but as I understand it, this tool is branch-based.

I want to make my workflow oriented around single commits (on a local branch).


Paul

-- 
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] Using git-codereview with GitHub

2018-11-21 Thread Shulhan
On Wed, 21 Nov 2018 13:49:32 +
Paul Jolly  wrote:

> 
> What I'm ultimately trying to achieve is something akin to Gerrit's
> relation chain. That is, have a number of commits on a local branch,
> and have each commit correspond to a GitHub PR. Would involve creating
> some PR-specific branches etc.
> 

There is hub [1].  If you have not heard it, its work by
repo-branch-commits,

  - create a branch or fork
  - commit and push to that branch
  - run `hub pull-request --base  --head `

[1] https://github.com/github/hub

PS: It was written in Go.

-- 
{ "github":"github.com/shuLhan", "site":"kilabit.info" }

-- 
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.


[go-nuts] Using git-codereview with GitHub

2018-11-21 Thread Paul Jolly
Hi all,

Has anyone thought about/tried to get
https://godoc.org/golang.org/x/review/git-codereview working with a
GitHub backend?

What I'm ultimately trying to achieve is something akin to Gerrit's
relation chain. That is, have a number of commits on a local branch,
and have each commit correspond to a GitHub PR. Would involve creating
some PR-specific branches etc.

I realise there are some significant differences that might make this
infeasible/impractical, but thought I'd ask here as a starting point.

Thanks,


Paul

-- 
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] go language sensitive editor?

2018-11-21 Thread Paul Jolly
> > To add to the responses below, a Language Server Protocol (LSP -
> > https://microsoft.github.io/language-server-protocol/) implementation
> > is also in the works
>
> Is there a link to share wrt 'in the works'?

Sorry, yes, that was needlessly vague.

We get updates from the Go tooling team on the golang-tools update
calls: https://github.com/golang/go/wiki/golang-tools

WIP implementation at https://github.com/golang/tools/tree/master/internal/lsp

-- 
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] front-end post a body, back-end use gin.Context BindJSON but fail

2018-11-21 Thread ge . sf . chn
thanks,you are right, i got it at that night.

在 2018年11月9日星期五 UTC+8下午10:14:14,Burak Serdar写道:
>
> On Fri, Nov 9, 2018 at 6:35 AM > wrote: 
> > 
> > front-end info 
> > //body struct 
> > type Bucket struct { 
> >Name  string  `json:"name"` 
> >KeyId string  `json:"key_id"` 
> >KeySecret string  `json:"key_secret"` 
> >Header*Header `json:"header"` 
> >Property  int `json:"property"` 
> > } 
> > 
> > type Header struct { 
> >CacheControl int64 `json:"cache_control"` 
> > } 
> > //my post request body 
> > 
> {"name":"g","key_id":"221bce6492eba70f","key_secret":"6eb80603e85842542f9736eb13b7e3","header":{"cache_control":"10"},"property":"0"}
>  
>
>
> "cache_control":"10" is a string. If you want to unmarshal an int, 
> this should've been "cache_control":10 (without the quotes) 
>
> Or, change the Header.CacheControl to string. 
>
> > 
> > Name 
> > front-end 
> > back-end error when do 
> /usr/local/Cellar/go/1.10.3/libexec/src/encoding/json/decode.go:171 
> cache_control is string not int 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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] go language sensitive editor?

2018-11-21 Thread Jan Mercl
On Wed, Nov 21, 2018 at 11:58 AM Paul Jolly  wrote:

> To add to the responses below, a Language Server Protocol (LSP -
> https://microsoft.github.io/language-server-protocol/) implementation
> is also in the works

Is there a link to share wrt 'in the works'?

-- 

-j

-- 
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] go language sensitive editor?

2018-11-21 Thread Paul Jolly
To add to the responses below, a Language Server Protocol (LSP -
https://microsoft.github.io/language-server-protocol/) implementation
is also in the works that will help to "level the playing field" for
language awareness between editors.

It will also make it possible to easily integrate new tooling like
vetters, linters etc, again in a way that is consistent (at least in
terms of protocol) between editors.On Tue, 20 Nov 2018 at 20:52, 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 do folks use for go? I'd like something that can complete 
> function names, understand imports, and give some assistance.
>
> --
> 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.

-- 
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] New issue: internal compiler error: 'xfunc_22': panic during fuse while compiling xfunc_22

2018-11-21 Thread Jan Mercl
On Wed, Nov 21, 2018 at 1:49 AM Ian Lance Taylor  wrote:

> 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.

Thank you. I failed to find that issue. Glad to hear it's fixed already.

May I suggest to set up an email address, say bugrep...@golang.org, that
will forward to the issue tracker via a simple bot?

-- 

-j

-- 
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] go language sensitive editor?

2018-11-21 Thread Marko Ristin-Kaufmann
We use GoLand at our company. I used vim with plugins, but Goland is far
superior when it comes to refactoring.

Le mar. 20 nov. 2018 à 21:52, Pat Farrell  a écrit :

> 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
> function names, understand imports, and give some assistance.
>
> --
> 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.
>

-- 
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.