Re: [go-nuts] Windows vs Linux ReadString

2019-07-20 Thread Ian Lance Taylor
On Sat, Jul 20, 2019 at 1:48 PM  wrote:
>
> I started a go project on windows that leveraged readstring to read command 
> line input.  It blocked on Windows.  I just ran my code on Linux and the 
> readstring does not block at all.  Can someone explain this to me?

We will be able to help you better if you show us your code and tell
us precisely what you did.

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/CAOyqgcV8DUGjAkeEvyRpkoOL0Yh33huS%2BRzDWB0O8YEPCj0ruQ%40mail.gmail.com.


Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-20 Thread Wojciech S. Czarnecki
On Fri, 19 Jul 2019 18:47:36 -0700 (PDT)
Andrey Tcherepanov  wrote:

> knows that there is only one reference to the remaining part,
> and that part is "small"

This "is it small"? is a check that would be performed for all, while
only tiny percent would benefit off it.  

>>> I understand that it is very easy on application level...
And thats why it belongs there, IMO :)

>>> if programmer even thought about it.
She certainly should, because only she does know meaning of
"big" and "small" in context.

> A.

Hope this helps,

-- 
Wojciech S. Czarnecki
 << ^oo^ >> OHIR-RIPE

-- 
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/20190720230836.5bc499b0%40zuzia.


