When sending Read() via an RPC call or traversing locks, it is
significantly faster to return EOF in the same call as returning the rest
of the available data, than to call Read a second time to get the EOF.
It's not that hard to handle the EOF semantics. Yes, you have to know what
io.EOF means. B
On Wed, Mar 6, 2024 at 11:53 AM Jeffery Carr wrote:
> On Sunday, March 3, 2024 at 5:46:13 PM UTC-6 Christian Stewart wrote:
> Second, you can use "go work" to create a workspace with multiple go
> modules in it, so that you can develop with them without having to
> constantly update the go.mod ver
Hi Jeffery,
You can build large projects with many repos using Go modules.
Firstly, you can reference the other repos and use the latest "master"
version by writing "master" where the v verson is in the file,
then use "go mod tidy"
Second, you can use "go work" to create a workspace with mul
I agree with what Brian said and would like to suggest the following two
way RPC library with multiplexing over a single connection of any type:
https://github.com/aperturerobotics/starpc
On Thu, Dec 28, 2023, 10:06 AM 'Brian Candler' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> What
Hi all,
I was very confused by the behavior I was seeing while testing a simple
program with http.StripPrefix:
package main
import (
"fmt"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/other/", func(w http.ResponseWriter, r *http.Request) {
fmt.Println(r.URL.Path)
w.Writ
Hi,
https://pkg.go.dev/golang.org/x/tools/cmd/goimports
goimports -w ./
On Thu, Oct 19, 2023, 8:31 PM Pratik Tamgole
wrote:
> When I use packages, any packages in general, how does the import("fmt")
> line correct itself to include the used packages in the program? What tool
> is implemented h
Autocomplete and a go language server (gopls) add a ton of speed because
you don't need to look up the docs for function and variable names. And go
to definition improves speed navigating code significantly.
But vim-go can do both, so why not just use it?
It's a significant speed increase to have
you can achieve this using an io.Pipe. The io.Pipe function returns a
connected pair of *PipeReader and *PipeWriter, where writes to the
*PipeWriter are directly read from the *PipeReader. The Write call on the
*PipeWriter will block until the data is read from the *PipeReader.
pr, pw := io.Pipe()
No... The previous example streams the file as the post request. The only
difference in your example is that you're using stdin.
It's not that complicated, files also implement io.reader.
On Tue, Mar 7, 2023, 1:41 PM Wojciech Kaczmarek wrote:
> Hello,
>
> I think this code example rather stream
Hi Ian, all,
On Wed, Jan 18, 2023 at 6:56 PM Ian Lance Taylor wrote:
> > // IsEmpty checks if the interface is equal to nil.
> > func IsEmpty[T Block](blk T) bool {
> > var empty T
> > return empty == blk
> > }
> >
> > (I had blk Block before, instead of blk T).
> >
> > Comparing with emp
).
Comparing with empty is something I've needed to do a bunch of times
and have been unable to do.
On Wed, Jan 18, 2023 at 5:40 PM Kurtis Rader wrote:
>
> On Wed, Jan 18, 2023 at 5:14 PM 'Christian Stewart' via golang-nuts
> wrote:
>>
>> The thing I ran into
The thing I ran into with this today was, if you want to compare two interfaces:
var foo1 Thing
var foo2 Thing
Ordinarily you can do foo1 == foo2 and it does pointer-wise comparison.
But in a generic function, as an example:
// IsEmpty checks if the interface is equal to nil.
func IsEmpty[T Blo
I've been using this one w/o issue and at scale as well;
https://github.com/nhooyr/websocket
It also supports wasm.
On Mon, Dec 12, 2022, 1:22 PM Robert Engels wrote:
> I personally like minimal packages like this. Makes them easier to
> tailor/debug if something goes wrong. Also simpler to ta
I definitely fork things and use "replace" quite frequently.
When forking something you have to tell Go where to find it, that's
what "replace" is for.
There's a issue about using replaces in `go install` without a go.mod:
https://github.com/golang/go/issues/44840
On Sun, Dec 4, 2022 at 11:40 P
Hi all,
I've built a streaming RPC library compatible with grpc Protobuf service
definitions that can do bidirectional streaming to the web browser over any
AsyncIterable channel, currently using WebSockets but can also use Message
channel to webassembly and other messaging approaches.
https://gi
Hi Kurtis,
On Wed, Nov 23, 2022, 4:57 PM Kurtis Rader wrote:
> On Wed, Nov 23, 2022 at 7:33 AM Christian Stewart
> wrote:
>
>> This is what I'm trying to accomplish:
>>
>> Start delve (dlv) with os/exec passing a set of []string os.Args as
>> --build-flags
>>
>> Let's say I have this build argu
hristian
On Sun, Nov 6, 2022 at 9:11 PM Kurtis Rader wrote:
>
> On Sun, Nov 6, 2022 at 8:48 PM 'Christian Stewart' via golang-nuts
> wrote:
>>
>> There have been several discussions about shellquote in go-nuts in the past:
>>
>> https://github.com/kbal
Doesn't it make more sense to fix the cyclic dependencies rather than hack
the go compiler and make it do something it wasn't designed to do?
Best regards,
Christian
On Tue, Nov 22, 2022, 4:44 PM jlfo...@berkeley.edu
wrote:
> The reason I'm asking this question is because, as a learning exercis
Hi all,
There have been several discussions about shellquote in go-nuts in the past:
https://github.com/kballard/go-shellquote
https://github.com/gonuts/go-shellquote
I've found it necessary to use both Split and Join in some cases when
working with exec.Command.
This seems like the type of th
Hi all,
Figured it out: the comments appear in the comment.List, but not
comment.Text():
cmap := ast.NewCommentMap(fset, codeFile, codeFile.Comments)
for nod, comments := range cmap {
for _, comment := range comments {
comment.Text() // Does not contain comments w/o a space before th
Hi all,
I'm trying to use packages.Load to parse the following comment:
// Thing does something.
//
//my:value do-something
I'm trying to parse the my:value comment similar to go:embed.
Interestingly the comment does not appear in the AST unless I put a space:
// my:value do-something
My ques
Frank,
Am I missing something - can't you just put multiple go files in the same
directory?
All the go files in the directory will be combined into the same package.
This is frequently used for other codegen, like Protobuf.
Best,
Christian Stewart
On Tue, Nov 1, 2022, 7:44 PM Frank Jüdes wrot
Robert,
>From what I've read in the past, unsigned values are generally not
used because of the risk of accidental overflow bugs.
myLen := len(thing)
myLen--
# overflow
Best,
Christian Stewart
On Mon, Oct 31, 2022 at 8:50 PM robert engels wrote:
>
> In working on some code this night, I kept r
Hi all,
I'm writing to share my modular application framework, ControllerBus.
https://github.com/aperturerobotics/controllerbus
It provides a clean structure for building an application around
communicating control loops.
If you find this useful and/or have any feedback, feel free to reach out
24 matches
Mail list logo