[go-nuts] Export fs.FS as FUSE fs

2023-06-22 Thread Tamás Gulácsi
Hi,

Does anyone know an existing solution for exporting an fs.FS as a FUSE 
filesystem?

As fs.FS is standard now, this would open several new possibilities,
as a lot of interesting fs.FS implementations exist (zip, tar, DB, 
embedded, union ),
and this one little glue code could export them all!

Thanks in advance,
Tamás

-- 
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/6d5100d8-04b7-4b22-a0df-77837de2f4f5n%40googlegroups.com.


Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-22 Thread 'Axel Wagner' via golang-nuts
On Thu, Jun 22, 2023 at 11:04 PM cpa...@gmail.com  wrote:

> Anyone can choose to stop reading it or posting to it. Opening it will not
> stop individuals from protesting.
>

I'm going to state the obvious: Given that closing it was an act of
protest, opening it will certainly stop *some* individuals from protesting.
And it so happens they are the ones most affected by the changes.

Personally, I find it kind of ludicrous, that mods even have to ask their
communities for permission to protest - after all, protest *has* to be
inconvenient to be effective. But it seems that if they don't, their
protest will be silenced by the company. And even *when* they ask and get
overwhelming backing from their communities, the company seems to end up
doing that.

So, under those circumstances, I find it far more important to give mods
the ammunition they need in their protest. Personally.
But, it's a poll. People can vote however they like, obviously. Just
thought the counter-position also deserves some space in this thread.

-- 
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/CAEkBMfG_nL-BVi54Txvf0fM1H8PNyGkJv1jyqjF7kVqdC2j1Qw%40mail.gmail.com.


Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2023-06-22 Thread Henry
I am running Windows 11 with Kaspersky. I don't have such problems. When it 
comes to Windows, it isn't as simple as blaming your AV. Windows is a 
complex OS and it is doing many different things in the background (e.g. 
doing maintenance, installing updates, etc.).  You should open your Task 
Manager and see what is hogging your resources. You also need some decent 
hardware as Windows is a bit resource hungry. You may also check if there 
is an error with Windows itself. See  Using System File Checker in Windows 
- Microsoft Support 


On Thursday, June 22, 2023 at 7:47:59 PM UTC+7 Jet Li wrote:

> Like to note that if you mean Windows Defender, there is no way to disable 
> that after Build 20H2 iirc where I was task to deploy Windows 10 and could 
> not find the option in Windows Group Policy settings after the update, if 
> Go app are affected by Windows Defender. Your only option is to use older 
> Windows build and alternative OS, mileage may vary.
>
> Another option, could be impossible to backup VM image as it's on macOS
> https://multipass.run/
> On Thursday, 22 June 2023 at 19:52:56 UTC+8 Wojciech S. Czarnecki wrote:
>
>> Dnia 2023-06-18, o godz. 22:52:58 
>> tokintmash  napisał(a): 
>>
>> > Hello, 
>> > 
>> > Was there a solution to this? I am having the same issue. Win 10 
>> machine 
>> > and compiling and running simple lines of code takes ages. 
>>
>> The answer is always the same: turn off your antivirus software for your 
>> development tree. 
>>
>> Such delays are due to "heuristics" usually implemented by uploading your 
>> exe to the vendor. 
>> Root cause is that after 12 years AV vendors still can not cope with what 
>> they pereceive 
>> a "non standard" linker, ie. a Go's one. 
>>
>> 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/18059053-c2c8-4ad7-875a-2a5704113ea7n%40googlegroups.com.


Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2023-06-22 Thread Amnon
Someone should publish a benchmark of compiling Go code on Windows, Linux, 
osX.
People can take this into account when selecting their development platform.
And if enough people complain about Windows machines being several orders 
of magnitude slower 
than similar priced competing platforms, then maybe Microsoft will take 
note and fix their Anti-Virus tools.

On Thursday, 22 June 2023 at 13:47:59 UTC+1 Jet Li wrote:

