Re: [go-nuts] Shell tab-completion

2022-07-01 Thread 'Valentin Deleplace' via golang-nuts
Thank you Steve

On Thursday, June 30, 2022 at 12:23:41 PM UTC+2 steve@gmail.com wrote:

> On Thu, 30 Jun 2022 at 11:07, 'Valentin Deleplace' via golang-nuts <
> golan...@googlegroups.com> wrote:
>
>> Hello, is there a recommended way to achieve command line completion of 
>> the go command with Bash and Zsh?
>> E.g.
>> go te  ->  go test
>> go bui -> go build
>>
>> I don't have that out-of-the-box, and the install page 
>> <https://go.dev/doc/install> doesn't mention it.
>> I've seen a couple of 3rd party github repos for this, that have not been 
>> updated recently. Maybe one of them is good, I just haven't tried them yet!
>>
>
> I'm using and can recommend
>
> https://github.com/zsh-users/zsh-completions
>
> which seems actively maintained.
>
> -- 
> Steve Mynott 
> rsa3072/629FBB91565E591955B5876A79CEFAA4450EBD50
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8a3a48b9-fa2a-401e-a2d8-05af9937ce25n%40googlegroups.com.


[go-nuts] Shell tab-completion

2022-06-30 Thread 'Valentin Deleplace' via golang-nuts
Hello, is there a recommended way to achieve command line completion of the 
go command with Bash and Zsh?
E.g.
go te  ->  go test
go bui -> go build

I don't have that out-of-the-box, and the install page 
 doesn't mention it.
I've seen a couple of 3rd party github repos for this, that have not been 
updated recently. Maybe one of them is good, I just haven't tried them yet!

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e6d5b220-88ff-4b54-a5bd-f74c141077a7n%40googlegroups.com.


Re: [go-nuts] How string constants are propagated inside a small func

2021-05-03 Thread 'Valentin Deleplace' via golang-nuts
Thank you all for the insights

On Saturday, May 1, 2021 at 1:29:15 PM UTC+2 jesper.lou...@gmail.com wrote:

> On Fri, Apr 30, 2021 at 7:51 PM 'Valentin Deleplace' via golang-nuts <
> golan...@googlegroups.com> wrote:
>
>> I don't know exactly what SSA does in the compiler, but I thought it 
>> would be capable of optimizing f and g into the exact same generated code. 
>> Am I missing something?
>>
>
> Roughly, SSA would rewrite the g() function to something along the lines of
>
> func g() string {
> s1 := "a"
> s2 = s1 + "b"
> return s
> }
>
> That is, it would make it easier to figure out where s1 is defined (since 
> it can only have a single static assignment in the program, we don't have 
> to worry if there is another path defining s := "x"). Yet, this is not a 
> guarantee for optimization. You still have to carry out an analysis for 
> when an optimization is safe to apply. The key point is that such an 
> analysis is far easier to perform in SSA-form. Furthermore, it is often 
> more efficient, so the compiler runs faster. My haphazard guess would be 
> that constant/value propagation happens for number-types but not for 
> strings.
>
>
>
> -- 
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/03b5650f-3e55-4c6d-aa28-5de3ad65c6c5n%40googlegroups.com.


[go-nuts] How string constants are propagated inside a small func

2021-04-30 Thread 'Valentin Deleplace' via golang-nuts
Hi, I was surprised that the funcs f and g do not generate the same 
assembly code:

func f() string {
s := "a" + "b"
return s
}

func g() string {
s := "a"
s += "b"
return s
}

The compiled assembly respects the apparent instructions of the source 
code, with g calling runtime.concatstring2, while f does not (f benefits 
from an optimization that transforms "a"+"b" into the constant "ab").

I don't know exactly what SSA does in the compiler, but I thought it would 
be capable of optimizing f and g into the exact same generated code. Am I 
missing something?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0646ffcb-cde2-4dd5-9f1c-e1cec1487b35n%40googlegroups.com.


Re: [go-nuts] sort.Slice arguments

2017-03-08 Thread Valentin Deleplace
I did explain the expected result : "and I want to visit other cities in
alphabetical order"

Le 8 mars 2017 2:16 PM, "Jan Mercl" <0xj...@gmail.com> a écrit :

> On Wed, Mar 8, 2017 at 2:10 PM Val  wrote:
>
> > What do you think?
>
> You should explain what you've expected to get instead of what you've got.
> Without that, I for one, cannot figure out what you see as broken and I
> have no idea why do you think it's not a good idea to sort a slice of a
> slice. After all, it's just a slice as any other.
>
> --
>
> -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.