[go-nuts] Re: can a sub-directory package of a module be imported?

2020-06-29 Thread Volker Dobler

On Tuesday, 30 June 2020 06:34:48 UTC+2, Jason E. Aten wrote:
>
> I have a files laid out like this (OSX):
>
> ~/go/src/github.com/user/fish/api/client/wanda.go
>
> ~/go/src/github.com/user/fish/go.mod with first line "module 
> github.com/liked/movies/v2"
>
> ~/go/src/github.com/user/fish/cmd/demo/main.go that does: import client "
> github.com/liked/movies/v2/api/client"
>
> ~/go/src/github.com/user/fish/cmd/demo $ go build  ## with GO111MODULE 
> unset, under go1.14.4. Also GOPRIVATE=github.com/user   and 
> GOPATH=$HOME/go
>  
> go: finding module for package github.com/liked/movies/v2/api/client
> main.go:4:2: module github.com/liked/movies/v2@latest found 
> (v2.0.0-alpha.1), but does not contain package 
> github.com/liked/movies/v2/api/client
>
> So the demo/main.go import of the client package is not resolved. Is it 
> possible, in general, to import a package within a module? 
>

Yes, of course.

Start of by deciding whether you want to use Go Modules or
GOPATH builds and set GO111MODULE accordingly. Your
setup uses the defaults which change from release to release
and doing it in a deterministic way.

Then: You did not show the package clause of wanda.go.

It is strange that cmd/demo doesn't recognize its own module.
Is there a fundamental reason to name the module github.com/liked/movies
while the repo is github.com/user/fish ?

Last: Did you try a replace directive?

V.
 
 

-- 
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/8c21dc52-9aa9-4d36-9029-ede4f93d7702o%40googlegroups.com.


[go-nuts] Re: Bitstring package?

2020-06-29 Thread Jason E. Aten
https://github.com/RoaringBitmap/roaring

-- 
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/8d046b72-78a7-46a0-a1b8-3eb0f0ae8ad5o%40googlegroups.com.


[go-nuts] can a sub-directory package of a module be imported?

2020-06-29 Thread Jason E. Aten
I have a files laid out like this (OSX):

~/go/src/github.com/user/fish/api/client/wanda.go

~/go/src/github.com/user/fish/go.mod with first line "module 
github.com/liked/movies/v2"

~/go/src/github.com/user/fish/cmd/demo/main.go that does: import client 
"github.com/liked/movies/v2/api/client"

~/go/src/github.com/user/fish/cmd/demo $ go build  ## with GO111MODULE 
unset, under go1.14.4. Also GOPRIVATE=github.com/user   and GOPATH=$HOME/go
 
go: finding module for package github.com/liked/movies/v2/api/client
main.go:4:2: module github.com/liked/movies/v2@latest found 
(v2.0.0-alpha.1), but does not contain package 
github.com/liked/movies/v2/api/client

So the demo/main.go import of the client package is not resolved. Is it 
possible, in general, to import a package within a module? 

If so, how does one do it?

-- 
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/2e46e2fd-c201-4dfb-8df0-53f826ea1931o%40googlegroups.com.


[go-nuts] Does golang uses copyOnWrite like java? where?

2020-06-29 Thread 刘骏龙
THX

-- 
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/ba52a326-502e-4320-8573-efc7409ce773n%40googlegroups.com.


Re: [go-nuts] maptype questions

2020-06-29 Thread Ian Lance Taylor
On Mon, Jun 29, 2020 at 6:33 PM arthurwil...@gmail.com
 wrote:
