[go-nuts] Re: cgo.go: multiple definition of `c_test_func'

2023-10-05 Thread sbezverk
After looking in cgo generated files, I found that in fact function “c_test_func” is defined in 2 places. 1: ./cgo.cgo2.c:29: int c_test_func(int c1, int c2) #line 3 "/nobackup/sbezverk/projects/go/worspace/cgo_test/cgo.go" #include extern int go_test_func(int c1, int c2);

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Yeah, I need someone who knows something about how gdrive does things. Thanks for the help! On Thursday, October 5, 2023 at 7:43:08 PM UTC-4 Kurtis Rader wrote: > Did you notice the `ls` command reports the file size is 170? The same as > your program? Also, `ls` does not indicate the file is

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
Did you notice the `ls` command reports the file size is 170? The same as your program? Also, `ls` does not indicate the file is a symlink so the fact that ioutil.ReadDir presumably behaves the same as os.ReadDir (i.e., both use os.Lstat()) that isn't an issue. So for whatever reason the Google

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Here is what I see: $ ls -l Household\ Cleaning.gdoc -rw-r- 1 cecil chronos-access 170 Apr 22 15:30 'Household Cleaning.gdoc' $ I'll update the code to remove the deprecated and see if that is any different. On Thursday, October 5, 2023 at 6:06:50 PM UTC-4 Kurtis Rader wrote: > Note that

[go-nuts] cgo.go: multiple definition of `c_test_func'

2023-10-05 Thread sbezverk
Hello, I struggle to understand why this simple cgo program does not get linked, I would provide example in playground, but it does not seem to support cgo. ``` package main // #include // // extern int go_test_func(int c1, int c2); // // int c_test_func(int c1, int c2) // {

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
Note that ioutil.ReadDir() has been deprecated since Go 1.16. Which is a very long time. Its documentation is ambiguous but given the behavior you're reporting I would guess it is using the equivalent of os.Lstat() and the "files" you're dealing with are symlinks. Note that os.ReadDir() (which

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
Thanks for responding! The entire program may be found here: https://go.dev/play/p/4kLaeWeQG0Z The size comes from os.FileInfo, which is: type FileInfo interface { Name() string // base name of the file Size() int64 //

[go-nuts] [security] Go 1.21.2 and Go 1.20.9 are released

2023-10-05 Thread announce
Hello gophers, We have just released Go versions 1.21.2 and 1.20.9, minor point releases. These minor releases include 1 security fixes following the security policy : - cmd/go: line directives allows arbitrary execution during build "//line" directives

Re: [go-nuts] File size of Google docs when mounted

2023-10-05 Thread Kurtis Rader
It would help if you showed us the relevant code. My first guess is those files are symlinks. Or perhaps this is simply what Google Drive reports when a file is stat()'d. What does `ls -l` show? On Thu, Oct 5, 2023 at 8:31 AM Mandolyte wrote: > I have a program that given a starting folder will

[go-nuts] custom slog Handler which adds Attribute and WithGroup

2023-10-05 Thread Johann Höchtl
I created a custom slog Handler which adds an attribute eventId which is a GUID A NewLogger function returns that logger wrapped into a group: Every further key-value provided should go into that group. Unfortunately the eventId also gets promoted into that group although it should be at the

[go-nuts] File size of Google docs when mounted

2023-10-05 Thread Mandolyte
I have a program that given a starting folder will walk the directory structure and report file sizes and other things. I recently tried to run this code on a mounted Google Drive on ChromeOS Linux. All the google docs report a size 170 bytes. Snippet: [image: Screenshot 2023-10-05 11.29.44