I have some code whereby I am iterating over some data, putting that
data into a buffer slice defined outside the loop, then passing the
contents of that buffer slice to a function which returns a struct
containing that data. See the playground link as a stripped down
demonstration of what I'm actu
Hi all,
req is an HTTP scripting language that I've been working on. The
intention behind it is to provide a high-level language for quickly
scraping data off of web APIs or web pages. Just recently, v1.1.0 has
been released which adds support for working with cookies.
Feel free to check it out i
> I think there are two big advantages to making your application
> consume either plain JSON or YAML configs:
> 1. Everyone is familiar with them
> 2. You can use a more advanced tool like cue or jsonnet to generate
> them
I can see why people would prefer JSON, and I think it's fine for
storing
> Out of interest, have you come across CUE?
>
I have heard of it, but not explored it in depth. At a glance it seems
too heavyweight for what I wanted.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop rec
An article I wrote about a new configuration library I developed in Go
for working with structured configuration.
Article:
https://andrewpillar.com/programming/2022/04/09/structured-configuration-in-go/
Repo: https://github.com/andrewpillar/config
--
You received this message because you are sub
I created a simple migration tool called mgrt [1], which operates on pure SQL
scripts that are defined by the user. It has support for MySQL, SQLite and
PostgreSQL. Give it a try if you're looking for a simple migration tool that
just uses plain SQL under the hood. It's written in Go, so building i
>Thank you all. For schema migration i am looking for similar tool like flyway.
I created a simple migration tool called mgrt [1], which operates on pure SQL
scripts that are defined by the user. It has support for MySQL, SQLite and
PostgreSQL. Give it a try if you're looking for a simple migratio
Use net.JoinHostPort to concatenate the values you have in the struct
and pass the to http.Server struct.
if _, err := toml.Decode("config.toml", &conf); err != nil {
// handle error
}
addr, err := net.JoinHostPort(conf.Address, conf.PORT)
if err != nil {
// handle error
}
s
Why don't you use context.WithValue(r.Context(), , ) for passing
the injected values you want to your HTTP handlers. Then defer the logic for
retrieving whatever you want for that handler to a middleware function.
--
You received this message because you are subscribed to the Google Groups
"gola
> How can i'm avoid such errors and not specify ports by hand?
Perhaps you could use some kind of central store for storing the most
recently used port? Simply take that port from the store, increment it,
and place it back into the store for the next micro-service to use.
I think etcd [1], may be
I put together a blog post exploring some of the approaches that could
be taken for idiomatic query building in Go. The Tl;DR of it is this:
First class functions are an idiomatic way of doing SQL query building
in Go. Check out the repository containing some example code I wrote
testing this out:
Have you tried building with the -race flag?
go build - race
This should help you figure out any data race conditions that may occur.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails fro
I made a comment about this on an HN thread about ORMs in Go.
> Personally I think an active record style ORM for Go like gorm is a
poor fit for a language that doesn't come across as inherently OOP.
Going through some of the documentation for gorm, it seems to rely
heavily on method chaining
I made a comment about a similar topic on an HN thread, about
ActiveRecord style ORMs in Go.
> Personally I think an active record style ORM for Go like gorm is a
> poor fit for a language that doesn't come across as inherently OOP.
> Going through some of the documentation for gorm, it seems to
14 matches
Mail list logo