>
> On Monday, June 29, 2020 at 8:16:14 PM UTC-5 Ian Lance Taylor wrote:
>>
>> On Mon, Jun 29, 2020 at 5:32 PM Bill Morgan
>>  wrote:
>> >
>> > for this code:
>> >
>> > m := make(map[int]int, 9)
>> >
>> > I think the compiler creates a maptype that is stored at type.*+60480(SB) 
>> > that it uses for the call to runtime.makemap:
>> >
>> > m := make(map[int]int, 9)
>> > 0x10d0b81 488d05f8ec LEAQ type.*+60480(SB), AX
>> > 0x10d0b88 48890424 MOVQ AX, 0(SP)
>> > 0x10d0b8c 48c74424080900 MOVQ $0x9, 0x8(SP)
>> > 0x10d0b95 48c7442410 MOVQ $0x0, 0x10(SP)
>> > 0x10d0b9e 6690 NOPW
>> > 0x10d0ba0 e8fbdff3ff CALL runtime.makemap(SB)
>> >
>> > Where is the code in the compiler that creates the maptype? I'm wondering 
>> > how the bucket size is computed and how the rest of the maptype structure 
>> > is filled out.
>>
>> https://golang.org/src/cmd/compile/internal/gc/reflect.go#L189
>>
>> > Is there a way to print out the type info stored in the binary?
>>
>> I'm not sure if this is what you want, but you can use reflect.TypeOf:
>> https://play.golang.org/p/FEUIoqc6SMU .
>>
>> Ian
>
> Thanks Ian, that is pretty cool. I think that is printing out the map[int]int 
> type though instead of the *maptype that is generated by the compiler and 
> passed to runtime.makemap.
>
> I think this is loading a pointer to a maptype into AX to pass as the first 
> arg to runtime.makemap. The maptype seems to be stored at type.*+60480(SB).
>
> LEAQ type.*+60480(SB), AX
>
> here's the type I'm asking about: where is this guy created in the compiler?
>
> type maptype struct {
> typ _type
> key *_type
> elem *_type
> bucket *_type // internal type representing a hash bucket
> // function for hashing keys (ptr to key, seed) -> hash
> hasher func(unsafe.Pointer, uintptr) uintptr
> keysize uint8 // size of key slot
> elemsize uint8 // size of elem slot
> bucketsize uint16 // size of bucket
> flags uint32
> }

https://golang.org/src/cmd/compile/internal/gc/reflect.go#L1285

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUjPzFd4n0ER%3DFaCrTmdVoB_9P0Up1jSy%3DC2wghOUQS9w%40mail.gmail.com.


Re: [go-nuts] Bitstring package?

2020-06-29 Thread Bakul Shah
Won't https://golang.org/pkg/math/bits/  do?

> On Jun 29, 2020, at 6:58 PM, hardconnect@gmail.com wrote:
> 
> I'm looking for a package that implements arbitrary length bit strings and 
> supports set all, clear all, set and reading back of arbitrary bits and 
> setting and clearing the next set or unset bit.
> 
> I've seen a couple of packages that come close. Does anyone know of a package 
> that meets all my needs?
> 
> Is there a centralized search/lookup site for GO packages?
> 
> Thanks,
> 
> Joe
> 
> -- 
> 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/4a423427-186d-43df-8316-b62963fe5e1ao%40googlegroups.com
>  
> .

-- 
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/5EDEFBE7-8CC8-4B4D-8EDC-2C1055E40102%40iitbombay.org.


Re: [go-nuts] Bitstring package?

2020-06-29 Thread 'Dan Kortschak' via golang-nuts
Probably math/big.Int will do what you want.

Dan

On Mon, 2020-06-29 at 18:58 -0700, hardconnect@gmail.com wrote:
> I'm looking for a package that implements arbitrary length bit
> strings and 
> supports set all, clear all, set and reading back of arbitrary bits
> and setting and clearing the next set or unset bit.
> 
> I've seen a couple of packages that come close. Does anyone know of a
> package that meets all my needs?
> 
> Is there a centralized search/lookup site for GO packages?
> 
> Thanks,
> 
> Joe
> -- 
> 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/4a423427-186d-43df-8316-b62963fe5e1ao%40googlegroups.com
> .


-- 
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/18b4e347d928bf039fa23eeb1b52f6223580b05f.camel%40kortschak.io.


[go-nuts] Bitstring package?

2020-06-29 Thread hardconnect . joe
I'm looking for a package that implements arbitrary length bit strings and 
supports set all, clear all, set and reading back of arbitrary bits and 
setting and clearing the next set or unset bit.

I've seen a couple of packages that come close. Does anyone know of a 
package that meets all my needs?

