On Fri, Aug 4, 2023, 13:57 Harri L wrote:
> Yes, we can handle Go errors without language changes; that’s true. But
> how we should annotate errors? The presented version of CopyFile leads to
> following 'stuttering':
> cannot copy '/tmpfs/play' to './tmp33/not-exist.txt': cannot create
> destina
I understand, but there is a little difference, you can find code out there
improving performance thanks to generics, I am not sure if we can get any
performance improvement by using "orelse return err".
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts
s room for changes... but changes
> doesn't come without some resistance.. That is natural...
>
> > Go best features is the lack of new features.
>
> What about generics? That was a major change... It was really necessary or
> not is another topic.
>
> El vie, 4 a
On Thu, Aug 3, 2023, 23:45 DrGo wrote:
> @Miguel Angel Rivera Notararigo
>
> Thanks for taking the time to write...
>
> In my proposal, people are free to add as much context as they want...
>
Yeah I know, I like your proposal, it is just how they handle errors in the
V pr
func CopyFile(src, dst string) error {
r, err := os.Open(src)
if err != nil {
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
defer r.Close()
w, err := os.Create(dst)
if err != nil {
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
if _, err := io.Copy(w, r); err != nil {
w.Close()
os.Re
Not sure if you haven't tried them yet, but here:
- https://github.com/tetratelabs/wazero
- https://github.com/knqyf263/go-plugin
- https://github.com/tetratelabs/wazero
- https://github.com/ebitengine/purego
I need some IPC too for a experiment, and was going to try them.
On Sun, Apr 9, 2023
Try commenting runtime.GC
On Wed, Mar 1, 2023, 14:31 Jochen Voss wrote:
> Dear Sean,
>
> Thanks for trying this out. Your result is different from mine, but I
> don't think this can be right. According to the output, the only
> allocation would be inside the regexp module. But there should be
I tend to use errX (X is adapted according to context) for function scoped
errors, and err for block scoped errors
func MyFunc() error {
> v, errDS := doSomething()
> ...
> errDA := doAnotherthing()
> }
>
if err := doAnotherthing(); err != nil {
> return err
> }
>
That way you don't shadow
You can use the vendor folder, just copy (or symlink, but you will need to
keep them updated) what you need there and will work.
--
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, sen
What would be the difference between using exceptions/deferring a
generalized error wrapping, and panic-recover?
--
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 g
Most of the issues presented here are only relevant for CGO and other
programming languages, not Go.
Also, could anyone share references about the security problems in Alpine?
I may say Windows is more secure and faster than Linux (or the opposite),
but without any evidence, it is just a conjectur
Hi! you may try this https://play.golang.org/p/hDDyzm6IfED or this
https://play.golang.org/p/MoKAbIbtR_J, but the user cannot edit previous
lines and he/she have to hit Ctrl + D when is done
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsu
ang true to me. After all, we *do*
> allow converting between string and []rune, which has the same problem.
>
> On Thu, Jun 18, 2020, 04:53 Miguel Angel Rivera Notararigo <
> ntr...@gmail.com> wrote:
>
>> Oh, it was a FAQ haha sorry about that and thanks Tyler and Ian :D
&g
Oh, it was a FAQ haha sorry about that and thanks Tyler and Ian :D
--
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 vi
Allowing this implicit conversion would be a bad thing? because it works
like generics without any new syntax.
Also, I found this a little messy
type Ordered interface {
type int, int8, int16, int32, int64,
uint, uint8, uint16, uint32, uint64, uintptr,
floa
Hello :) I think you need to give some samples of what you are doing
because without that the people that know about how to solve that problem
cant help you. Remember, there are a lot of factors that may increase the
building time, could you share at least something like time go build with
both ver
You can write your own handler that serve static files and use main.html as
index, but, the main.html name is mandatory? It breaks the convention
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving em
More than magic, it is a global convention. I guess it could be interpreted
as: when you access a directory, the web server will index its content and
will show you a list of links, if you want to override this behavior, you
could create your own index.
See
https://github.com/golang/go/blob/b68624
Hi, this works for me:
learn/
- webpages/
- css/
- main.css
- js/
- file.js
- index.html
- main.go
-
package main
import (
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir("webpa
Hi! you could use the standard library, take a look at
https://golang.org/pkg/net/http and https://golang.org/pkg/html/template/
packages, should be enough with them. It looks like an embedded database
fits for your use case, you could use https://github.com/dgraph-io/badger
or SQLite if you prefer
Hi, just add k := k after the for-range line
--
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.
For more options, visit h
Hi Dave, do you have space for a Jr Go developer?
--
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.
For more options, visi
Hi, you could use a custom tls.Config, see this example (
https://golang.org/pkg/crypto/tls/#example_X509KeyPair_httpServer)
On Thu, Sep 13, 2018, 03:49 Houzuo Guo wrote:
> Hello fellow Gophers.
>
> I'm programming an HTTPS server and PEM-encoded certificate data is given
> in bytes rather than
Do you use a Makefile?
.PHONY: deps
deps:
dep ensure
path/to/the/script.sh
--
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...@googlegrou
24 matches
Mail list logo