> Like to note that if you mean Windows Defender, there is no way to disable 
> that after Build 20H2 iirc where I was task to deploy Windows 10 and could 
> not find the option in Windows Group Policy settings after the update, if 
> Go app are affected by Windows Defender. Your only option is to use older 
> Windows build and alternative OS, mileage may vary.
>
> Another option, could be impossible to backup VM image as it's on macOS
> https://multipass.run/
> On Thursday, 22 June 2023 at 19:52:56 UTC+8 Wojciech S. Czarnecki wrote:
>
>> Dnia 2023-06-18, o godz. 22:52:58 
>> tokintmash  napisał(a): 
>>
>> > Hello, 
>> > 
>> > Was there a solution to this? I am having the same issue. Win 10 
>> machine 
>> > and compiling and running simple lines of code takes ages. 
>>
>> The answer is always the same: turn off your antivirus software for your 
>> development tree. 
>>
>> Such delays are due to "heuristics" usually implemented by uploading your 
>> exe to the vendor. 
>> Root cause is that after 12 years AV vendors still can not cope with what 
>> they pereceive 
>> a "non standard" linker, ie. a Go's one. 
>>
>> 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/ec1b0a6c-0bf1-4d7a-ab77-2c2daeffb58dn%40googlegroups.com.


[go-nuts] Please consider voting to reopen Golang subreddit

2023-06-22 Thread cpa...@gmail.com
You can vote here
https://www.reddit.com/r/golang/comments/14fg8zz/remaining_closed/

I don't personally like the reddit api changes but want the Golang 
subreddit open.

Anyone can choose to stop reading it or posting to it. Opening it will not 
stop individuals from protesting.

-- 
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/113b7cc6-8211-4679-91b2-67219bdd1777n%40googlegroups.com.


[go-nuts] pgfs: an fs.FS implementation on top of the Postgres Large Objects API

2023-06-22 Thread 'Mohamed Attahri' via golang-nuts
Hey there, 

Just released https://pkg.go.dev/mohamed.attahri.com/pgfs

It's essentially an fs.FS interface implementation that uses Large Objects 
on Postgres, with all the bells and whistles.

It's powerful, because you essentially get a filesystem that's tied to a 
database transaction, and it can stores files of up to 4GB.

Feedback on the API is appreciated.

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/3edcaa8b-552d-4cd3-950e-6a2c00d794fdn%40googlegroups.com.


[go-nuts] odt: an OpenOffice/LibreOffice document parser

2023-06-22 Thread Sebastien Binet
hi there,

I've just cut [`odt@v0.1.0`][1], an OpenOffice document parser, "automatically" 
generated from the RelaxNG specification document.

`odt` also provides `odt2md`, a command that tries its best to convert an ODT 
file into a CommonMark one.

```
$> go install sbinet.org/x/odt/cmd/odt2md@latest
$> odt2md -h
odt2md converts an ODT document into a CommonMark one.

Usage: odt2md [OPTIONS] [INPUT.odt]

Example:

 $> odt2md input.odt
 $> odt2md input.odt > out.md
 $> odt2md -o out.md input.odt
 $> odt2md < input.odt > out.md
 $> odt2md -o out.md < input.odt

Options:
  -o string
path to output CommonMark file

$> odt2md ./testdata/simple.odt

# Title

Hello World!

```

One can find the expected output of a more involved example under
'cmd/odt2md/testdata/hello_golden.md'.

The parser isn't complete (yet?) and a more robust solution would be to
really generate it from the RelaxNG specification document (instead of
from a simplified one.)

Handling preformatted blocks of text could be improved.
right now, it just translates it to a sequence of `foo`\n`bar` instead of:
```
foo
bar
```
but this is coming from an impedance mismatch between how ODT encodes
this information and how CommonMark expects it.
some heuristics could fix that.

-s

-- 
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/CTJ85MU8Z60X.2ZZ1XIYH30M0J%40clrinfopc42.


Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2023-06-22 Thread Jet Li
Like to note that if you mean Windows Defender, there is no way to disable 
that after Build 20H2 iirc where I was task to deploy Windows 10 and could 
not find the option in Windows Group Policy settings after the update, if 
Go app are affected by Windows Defender. Your only option is to use older 
Windows build and alternative OS, mileage may vary.