Is there a centralized search/lookup site for GO packages?

Thanks,

Joe

-- 
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/4a423427-186d-43df-8316-b62963fe5e1ao%40googlegroups.com.


Re: [go-nuts] maptype questions

2020-06-29 Thread arthurwil...@gmail.com


On Monday, June 29, 2020 at 8:16:14 PM UTC-5 Ian Lance Taylor wrote:

> On Mon, Jun 29, 2020 at 5:32 PM Bill Morgan 
>  wrote: 
> > 
> > for this code: 
> > 
> > m := make(map[int]int, 9) 
> > 
> > I think the compiler creates a maptype that is stored at 
> type.*+60480(SB) that it uses for the call to runtime.makemap: 
> > 
> > m := make(map[int]int, 9) 
> > 0x10d0b81 488d05f8ec LEAQ type.*+60480(SB), AX 
> > 0x10d0b88 48890424 MOVQ AX, 0(SP) 
> > 0x10d0b8c 48c74424080900 MOVQ $0x9, 0x8(SP) 
> > 0x10d0b95 48c7442410 MOVQ $0x0, 0x10(SP) 
> > 0x10d0b9e 6690 NOPW 
> > 0x10d0ba0 e8fbdff3ff CALL runtime.makemap(SB) 
> > 
> > Where is the code in the compiler that creates the maptype? I'm 
> wondering how the bucket size is computed and how the rest of the maptype 
> structure is filled out. 
>
> https://golang.org/src/cmd/compile/internal/gc/reflect.go#L189 
>
> > Is there a way to print out the type info stored in the binary? 
>
> I'm not sure if this is what you want, but you can use reflect.TypeOf: 
> https://play.golang.org/p/FEUIoqc6SMU . 
>
> Ian 
>
Thanks Ian, that is pretty cool. I think that is printing out the 
map[int]int type though instead of the *maptype that is generated by the 
compiler and passed to runtime.makemap. 

I think this is loading a pointer to a maptype into AX to pass as the first 
arg to runtime.makemap. The maptype seems to be stored at type.*+60480(SB). 

LEAQ type.*+60480(SB), AX 

here's the type I'm asking about: where is this guy created in the 
compiler? 

type maptype struct {
typ _type
key *_type
elem *_type
bucket *_type // internal type representing a hash bucket
// function for hashing keys (ptr to key, seed) -> hash
hasher func(unsafe.Pointer, uintptr) uintptr
keysize uint8 // size of key slot
elemsize uint8 // size of elem slot
bucketsize uint16 // size of bucket
flags uint32
}

Here are the runtime.makemap comments and signature

