Hey Gophers,
I'm trying to run the type-checker on some code using "go/types". I got it
working for local packages, but I'm stuck on the following when "errors" is
imported:
```
could not import errors (errors/wrap.go:8:2: could not import
internal/reflectlite (internal/reflectlite/value.go:10
Hi there,
I was wondering if anyone has a solution for tracing across local
subprocesses in Go?
Can the standard library do this somehow? OpenTelemetry seems a bit
overkill for this use case.
Thanks!
Matt
--
You received this message because you are subscribed to the Google Groups
"golang-n
Hey, thanks. I'm aware of this approach.
I'm hoping for some technique that automatically injects, since it can be
cumbersome to inject all your dependencies by hand.
Similar to google/wire, but without the generated file sitting in the
filesystem next to your test.
Matt
On Wednesday, Nove
I'd say you pay a bit less for the memory you consume. Generally it runs
faster than the more common JS or Python serverless functions, so you also
pay less there.
I'd argue the main reason to use Go on Serverless is because you'd like to
deploy to a Serverless environment and you prefer writin
I'm looking for a way to inject test dependencies into a test suite.
Something like:
```
package user_test
func UserTest(t *testing.T, db *postgres.DB) {
fmt.Println("running user test", New("Alice Wonderland"))
}
```
```
go_test ./user_test.go
```
Where go_test would either manipulate the f
I noticed a lonely BUG comment without an explanation in the flag
package: https://github.com/golang/go/blob/master/src/flag/flag.go#L955
I did a quick `git blame` and it goes all the way back to the initial
commit:
https://github.com/golang/go/commit/ac0dd5ae525db0d057e94c03c3f506bc30afae31.
TC+1 Kurtis Rader wrote:
> Do you have environment var GOBIN set? Check the output of "go env GOBIN".
> See https://golang.org/ref/mod#mod-commands.
>
> On Wed, Mar 10, 2021 at 2:59 PM Matt Mueller wrote:
>
>> Hey folks,
>>
>> I'm trying to install a c
Hey folks,
I'm trying to install a command inside a module globally on my system so
that I can use that binary elsewhere. During the $GOPATH era this worked
something like this:
go install cmd/app/main.go
// installed app to $GOPATH/bin
Unfortunately that doesn't seem to work anymore. It does
you just have to wait for go1.16. A beta should be released soon
> (probably next week, AIUI).
>
>
> On Thu, Dec 3, 2020 at 12:32 AM Matt Mueller wrote:
>
>> Hey there, I'd like to try the io/fs package on Go 1.15. Is there an easy
>> way to do this?
>>
>> I t
Hey there, I'd like to try the io/fs package on Go 1.15. Is there an easy
way to do this?
I tried without much expectation:
go get -u github.com/golang/go/src/io/fs
But was greeted with this error:
go: found github.com/golang/go/src/io/fs in github.com/golang/go/src
v0.0.0-20201202201757-2d02
nalysis
> running from the repository (like sourcegraph or githubs hover info) might
> not understand the code anymore.
> >>
> >> But, yeah. In general, you can put *any* go code in an appropriate
> .zip-file and serve it up as a module. You don't even have to publ
Sorry, maybe cache is the wrong word.
Wherever "go get -u ..." downloads modules, I'd like to stick my generated
code.
Conceptually you could think of it as a virtual module used only during
development. If you're familiar with Node.js, You could also think of it as
creating a directory in no
Hey folks,
I'm working on a project with a lot of code generation. I'd love to:
- get the code generation out of the way when you don't care about it
- be able to vendor the generated code when you do care about it
That led me to an idea about generating code into the go module cache. Do
you s
I think I got it. It looks like `go list` uses an internal cache to make
its use really fast. Hopefully this package gets merged into the stdlib and
we can take advantage of the cache directly!
On Monday, August 17, 2020 at 11:22:52 PM UTC+2 Matt Mueller wrote:
> Hi folks,
>
> I wa
Hi folks,
I was looking into where my packages.Load time was being spent and I
noticed that under the hood the packages library calls out to "go list" for
information.
I'm just wondering if there's any specific reason for this? It seems like
fairly low-hanging fruit performance-wise to not spa
I'm working on a dev tool for automatically reloading the server when you
change a file.
I'd like for the reload time to be as fast as possible. Are there any flags
or environment variables that I can set to see where the time is being
spent (compiling, linking etc.)? Also seeing what packages
Hey folks,
I'm working on a server-side Javascript rendering package in Go. It uses
https://bellard.org/quickjs/ for it's parser and interpreter. I'm using
https://github.com/lithdew/quickjs to package it with Go.
Quickjs appears to have some thread-local memory, so I'm
use runtime.LockOSThrea
Hey folks,
I'm trying to ensure that the user must pass a specific location (anything
but time.Local) into a function.
I'd like to add a check like this:
// ensure we didn't pass in an offset the default time.Local
if offset.Location() == time.Local {
return nil, errors.New("offset use a speci
Thanks for the great info!
Out of curiosity, how is Go handling ctrl+d (sending EOF to stdin) right
now? Is it part of the special case? A more generic way to ask this is:
Is it possible to programmatically tell os.Stdin that we've reached EOF
while you're trying to read from it?
On Friday,
Hey folks,
I'm trying to figure out how to cancel reading from stdin programmatically.
Basically the same way that ctrl+d works on OSX.
I would have thought this would work, but this program will just run
forever:
package main
import (
"io/ioutil"
"os"
"time"
)
func main() {
go func()
e
> whether the go tool expects all files in a package to be in the same
> directory or not.
>
> The way to call "go run" from Go is to use the os/exec
> <http://godoc.org/os/exec#example-Cmd-CombinedOutput> package to
> literally run the command.
>
> On Mon,
Hey folks!
I'm using the new https://godoc.org/golang.org/x/tools/go/ast/astutil#Apply
function, but keep running into the question:
After I rewrite these files, where do I stick them so they're still
buildable with the rest of the program? Is there anyway to call "go run"
after modifying the
Tuesday, October 24, 2017 at 12:43:21 AM UTC+7, Ian Lance Taylor wrote:
>
> On Mon, Oct 23, 2017 at 10:25 AM, Matt Mueller > wrote:
> >
> > Ah thanks guys for the insights, this led me to do some more digging:
> >
> > http://man7.org/linux/man-pages/ma
Ah thanks guys for the insights, this led me to do some more digging:
http://man7.org/linux/man-pages/man2/listen.2.html
http://man7.org/linux/man-pages/man2/accept.2.html
- Looks like Listen() creates a socket and a backlog queue.
- When you call Dial(), the connection request gets stored in tha
Hey everyone!
This question cropped up while testing. It's 2 related questions:
*1. Why am I able to write to without accepting a connection?*
addr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
ln, err := net.ListenTCP("tcp", addr)
if err != nil {
25 matches
Mail list logo