Re: [go-nuts] mount remote storage without FUSE

2020-11-25 Thread 'Axel Wagner' via golang-nuts
Yes, both of those seem to be using kernel modules :) Implementing kernel modules in Go would be ambitious, to say the least (at least in my opinion). On Wed, Nov 25, 2020 at 11:28 PM Chris Lu wrote: > Hi, Axel, > > Thanks for answering! I was checking CEPH, Lustre, etc. Here is one > example: >

Re: [go-nuts] concurrency safety

2020-11-25 Thread Ian Lance Taylor
On Wed, Nov 25, 2020 at 6:13 PM Alexey Dvoretskiy wrote: > > How would you cal "thread-safety" in Go? Go doesn't have threads so the term > "thread-safety" sounds bit off. The standard library says things like "Multiple goroutines may invoke methods on a Conn simultaneously" (from https://golang

Re: [go-nuts] error handling proposals summary

2020-11-25 Thread Ian Lance Taylor
On Wed, Nov 25, 2020 at 3:10 PM seank...@gmail.com wrote: > > For some reason I thought going through most of the error handling proposals > would be a nice way to spend the evening (note I now mostly regret this). If > anyone wants to see how similar they are: > https://seankhliao.com/blog/120

Re: [go-nuts] concurrency safety

2020-11-25 Thread Kurtis Rader
On Wed, Nov 25, 2020 at 6:13 PM Alexey Dvoretskiy < advorets...@emeraldcloudlab.com> wrote: > How would you cal "thread-safety" in Go? Go doesn't have threads so the > term "thread-safety" sounds bit off. Some more context around your question would be helpful. Personally, I don't see a problem

[go-nuts] concurrency safety

2020-11-25 Thread Alexey Dvoretskiy
How would you cal "thread-safety" in Go? Go doesn't have threads so the term "thread-safety" sounds bit off. -- 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 gola

[go-nuts] error handling proposals summary

2020-11-25 Thread seank...@gmail.com
For some reason I thought going through most of the error handling proposals would be a nice way to spend the evening (note I now mostly regret this). If anyone wants to see how similar they are: https://seankhliao.com/blog/12020-11-23-go-error-handling-proposals/ -- You received this message

Re: [go-nuts] mount remote storage without FUSE

2020-11-25 Thread Chris Lu
Hi, Axel, Thanks for answering! I was checking CEPH, Lustre, etc. Here is one example: https://github.com/ceph/ceph/blob/3931b21ae8ae508f2cd826a1e6cc89c9b2f64f97/src/libcephfs.cc Chris https://github.com/chrislusf/seaweedfs On Wed, Nov 25, 2020 at 3:17 AM Axel Wagner wrote: > Can you link to

Re: [go-nuts] How to plug git version when using "go get" to fetch a cli?

2020-11-25 Thread Ian Davis
The version is really a property of the code (and binary) not the repository. I think it's better to put the version in the code that is committed. This is the approach taken by packages such as protobuf https://pkg.go.dev/

Re: [go-nuts] How to plug git version when using "go get" to fetch a cli?

2020-11-25 Thread seank...@gmail.com
using `runtime/debug` this will return a tagged or pseudo version when retrieved through `go get` in module mode, in other cases it will return `(devel)` i, _ := debug.ReadBuildInfo() fmt.Println(i.Main.Version) On Wednesday, November 25, 2020 at 7:14:45 PM UTC+1 changkun wrote: > That is real

Re: [go-nuts] How to plug git version when using "go get" to fetch a cli?

2020-11-25 Thread changkun
That is really unfortunate. Is there any alternative solution so that I can burn at least the version information to the binary when a user uses `go get`? On Wednesday, November 25, 2020 at 6:36:17 PM UTC+1 Jan Mercl wrote: > On Wed, Nov 25, 2020 at 6:25 PM changkun wrote: > > > As far as I kn

Re: [go-nuts] How to plug git version when using "go get" to fetch a cli?

2020-11-25 Thread Jan Mercl
On Wed, Nov 25, 2020 at 6:25 PM changkun wrote: > As far as I know, there are two approaches to add extra information at build > time: > 1. using -ldflags="-X path/pkg.Var=${ENV_VAR}", in a Makefile > 2. using `go generate ./...`, before `go build` > > These approaches are good as it is if I bui

[go-nuts] How to plug git version when using "go get" to fetch a cli?

2020-11-25 Thread changkun
Hi golang-nuts, As far as I know, there are two approaches to add extra information at build time: 1. using -ldflags="-X path/pkg.Var=${ENV_VAR}", in a Makefile 2. using `go generate ./...`, before `go build` These approaches are good as it is if I build my binary and distribute it to other use

Re: [go-nuts] Limiting the max heap size of a Go process

2020-11-25 Thread Ian Davis
On Wed, 25 Nov 2020, at 12:44 PM, Viktor Kojouharov wrote: > > Hi, > > Is there a way to set a hard limit on the max heap size a process is allowed > to consume, from within it? > It's almost never a problem for a process to consume as much memory as is > available, however, I've ran into real-

[go-nuts] Syslog, parquet, gRPC

2020-11-25 Thread Ramin Chopurov
Dear All, I am glad to be here and I hope to learn and share valuable experiences. So my entrance question is regarding the Syslog theme. Maybe someone may help with the following problems: within the gRPC project 1. I would like to catch data from the command line or Syslog-port and adapt pa

[go-nuts] Limiting the max heap size of a Go process

2020-11-25 Thread Viktor Kojouharov
Hi, Is there a way to set a hard limit on the max heap size a process is allowed to consume, from within it? It's almost never a problem for a process to consume as much memory as is available, however, I've ran into real-life cases in a k8s environment, where a pod with a Go process will get

[go-nuts] Clarification regarding RoundTripper's guidance on Response

2020-11-25 Thread Amit Saha
Hi all, I am wondering whether the RoundTripper’s documentation on what can be done with the Response obtained needs further clarification as to is it ok or not to modify the response object? In addition is it safe to consume the Response from another groutine after/when the RoundTripper retur

Re: [go-nuts] mount remote storage without FUSE

2020-11-25 Thread 'Axel Wagner' via golang-nuts
Can you link to an example C project? Theoretically, everything that's possible in C should also be possible in Go. However, I'm unaware of a method to mount a userspace filesystem except FUSE. So as far as I'm aware, you'd need a kernel module for that (and, yeah, doing that with Go would probably

[go-nuts] Re: How to apply concurrency in golang to pass multiple app metrics to datadog

2020-11-25 Thread Anderson Queiroz
I didn't have much time to look at it, but try to rebind the `app` variable: for _, app := range appName { // Calculate the Epoch Time app := app // rebidding app a short, and not quite formal, explanation is that the loop variable is reused during the iterations, and when a loop variable is cap

[go-nuts] mount remote storage without FUSE

2020-11-25 Thread ChrisLu
Hi, Gophers (who are also good in C), Currently I am using FUSE to mount and write to remote storage. The library I am using is Basil Fuse. The performance is good as far as FUSE can go. User -> file.write() -> Linux Kernel -> Virtual File System -> libfuse -> FUSE -> DFS Client(in Go) -> Remo