// makemap implements Go map creation for make(map[k]v, hint).
// If the compiler has determined that the map or the first bucket
// can be created on the stack, h and/or bucket may be non-nil.
// If h != nil, the map can be created directly in h.
// If h.buckets != nil, bucket pointed to can be used as the first bucket.
func makemap(t *maptype, hint int, h *hmap) *hmap {

-- 
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/c99ffa05-5c22-416c-bef9-f871490eff2an%40googlegroups.com.


Re: [go-nuts] maptype questions

2020-06-29 Thread Ian Lance Taylor
On Mon, Jun 29, 2020 at 5:32 PM Bill Morgan
 wrote:
>
> for this code:
>
> m := make(map[int]int, 9)
>
> I think the compiler creates a maptype that is stored at type.*+60480(SB) 
> that it uses for the call to runtime.makemap:
>
> m := make(map[int]int, 9)
>   0x10d0b81 488d05f8ec LEAQ type.*+60480(SB), AX
>   0x10d0b88 48890424 MOVQ AX, 0(SP)
>   0x10d0b8c 48c74424080900 MOVQ $0x9, 0x8(SP)
>   0x10d0b95 48c7442410 MOVQ $0x0, 0x10(SP)
>   0x10d0b9e 6690 NOPW
>   0x10d0ba0 e8fbdff3ff CALL runtime.makemap(SB)
>
> Where is the code in the compiler that creates the maptype? I'm wondering how 
> the bucket size is computed and how the rest of the maptype structure is 
> filled out.

https://golang.org/src/cmd/compile/internal/gc/reflect.go#L189

> Is there a way to print out the type info stored in the binary?

I'm not sure if this is what you want, but you can use reflect.TypeOf:
https://play.golang.org/p/FEUIoqc6SMU .

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUGm0oBhg5Ad9hnaEN7P9seFEtcELGBdGr_FjXiVxkO-A%40mail.gmail.com.


[go-nuts] maptype questions

2020-06-29 Thread Bill Morgan
for this code:

m := make(map[int]int, 9)

I think the compiler creates a maptype that is stored at type.*+60480(SB) 
that it uses for the call to runtime.makemap:

m := make(map[int]int, 9)
  0x10d0b81 488d05f8ec LEAQ type.*+60480(SB), AX 
  0x10d0b88 48890424 MOVQ AX, 0(SP) 
  0x10d0b8c 48c74424080900 MOVQ $0x9, 0x8(SP) 
  0x10d0b95 48c7442410 MOVQ $0x0, 0x10(SP) 
  0x10d0b9e 6690 NOPW 
  0x10d0ba0 e8fbdff3ff CALL runtime.makemap(SB) 

Where is the code in the compiler that creates the maptype? I'm wondering 
how the bucket size is computed and how the rest of the maptype structure 
is filled out.

Is there a way to print out the type info stored in the binary?

-- 
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/63557cf7-e92f-48da-8ef8-910e5896cce7o%40googlegroups.com.


Re: [go-nuts] Port to powerpc 440fpu

2020-06-29 Thread Ian Lance Taylor
On Mon, Jun 29, 2020 at 1:01 AM Hugo Cornelis
 wrote:
>
> The standard Go distribution doesn't support 32-bit PPC.
>
> To compile Golang code to 32-bit PPC we first built a proof of concept based 
> on docker-cli using the gccgo packages for Ubuntu.  We got this working 
> without too much effort.  Afterwards we integrated this type of 
> cross-compilation into Buildroot to compile the entire Docker tool suite for 
> use on an embedded system.
>
> Most of Docker seems to be working fine on the embedded device, however local 
> interactive terminal input / output with a running container is not working.
>
> What we observe is similar to what is described here: 
> https://github.com/moby/moby/issues/39461
>
> Investigation shows that two specific goroutines in Container daemon that are 
> responsible for forwarding the input and output from the container to the 
> user are not scheduled (they don't receive CPU cycles) until after Docker 
> terminates.
>
> These two goroutines use the functions io.CopyBuffer() and ReadFrom() / 
> WriteTo() to forward the traffic (the used method to forward traffic is 
> demonstrated in recvtty.go at 
> https://github.com/opencontainers/runc/blob/master/contrib/cmd/recvtty/recvtty.go)
>
> When Docker terminates it sends signal 15 (TERM) to these processes.  This 
> somehow allows the two goroutines to be scheduled which flushes the output 
> buffers to the terminal.
>
> This may be due to wrong system call bindings for 32-bit PPC in the unix 
> package, however inspection of these bindings did not reveal any problem so 
> far.
>
> We have been working on this for several weeks now, any help would be greatly 
> appreciated.
>
> Thanks!


Thanks for the background.

Earlier I suggested looking at the output of "strace -f" for the
programs that fail.  Does that show anything of interest?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXDJPFnn3Wh2G5kUxrhRZorZcXUnSAn4PzeesAOOF1qUw%40mail.gmail.com.


Re: [go-nuts] Re: Generic syntax idea

2020-06-29 Thread bugpowder
On Mon, Jun 29, 2020 at 7:28 PM Jake Montgomery  wrote:

> I'm curious how you would propose rewriting:
> func Foo(type T comparable, B interface{})(a T, b B, c T) {
>

You could just annotate each distinct type on first appeareance:

func Foo(a T:type comparable, b B:type interface{}, c T) {



>
>
>
>
> On Friday, June 19, 2020 at 6:57:45 PM UTC-4, mit...@gmail.com wrote:
>>
>> Hello, Ian,
>>
>> Would it be possible to have a generic type annotation syntax like this:
>>
>> // Print prints the elements of any slice.// Print has a type parameter T, 
>> and has a single (non-type)// parameter s which is a slice of that type 
>> parameter.
>> func Print(type T)(s []T) {
>>
>>
>> ==>
>>
>> // Print prints the elements of any slice.// Print has a type parameter T, 
>> and has a single (non-type)// parameter s which is a slice of that type 
>> parameter.
>> func Print(s []T:type) {
>>
>>
>> This doesn't seem to clash with existing syntax, doesn't require a new
>> pair of parenthesis, marks T as a generic type (and can have added
>> constraint names right next to it, e.g: Print(s []T:type constraint)
>>
>> Or anything similar really, that keeps the generic type description
>> in-line with regular types, e.g. could be a special sigil added to a type
>> parameter as well (@T, $T, etc to mark it as generic, e.g.: Print(s []$T
>> constraint)
>>
>> haven't thought this through by any means, but it strikes me as a cleaner
>> option than a new set of parenthesis and duplication of the generic
>> parameter names.
>>
>> Does it make any sense? Don't recall seeing this in some other language...
>>
> --
> 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/0fbc45cf-1fe0-4910-adc1-9a6c77422566o%40googlegroups.com
> 
> .
>

-- 
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/CAACdnTBj4rUMUBEBHhr%3Du12SkfJcj3RC2Afhw%3DHOXW1%2BRjLb8A%40mail.gmail.com.


Re: [go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread Marvin Renich
[pedantic correction]

* Marvin Renich  [200629 14:10]:
> The final argument to Printf is []interface{}, while you are trying to
  ^
  ...interface{}

...Marvin

-- 
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/20200629182020.aqgs6y2u4qufxbrj%40basil.wdw.


Re: [go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread Marvin Renich
* yves baumes  [200629 03:22]:
> Hello,
> 
> considering this code
> 
> ```
> package main
> 
> import (
> "fmt"
> )
> 
> func main() {
> host := []string{"127", "0", "0", "1"}
> 
> fmt.Printf("%v.%v.%v.%v\n", host[0], host[1], host[2], host[3])
> fmt.Printf("%v.%v.%v.%v\n", host[0:4]...)
> }
> ```
> 
> The first Printf works and prints the host value.
> While the second one does not compile : "./args.go:11:34: cannot use 
> host[0:4] (type []string) as type []interface {} in argument to fmt.Printf"
> 
> If I use append() instead of Printf(), this expanding of the host variables 
> just works out. Is this a compiler bug in the case of the fmt.Printf() ?

>From the language spec at
https://golang.org/ref/spec#Passing_arguments_to_..._parameters:

If the final argument is assignable to a slice type []T, it is
passed unchanged as the value for a ...T parameter if the argument
is followed by  In this case no new slice is created.

The final argument to Printf is []interface{}, while you are trying to
pass []string.  In order for this to work, []string would have to be
assignable to []interface{}, which it isn't.

This is related to a FAQ at
https://golang.org/doc/faq#convert_slice_of_interface.

If, after reading the above links and the definition of assignability at
https://golang.org/ref/spec#Assignability, you are still unclear why it
is not compiling, ask on the list for more help.

...Marvin

-- 
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/20200629181003.attbsi36qwc6rrtv%40basil.wdw.


[go-nuts] Go Lang @ Plano,TX

2020-06-29 Thread johnatlantis07


 

Hi,

 

Hope You Are Doing Well. If You Are Interested with Below Position Please 
Forward Me Your Updated Resume As Soon As Possible.

 

*Go Lang Developers w/Testing background *

*Plano, TX *

*Long Term Contract*

 

*Responsibilities: *

• 3-5 years of strong API development experience in AWS, Java and GO 

• 1-2 years of experience in an agile environment with exposure to BDD/TDD 
development 

• Ability to develop automation test suite for 
System/Integration/Performance testing 

• Experience in infra automation with Gitlab and containerization with 
Kubernetes 

• Good exposure in both SQL/NO-SQL and in-memory database usage 

• Event Driven development with CQRS and Event Sourcing is a plus 

• Strong experience with Agile methodology 

• Excellent communication skills

 

 

 

*Atlantis It Group*

*Kevin Carter *

*ke...@atlantisitgroup.com* 

*Desk:671248*

 

 

 

 

 

-- 
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/1c76702c-ab37-4e6f-b67c-31d8ae9f5a52o%40googlegroups.com.


[go-nuts] Re: Generic syntax idea

2020-06-29 Thread Jake Montgomery
I'm curious how you would propose rewriting:
func Foo(type T comparable, B interface{})(a T, b B, c T) {



On Friday, June 19, 2020 at 6:57:45 PM UTC-4, mit...@gmail.com wrote:
>
> Hello, Ian, 
>
> Would it be possible to have a generic type annotation syntax like this:
>
> // Print prints the elements of any slice.// Print has a type parameter T, 
> and has a single (non-type)// parameter s which is a slice of that type 
> parameter.
> func Print(type T)(s []T) {
>
>
> ==>
>
> // Print prints the elements of any slice.// Print has a type parameter T, 
> and has a single (non-type)// parameter s which is a slice of that type 
> parameter.
> func Print(s []T:type) {
>
>
> This doesn't seem to clash with existing syntax, doesn't require a new 
> pair of parenthesis, marks T as a generic type (and can have added 
> constraint names right next to it, e.g: Print(s []T:type constraint)
>
> Or anything similar really, that keeps the generic type description 
> in-line with regular types, e.g. could be a special sigil added to a type 
> parameter as well (@T, $T, etc to mark it as generic, e.g.: Print(s []$T 
> constraint)
>
> haven't thought this through by any means, but it strikes me as a cleaner 
> option than a new set of parenthesis and duplication of the generic 
> parameter names.
>
> Does it make any sense? Don't recall seeing this in some other language...
>

-- 
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/0fbc45cf-1fe0-4910-adc1-9a6c77422566o%40googlegroups.com.


Re: [go-nuts] text template and white space suppression

2020-06-29 Thread go je
Maybe templating engines help..
here's one example.

https://github.com/gobuffalo/plush

On Mon, Jun 29, 2020 at 3:27 AM Bill Nixon  wrote:

> I am trying to do some creative formatting using text template and wanted
> to see if there might be a better approach than what I implemented.
>
> I have an array of structs, where each element has a Project and Task. The
> array is sorted by Project.
> type DisplayTask struct {
>  Project string
>  Task string
> }
>
> I want to output all the tasks within a project without repeating the
> project name each time and I want the tasks to be indented, for example:
>
> Project1
>   Task1
>   Task2
> Project2
>   Task3
> Project3
>   Task4
>   Task5
>
> After much experimentation, I am using the following template and trying
> to determine if there is a way to avoid the printf and just have the indent
> as part of the template, but I can't figure out a way to do this and
> suppress white space (newline) from the if statement for the same project.
> {{- $lastProject := "" -}}
> {{ range . }}
> {{- if (ne $lastProject .Project) -}}
> {{ .Project }} {{ $lastProject = .Project }}
> {{ end -}}
>   {{ printf "  %s" .Task }}
> {{ end -}}
>
> Go Playground of the working code is at
> https://play.golang.org/p/3qqVW8lN-Ha
>
> The challenge I had was suppressing white space after the end, but still
> allowing an indent via white space, so resorted to the printf.
>
> Is there a better way?
>
> --
> 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/8da74f77-a462-4bdf-9491-38e403d8c250o%40googlegroups.com
> 
> .
>

-- 
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/CA%2BVCgc2ft53o2GL6ab%2BFgGE%3DAc3UnM-721BcQzS%3DKw2vL%3DNK4Q%40mail.gmail.com.


Re: [go-nuts] Why does function escape to heap?

2020-06-29 Thread Jan Mercl
On Mon, Jun 29, 2020 at 5:15 PM Pure White  wrote:

> I would like to know:
> 1. How can a function "escapes to heap"? Isn't it a pointer to the code 
> area?

It is not: 
https://groups.google.com/forum/#!searchin/golang-dev/plan$20for$20two-word$20funcs$2C$20take$202%7Csort:date/golang-dev/x328N8hiN5k/i5LJIXGmi_gJ

-- 
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/CAA40n-VOkGPN2Q9N1nFE9Oxz3srfq-SVx2Bz9T%2BVQfoQPndDXg%40mail.gmail.com.


[go-nuts] Re: godoc.org (and pkg.go.dev) only showing one global function?

2020-06-29 Thread Jens-Uwe Mager
The go doc command lists these under global functions, whereas godoc.org 
and pkg.go.dev was listing them under the base type they return for example 
ParseAcceptLang was listed under Tag. The difference between go doc and the 
web based documentation confused me. Shouldn't the output of both ways be 
comparable?

On Monday, June 29, 2020 at 2:11:31 PM UTC+2, Jens-Uwe Mager wrote:
>
> I am having problems that some of the docs I am looking at show only one 
> single line of exported global functions. Example here
>
> https://godoc.org/golang.org/x/text/language#pkg-index
>
> Running this command:
>
> go doc golang.org/x/text/language
>
> I get much more exported global functions:
>
> ...
> func CompactIndex(t Tag) (index int, exact bool)
> func Compose(part ...interface{}) (t Tag, err error)
> func EncodeM49(r int) (Region, error)
> func Parse(s string) (t Tag, err error)
> func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error)
> func ParseBase(s string) (Base, error)
> func ParseExtension(s string) (e Extension, err error)
> func ParseRegion(s string) (Region, error)
> func ParseScript(s string) (Script, error)
> func ParseVariant(s string) (Variant, error)
> ...
>
> any preference I can set at godoc.org (or pkg.go.dev) to see all 
> available global functions? Or is this a bug?
>
>

-- 
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/b19c7235-6092-4e61-87e1-4ffa0ffa649ao%40googlegroups.com.


[go-nuts] godoc.org (and pkg.go.dev) only showing one global function?

2020-06-29 Thread Jens-Uwe Mager
I am having problems that some of the docs I am looking at show only one 
single line of exported global functions. Example here

https://godoc.org/golang.org/x/text/language#pkg-index

Running this command:

go doc golang.org/x/text/language

I get much more exported global functions:

...
func CompactIndex(t Tag) (index int, exact bool)
func Compose(part ...interface{}) (t Tag, err error)
func EncodeM49(r int) (Region, error)
func Parse(s string) (t Tag, err error)
func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error)
func ParseBase(s string) (Base, error)
func ParseExtension(s string) (e Extension, err error)
func ParseRegion(s string) (Region, error)
func ParseScript(s string) (Script, error)
func ParseVariant(s string) (Variant, error)
...

any preference I can set at godoc.org (or pkg.go.dev) to see all available 
global functions? Or is this a bug?

-- 
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/d0722133-7a01-4418-b998-70e68921d1d4o%40googlegroups.com.


[go-nuts] Re: Expanding variables and fmt.Printf() issue

2020-06-29 Thread Volker Dobler
 

> If I use append() instead of Printf(), this expanding of the host 
> variables just works out. Is this a compiler bug in the case of the 
> fmt.Printf() ?
>

I doubt that
 append("%v.%v.%v.%v\n", host[0:4]...)
does compile.

V.

-- 
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/26e8f78d-46c1-433b-b7f0-b257aec7bf40n%40googlegroups.com.


Re: [go-nuts] Port to powerpc 440fpu

2020-06-29 Thread Hugo Cornelis
Hi,

The standard Go distribution doesn't support 32-bit PPC.

To compile Golang code to 32-bit PPC we first built a proof of concept
based on docker-cli using the gccgo packages for Ubuntu.  We got this
working without too much effort.  Afterwards we integrated this type of
cross-compilation into Buildroot to compile the entire Docker tool suite
for use on an embedded system.

Most of Docker seems to be working fine on the embedded device, however
local interactive terminal input / output with a running container is not
working.

What we observe is similar to what is described here:
https://github.com/moby/moby/issues/39461

Investigation shows that two specific goroutines in Container daemon that
are responsible for forwarding the input and output from the container to
the user are not scheduled (they don't receive CPU cycles) until after
Docker terminates.

These two goroutines use the functions io.CopyBuffer() and ReadFrom() /
WriteTo() to forward the traffic (the used method to forward traffic is
demonstrated in recvtty.go at
https://github.com/opencontainers/runc/blob/master/contrib/cmd/recvtty/recvtty.go
)

When Docker terminates it sends signal 15 (TERM) to these processes.  This
somehow allows the two goroutines to be scheduled which flushes the output
buffers to the terminal.

This may be due to wrong system call bindings for 32-bit PPC in the unix
package, however inspection of these bindings did not reveal any problem so
far.

We have been working on this for several weeks now, any help would be
greatly appreciated.

Thanks!

Hugo



On Fri, Jun 19, 2020 at 3:33 AM Ian Lance Taylor  wrote:

> On Thu, Jun 18, 2020 at 1:17 PM Hugo Cornelis
>  wrote:
> >
> > Does anyone have experience with porting go applications to the powerpc
> 440fpu 32 bit.
> >
> > We have a team that is porting the Docker tool suite to a device that
> uses this CPU, we generated the system call bindings and compiled the
> Docker tool suite without much problems.
> >
> > Most of Docker seems to be working fine on the device, however
> interactive terminal input/output is not working.
> >
> > Investigation shows that two specific goroutines that are responsible
> for forwarding the I/O between two Docker related processes are not
> scheduled (they don't receive CPU cycles) until after Docker terminates
> these process with a signal 15 (TERM) and the two goroutines are suddenly
> scheduled and all of the output buffers are suddenly flushed to the
> terminal.
> >
> > We have looked at the terminal settings and flags applied to the file
> descriptors and these seem all fine (although I must admit that the code
> flows inside Docker and its tools are complicated).
> >
> > We suspect there may be a problem with one or more of the system call
> bindings, for instance that there may be a system call declared with
> //sysnb where it should be just //sys, if that makes sense.  I would
> actually not know how to distinguish between these two flags.
> >
> > We would now like to inspect the status of the two goroutines to
> understand what they are waiting for, and why the scheduler does not
> schedule them.
> >
> > Debugging with GODEBUG=schedtrace=1000;scheddetail=1, helps somewhat but
> no idea how to relate the output of the scheduler state to the two
> goroutines (if it would make sense at all).
> >
> > Does anyone have any experience debugging this type of problem?  How
> would we look at where exactly these processes are blocked without
> developing core knowledge about the Docker tool suite?
> >
> > We have been working on this for several weeks now, any help would be
> greatly appreciated.
>
>
> The standard Go distribution doesn't support 32-bit PPC, so I feel
> like there is some missing background information here.
>
> If the problem is with making system calls, then it often helps to
> look at the "strace -f" output to see what is going on at the system
> call level.
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAARrXCQ43XxbS5kbMy_Rn66FG3ifW9%2B9%3D7y%3DB4UbmajEP0WcJw%40mail.gmail.com.


Re: [go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread Jan Mercl
On Mon, Jun 29, 2020 at 9:22 AM yves baumes  wrote:

> If I use append() instead of Printf(), this expanding of the host variables 
> just works out. Is this a compiler bug in the case of the fmt.Printf() ?

No bug. That's how variable arguments and assignability rules are
specified to work.

-- 
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/CAA40n-WgLHeUhyEYtmVu1B1zeHByxm%2Ba5JyCqVhVU1VnAtddgA%40mail.gmail.com.


[go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread yves baumes
Hello,

considering this code

```
package main

import (
"fmt"
)

func main() {
host := []string{"127", "0", "0", "1"}

fmt.Printf("%v.%v.%v.%v\n", host[0], host[1], host[2], host[3])
fmt.Printf("%v.%v.%v.%v\n", host[0:4]...)
}
```

The first Printf works and prints the host value.
While the second one does not compile : "./args.go:11:34: cannot use 
host[0:4] (type []string) as type []interface {} in argument to fmt.Printf"

If I use append() instead of Printf(), this expanding of the host variables 
just works out. Is this a compiler bug in the case of the fmt.Printf() ?

Regards
Yves.

-- 
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/5fe08421-eaa4-4285-bd46-ecdfc5403465o%40googlegroups.com.