Another option, could be impossible to backup VM image as it's on macOS
https://multipass.run/
On Thursday, 22 June 2023 at 19:52:56 UTC+8 Wojciech S. Czarnecki wrote:

> Dnia 2023-06-18, o godz. 22:52:58
> tokintmash  napisał(a):
>
> > Hello,
> > 
> > Was there a solution to this? I am having the same issue. Win 10 machine 
> > and compiling and running simple lines of code takes ages.
>
> The answer is always the same: turn off your antivirus software for your 
> development tree.
>
> Such delays are due to "heuristics" usually implemented by uploading your 
> exe to the vendor.
> Root cause is that after 12 years AV vendors still can not cope with what 
> they pereceive
> a "non standard" linker, ie. a Go's one.
>
> 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/3038658f-8118-4c48-a433-bf2733d7f571n%40googlegroups.com.


Re: [go-nuts] Why is reflect.CanAddr() returning false in this case ?

2023-06-22 Thread Jan Mercl
On Thu, Jun 22, 2023 at 12:16 PM christoph...@gmail.com
 wrote:
>
> I'm trying to get the uintptr address of a value p for which I have the 
> reflect.Value so that I can compare it with the value obtained with 
> v.Pointer() when p is a pointer.
>
> Here is a simple recursive pointer example code showing what happens: 
> https://go.dev/play/p/pST8DierbXS
>
> It is a pointer to itself defined like this:
>
> type pptr *pptr
> var p pptr
> p = &p
>
> The problem is that reflect.ValueOf(p).CanAddr() unexpectedly returns false.

I'd not say it's unexpected, the docs say:


CanAddr reports whether the value's address can be obtained with Addr.
Such values are called addressable. A value is addressable if it is an
element of a slice, an element of an addressable array, a field of an
addressable struct, or the result of dereferencing a pointer. If
CanAddr returns false, calling Addr will panic.


None of the cases above are met for 'p'.

However, the "dereferencing a pointer" case works as documented:
https://go.dev/play/p/Wn0NdsFNa4g

-- 
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-UEUe%3DPpvBzaPw7ts21U%2BXN6yip__-DwUoOW3SuJ_8qaw%40mail.gmail.com.


[go-nuts] Why is reflect.CanAddr() returning false in this case ?

2023-06-22 Thread christoph...@gmail.com
I'm trying to get the uintptr address of a value p for which I have the 
reflect.Value so that I can compare it with the value obtained with 
v.Pointer() when p is a pointer. 

Here is a simple recursive pointer example code showing what happens: 
https://go.dev/play/p/pST8DierbXS

It is a pointer to itself defined like this:

type pptr *pptr
var p pptr
p = &p

The problem is that reflect.ValueOf(p).CanAddr() unexpectedly returns false.

I would like to test if reflect.ValueOf(p).Addr().Pointer() == 
reflect.ValueOf(p).Pointer()

I have a similar problem when p is a struct with a pointer field to itself. 
CanAddr() returns false: https://go.dev/play/p/Oygg5X8Royr




-- 
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/530f8cc7-e29f-4dfd-9423-e2396ec87497n%40googlegroups.com.


[go-nuts] How do you use traceback ?

2023-06-22 Thread wilk
There is a proposal to add a trace only opt-in at error level.
Only on this error I like to know the method and line.

*Apart* to know if it's something useful to add in the standard lib or
not (to don't pollute the github issue), how do you use the traceback in
errors ?

Do you add a full traceback like with pkg/errors ?
No traceback, decorate the error is enough ?
A mix like the proposal ?
Depends of the project ?

For me it depends of the project but after using pkg/errors a lot I
tried no traceback at all, it was working and it force me to think two
time how I decorate each error, that's eventually more accurate than a
traceback. And now in few places I see that my decorate looks like a
small traceback "I'm in method X and I call Y: %v"

Thought ?

-- 
wilk

-- 
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/u715e0%24130j%241%40ciao.gmane.io.