74,464 questions
Score of 2
0 answers
68 views
How to change the color of window caption in golang gio ui
I'm looking at golang library https://gioui.org/
When I run a hello world example:
package main
import (
"image/color"
"log"
"os"
"gioui.org/app&...
Score of -6
0 answers
74 views
I need to send myself an email using Go backend + OCI Email Delivery + SMTP (Outlook) [closed]
I am using OCI credentials where I have given my necessary SMTP host, username and passwords and all. The port I am using is 587 (I read another stack overflow where they suggest 465 but why though?). ...
Score of 0
1 answer
74 views
My login handler is being called every time I call another endpoint
I created a simple method for the app data struct in Go:
func (a *app) route(s *store.Storage) *chi.Mux {
tokenAuth := jwtauth.New("HS256", []byte(s.JWTSecret), nil)
mux := chi....
Score of 0
1 answer
112 views
How can I generate human-friendly numeric scale values between two float64 values in Go?
I need to generate a set of evenly spaced numeric values covering a given range. This is mainly intended for things such as chart axes, scales, thresholds, and similar UI representations.
Simply ...
Score of 1
1 answer
102 views
How to triage json.SemanticError when using encoding/json/v2?
When using the new encoding/json/v2 package, and unmarshaling some JSON, it will potentially return a json.SemanticError error.
As far as I can see, json.SemanticError is returned when the JSON is ...
Score of -1
0 answers
118 views
The return value is ignored without warnings by staticcheck (SA4017)
This error puzzles me, and I believe a more in-depth analysis could help clarify the issue: I cannot say for certain whether the behavior described below is legitimate or an actual error in ...
Score of 1
2 answers
119 views
How to call Go WASM from a TypeScript React frontend?
I am working on a web app with the following architecture:
The frontend is a React app written in TypeScript.
The "backend" is written in Go, and compiled to WASM for distribution with the ...
Score of -1
1 answer
301 views
How to redirect a runtime fatal error to a logger?
In a Go program I got this error message:
fatal error: concurrent map writes
The message is shown in the terminal window of VS Code. But in my log there is nothing, which make sense because log....
Score of 2
2 answers
308 views
How can I implement Java-like enums in Go?
Unlike Go's iota-based enums, Java enums are singleton objects. Each enum constant is a unique instance that can carry additional state and behavior, while also providing name(), ordinal(), values(), ...
Score of 1
1 answer
207 views
Supabase Go: invalid character 'B' looking for beginning of value
I am working on a web crawler using Go and Supabase. This section of code throws an error when the length of the newLinks slice is above a certain number -- I haven't been able to determine what that ...
Score of 4
0 answers
213 views
I have an fs.FS, and use WalkDir. How can I get the "real" full path to an entry it finds?
In the past I've used the version of WalkDir that is not based on fs.FS, but I recently tried changing to the fs.FS-based one so that I could more cleanly do unit testing. But now I feel like I'm not ...
Score of -1
2 answers
196 views
How do I make web interactive maps with GO and React? [closed]
I am making pet-project with Go and React. I want to make web app, that for start, shows your location on a interactive world map. How should I make app logic with Go and React, so it would be ...
Score of 0
4 answers
329 views
How can I check whether a string contains only digits in Go? [duplicate]
In Python, I can use the str.isdigit() method to check whether a string contains only numeric characters.
For example:
"12345".isdigit() # True
"123a".isdigit() # False
&...
Score of 1
0 answers
85 views
Chromedp initialization fails on warmup with "chrome failed to start" in Windows
package browser
import (
"context"
"log"
"os"
"os/exec"
"time"
"sync"
"path/filepath"
"...
Score of 2
1 answer
135 views
How to convert to a different type depending on architecture?
I am trying to fix the compilation of file overlay/tun_freebsd.go in module github.com/slackhq/nebula on armv7 FreeBSD. This file uses the syscall.Iovec structure, which is defined as
type Iovec ...