Re: [go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Vasiliy Tolstov
сб, 20 июл. 2019 г. в 17:17, Martin Schnabel :
>
> If you only need any unnamed struct type you can create one with reflect
> from the field information that you can write to text somewhere.
>
> https://godoc.org/reflect#StructOf
>
> These unnamed struct types however do not have any methods and do not
> wrap embedded named type methods.
>
> Otherwise you probably want to register your struct types on program
> initialization; for later lookup and so that they are part of the
> compiled binary. The gob package does it like that for example.
>

Thanks for link doc. It is very useful. Now i think that i'm try to
use protobuf Any (as all of my struct are protobuf proto.Message.
As i understand via protobuf i can register needed Req/Rsp empty
messages via Any, and later unmarshal message to this empty structs.


-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
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/CACaajQtV_4DYtGpMZULc4TMEr8uTUZ2PaLbUHz54i2%3DnD6XVBw%40mail.gmail.com.


Re: [go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Martin Schnabel

If you only need any unnamed struct type you can create one with reflect
from the field information that you can write to text somewhere.

https://godoc.org/reflect#StructOf

These unnamed struct types however do not have any methods and do not
wrap embedded named type methods.

Otherwise you probably want to register your struct types on program
initialization; for later lookup and so that they are part of the
compiled binary. The gob package does it like that for example.

Have fun!


On 20.07.19 10:44, Vasiliy Tolstov wrote:
Thanks, something like this, but i need to store type in string or 
[]byte in db, and based on this create new empty struct.


сб, 20 июл. 2019 г., 10:55 Jan Mercl <0xj...@gmail.com 
>:


On Sat, Jul 20, 2019 at 9:28 AM Vasiliy Tolstov mailto:v.tols...@selfip.ru>> wrote:

 > Hi. I have reflection based question.
 > I need to store type of struct passed to func and later based on
this stored type reconstruct empty needed struct.
 > Does this possible ?

Not sure I understood the question:
https://play.golang.org/p/5AEn3IsKObo

--
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/CACaajQsO90D5iDOZEpsgwbPBgEu%3DU8eLpYeg%3D2b2odAcp55f9g%40mail.gmail.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/df1d238c-4884-93a3-c5de-0fc56a3c928e%40mb0.org.


Re: [go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-20 Thread Steven Hartland
You might want to see if dtrace can shed some light on this?

On Sat, 20 Jul 2019 at 01:25,  wrote:

>
>
> On Friday, July 19, 2019 at 2:24:30 PM UTC-7, Steven Hartland wrote:
>>
>> Mat is actually running a non-standard kernel, with the ZFS filesystem
>> from the core OS replaced with a ZFS version derived from Linux ZFS port.
>>
>> I've not looked at the details of the port, but one suggestion would be
>> do you see the same behaviour if you build on UFS volume while still
>> running the kernel with the ZFS port.
>>
>> This may indicate if a strange filesystem level issue is causing
>> corruption or if the port has changed / broken a kernel feature go is
>> relying on.
>>
>
> Haven't tried UFS but he problem doesn't occur when using tmpfs for /tmp
> when using ZoF or when using the ZFS in base for /tmp. Trussing the build
> slows it down to the point where it succeeds. I attribute this to some sort
> of race in ZoF but not in "legacy" ZFS. vfsops and vnops are essentially
> the same as upstream so I'm really not sure what to look for.
>
> -M
>
>
>>
>> Regards
>> Steve
>> On 19/07/2019 22:01, B Carr wrote:
>>
>>
>> What does this part mean? "...with the ZFS rebased to ZFS on Linux..."
>>
>>
>> On Friday, July 19, 2019 at 1:37:02 PM UTC-6, mat...@gmail.com wrote:
>>>
>>> I'm not sure where to ask this since this isn't actually a Go bug. Go
>>> 1.12, 1.1, etc build fine on FreeBSD with ZFS in base. However, with the
>>> ZFS rebased to ZFS on Linux I'm seeing issues that I can only reproduce
>>> building Go.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golan...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/fb3ca79e-cd21-4b4f-ac6c-4e608825d26e%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/e5b4f8cf-6203-4a93-88fe-b4d61d83b12d%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/CAHEMsqbcX-8O4c%2BSwezHoH0MDQ51u4bVR%2B0YDVatHwcTO7M7ew%40mail.gmail.com.


[go-nuts] [ANN] SFTPGo: Full featured and highly configurable SFTP server software

2019-07-20 Thread nicola . murino
Hello all,

I'm pleased to announce SFTPGo

https://github.com/drakkan/sftpgo

cheers,
Nicola

-- 
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/7f65c4ac-5dfc-439f-b017-910865c9525a%40googlegroups.com.


[go-nuts] Windows vs Linux ReadString

2019-07-20 Thread wallanedwards
Guys

I started a go project on windows that leveraged readstring to read command 
line input.  It blocked on Windows.  I just ran my code on Linux and the 
readstring does not block at all.  Can someone explain this to me?

Thanks in advance,
Allan

-- 
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/d5ed6db8-4510-41e7-8ecf-9dc2f7adc435%40googlegroups.com.


[go-nuts] Re: Need help to learn go lang

2019-07-20 Thread Leo R
Two books immediately come to mind 
(1)  Donovan & Kernighan "The Go Programming Language", 2016
(2) Tapir Liu "Go 101", 2019   [https://go101.org/]

Book (1) is to Go what K is to C. The book (2) is a useful complementary 
exposition. Both books assume some familiarity with programming in general.

Hope it helps,
--Leo

On Friday, July 19, 2019 at 9:39:03 AM UTC-4, veeres...@gmail.com wrote:
>
> would anyone help me out how to learn go lang more practically , may be 
> some resources . I want to understand go lang more practically , with some 
> great examples.
>
> thank you!
>

-- 
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/3312a693-b9ca-47e9-a445-471fe0acfb47%40googlegroups.com.


Re: [go-nuts] Windows vs Linux ReadString

2019-07-20 Thread Michael Jones
show some code.

On Sat, Jul 20, 2019 at 6:15 PM Allan Edwards 
wrote:

> Wow, thanks for responding guys.  So I ran my exe on linux without goland
> and bam the readstring blocked as needed.  For some reason the ReadString
> call is not blocking  inside of goland.  It seems like a great IDE but I
> found a weird bug.  On the Windows side the ReadString blocks inside of
> golandon Windows.  It just does not work correctly on Linux.
>
> On Saturday, July 20, 2019 at 3:52:39 PM UTC-5, Ian Lance Taylor wrote:
>>
>> On Sat, Jul 20, 2019 at 1:48 PM  wrote:
>> >
>> > I started a go project on windows that leveraged readstring to read
>> command line input.  It blocked on Windows.  I just ran my code on Linux
>> and the readstring does not block at all.  Can someone explain this to me?
>>
>> We will be able to help you better if you show us your code and tell
>> us precisely what you did.
>>
>> 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/675c8964-f2eb-475b-b042-20e01af50e99%40googlegroups.com
> 
> .
>


-- 

*Michael T. jonesmichael.jo...@gmail.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/CALoEmQys5ecJXUTaQH8LH0ypOyAfhkm_%3Dmt14WFnKC52y0gT%2BA%40mail.gmail.com.


Re: [go-nuts] Windows vs Linux ReadString

2019-07-20 Thread Allan Edwards
Wow, thanks for responding guys.  So I ran my exe on linux without goland 
and bam the readstring blocked as needed.  For some reason the ReadString 
call is not blocking  inside of goland.  It seems like a great IDE but I 
found a weird bug.  On the Windows side the ReadString blocks inside of 
golandon Windows.  It just does not work correctly on Linux.

On Saturday, July 20, 2019 at 3:52:39 PM UTC-5, Ian Lance Taylor wrote:
>
> On Sat, Jul 20, 2019 at 1:48 PM > 
> wrote: 
> > 
> > I started a go project on windows that leveraged readstring to read 
> command line input.  It blocked on Windows.  I just ran my code on Linux 
> and the readstring does not block at all.  Can someone explain this to me? 
>
> We will be able to help you better if you show us your code and tell 
> us precisely what you did. 
>
> 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/675c8964-f2eb-475b-b042-20e01af50e99%40googlegroups.com.


[go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Vasiliy Tolstov
Hi. I have reflection based question.
I need to store type of struct passed to func and later based on this
stored type reconstruct empty needed struct.
Does this possible ?

-- 
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/CACaajQuvs1Ytv_67LUov420j-Aic2MtycS8BMC4HZ_kwNB%3DmAg%40mail.gmail.com.


Re: [go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Jan Mercl
On Sat, Jul 20, 2019 at 9:28 AM Vasiliy Tolstov  wrote:

> Hi. I have reflection based question.
> I need to store type of struct passed to func and later based on this stored 
> type reconstruct empty needed struct.
> Does this possible ?

Not sure I understood the question: https://play.golang.org/p/5AEn3IsKObo

-- 
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-XObyXZkDvMwouy52B9N-m8Rxi3PU-sPNRqJqycAXxq0w%40mail.gmail.com.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-20 Thread Jan Mercl
On Fri, Jul 19, 2019 at 10:39 PM Cassandra Salisbury  wrote:
>
> I encourage everyone to take a look at the code of conduct. I have had 
> multiple reports from this particular thread.

I, for one, have no idea why. But I guess Kafka would be delighted by
this mysteriosity.

-- 
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-XBFRVJjnt1OdKYOTLMh_-6pzCAZBaK5faaxXFD73eEdQ%40mail.gmail.com.


Re: [go-nuts] Get struct type , save and reconstruct empty struct later

2019-07-20 Thread Vasiliy Tolstov
Thanks, something like this, but i need to store type in string or []byte
in db, and based on this create new empty struct.

сб, 20 июл. 2019 г., 10:55 Jan Mercl <0xj...@gmail.com>:

> On Sat, Jul 20, 2019 at 9:28 AM Vasiliy Tolstov 
> wrote:
>
> > Hi. I have reflection based question.
> > I need to store type of struct passed to func and later based on this
> stored type reconstruct empty needed struct.
> > Does this possible ?
>
> Not sure I understood the question: https://play.golang.org/p/5AEn3IsKObo
>

-- 
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/CACaajQsO90D5iDOZEpsgwbPBgEu%3DU8eLpYeg%3D2b2odAcp55f9g%40mail.gmail.com.


Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-20 Thread Henrik Johansson
Reports of violations are not violations.
I assume the standard coc procedure kicks in to determine if violations
occurred or not.

On Sat, Jul 20, 2019, 10:24 Jan Mercl <0xj...@gmail.com> wrote:

> On Fri, Jul 19, 2019 at 10:39 PM Cassandra Salisbury 
> wrote:
> >
> > I encourage everyone to take a look at the code of conduct. I have had
> multiple reports from this particular thread.
>
> I, for one, have no idea why. But I guess Kafka would be delighted by
> this mysteriosity.
>
> --
> 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-XBFRVJjnt1OdKYOTLMh_-6pzCAZBaK5faaxXFD73eEdQ%40mail.gmail.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/CAKOF6966uwzjxiv%2B885PPbGC6sQBOcYuDZK%2BLBN0c1JZbMj8_Q%40mail.gmail.com.