Masthash

#golang

Merovius
53 minutes ago

It seems I don't use #AdventOfCode to learn new languages - but I do use it to play around with new #golang features and ideas.

Last year, the theme was pretty much "generics" and "parser combinators" - among other things with
https://pkg.go.dev/github.com/Merovius/AdventOfCode/internal/input/parse

This year, the theme seems to be playing around with the experimental iterator support (still behind a toggle in Go 1.22, to be released in February 2024):
https://github.com/Merovius/AdventOfCode/commit/2ce5224273919a89c5cdbc6cd22107b50af1c5de
(I should document my APIs, even if they are only internalโ€ฆ ๐Ÿคฆ)

Morten Linderud
1 hour ago

Spent the past couple of days rewriting my old pkcs7/authenticode library stuff for go-uefi into the new cryptobytes API.

So far quite happy with it and hopefully makes me sleep better at night.

https://github.com/Foxboron/go-uefi/commit/1b4504c78072bbf10eb957028da159c1761f3494

#Golang #UEFI #Authenticode #SecureBoot

Golang Weekly
4 hours ago

WORX - A micro framework to easily develop TMF APIs in Go

https://github.com/GraHms/worx

Discussions: https://discu.eu/q/https://github.com/GraHms/worx

#golang #programming

Let me just say this, many languages exist that are better suited for code golfing than Go ๐Ÿคฃ #adventofcode2023 #aoc2023 #golang #codegolfing

Ringtail Ringo
7 hours ago

I feel a bit like a pervert, but playing around for AoC in last years in clojure, racket java and common lisp, #golang is the first language I genuinely enjoy for this task. It is clean, fast, simple, has stellar tooling and in general just gets out of you way as much as possible. It feels *good*.

Jobs for Developers
7 hours ago

Crypto.com is hiring Rust Engineer (Greenfield project)

๐Ÿ”ง #golang #java #rust #blockchain #cryptocurrency
๐ŸŒŽ London, United Kingdom
โฐ Full-time
๐Ÿข Crypto.com

Job details https://jobsfordevelopers.com/jobs/rust-engineer-greenfield-project-at-crypto-com-feb-27-2023-dba3de?utm_source=mastodon.world&ref=mastodon.world
#jobalert #jobsearch #hiring

Daniel Martรญ
10 hours ago

Just released a new version of a #golang build obfuscator - with initial Go 1.22 support, experimental control flow obfuscation, and many bug fixes: https://github.com/burrowers/garble/releases/tag/v0.11.0

I found a great github repo with a list of all kinds of #golang #go books.
Here is the repo: https://github.com/dariubs/GoBooks

I got the link from the podcast https://cupogo.dev/ ๐Ÿ˜ :go:

Golang Weekly
16 hours ago

Running for range loop and Windows Defender says I am running virus

https://ibb.co/hCtgCF7

Discussions: https://discu.eu/q/https://ibb.co/hCtgCF7

#golang #programming

Anders Borch
17 hours ago

For now, I am using a slightly modified version of Corp (https://github.com/cyborch/corp) to solve the missing CORS headers.

#WebDev #GoLang #MastoDev

From: @anders
https://mastodon.cyborch.com/@anders/111511398644902262

Tom Jowitt
19 hours ago

Started #aventofcode today. I wish I could have done it in #rustlang this year as a learning exercise but due to time constraints I'm going to stick to brushing up my #golang.

Blain
21 hours ago

Created a new theme for #HelixEditor inspired by the dark mode code view on https://sr.ht.

#HareLang on the left and #GoLang on the right.

I'll probably clean it up some and add it to my dotfiles repo eventually and call it "srht.toml".

#Sourcehut

avelino
23 hours ago

After years of maintaining awesome-go, I stopped writing how to review and became a contributor to the project

sorry for not making this clear before

https://github.com/avelino/awesome-go/blob/main/CONTRIBUTING.md#how-to-become-a-contributor

come help to contribute to the project

#golang #opensource #foss #oss #awesomego

Maxim Lebedev
1 day ago

I'm an idiot and at first used the uint8 type, limited to a value between 0 and 255, when the answer was much larger.

#Go #Golang #AdventOfCode

Robert Roskam
1 day ago

I just completed "Cube Conundrum" - Day 2 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/2 in #golang

Golang Weekly
1 day ago

A CLI tool that turns any file and text into an image

https://github.com/tofl/pngify

Discussions: https://discu.eu/q/https://github.com/tofl/pngify

#golang #programming

I am currently doing the #adventofcode2023 #aoc2023 #aoc23 challenges (https://lnkd.in/eD24BJ7K)

I have chosen a language I havenโ€™t used for three years (#golang) and am leveraging #githubcopilot to bring me back to speed.

The best part while doing though is the ability to go with good test coverage. #github #copilot generates #tests with sample data based on interfaces/methods.

You can, for example, check out my tests for the day2: https://lnkd.in/eb7Q2Bdf

mtp
1 day ago

If premature optimization is the root of all evil is to Knuth, then so is premature abstraction to Go developers. #golang

Golang Weekly
1 day ago

Easy to use OpenID Connect client and server library written for Go

https://github.com/zitadel/oidc

Discussions: https://discu.eu/q/https://github.com/zitadel/oidc

#golang #programming

dazfuller :rickwhoah:
1 day ago

Not sure I'm going to be able to do this every day, but fancy doing something that isn't work and gives me a chance to play around with some #golang

I just completed "Trebuchet?!" - Day 1 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/1

"Easy to use OpenID Connect client and server library written for #Golang and certified by the #OpenID Foundation"

https://github.com/zitadel/oidc

This may be a good library for those who want to implement OpenID Connect in their #ActivityPub apps and clients.

Jobs for Developers
2 days ago

Datadog is hiring Data Engineer - Metering Platform

๐Ÿ”ง #golang #java #python #scala #sql
๐ŸŒŽ Boston, Massachusetts; New York City, New York
โฐ Full-time
๐Ÿข Datadog

Job details https://jobsfordevelopers.com/jobs/data-engineer-metering-platform-at-datadoghq-com-nov-1-2023-b32e34?utm_source=mastodon.world&ref=mastodon.world
#jobalert #jobsearch #hiring

#golang ใ‚ปใ‚ญใƒฅใƒชใƒ†ใ‚ฃใƒปใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆใฎไบˆๅ‘Šใ€‚ๆ—ฅๆœฌๆ™‚้–“ใ ใจๆฅ้€ฑใฎๆฐดๆ›œๆ—ฅใ‹ใช๏ผŸ
๏ผž[security] Go 1.21.5 and Go 1.20.12 pre-announcement
https://groups.google.com/g/golang-announce/c/TABUsV4-FiU

Darq
2 days ago

What did I do today? I have written #golang #go #manager, a #tool which watches your git clone and go build projects and re-compiles them when a new system go version is installed.

https://code.icod.de/dalu/gomanager

#License #apache 2.0

John Refior
2 days ago

Every time you sit down to write a simple script
โ€”
#golang #programming #BecauseWeThoughtItWouldBeEasy

A long list of imports in a program written in the Go programming language, all from the standard library but hinting at a wide range of substantial activity.
Benjamin Bryant
2 days ago

Here are some of the fun encounters and experiences I had at GoLab 2023! My final conference of the year.

Link: https://www.jaminologist.com/golab-2023-the-ultimate-review/

#golang

Christian VDZ :verified:
2 days ago

I just completed "Trebuchet?!" - Day 1 - Advent of Code 2023 #AdventOfCode #Golang https://adventofcode.com/2023/day/1

Finished the first day of #adventofcode #aoc23 #adventofocode2023

Here is my solution. Will this time implement everything with #golang

IMHO not an easy start into the puzzles: https://github.com/jeffreygroneberg/adventofcode2023

If you are stuck with part 2 then this map might be of help!

#coding #developer #devops #secops #developing #devs #software #aoc #advent #code #github

Gophers! Is this a better stack trace? What do you think?

https://github.com/bracesdev/errtrace

#golang

gram
3 days ago

#AdventOfCode day 1 (part 1) on #bash, #python, #elixir, #golang, and #rust:

https://github.com/orsinium/advent-of-code-2023/tree/master/day1

The winner in the "quick scripting" category is Python. The loser is Rust: you can compile and run a single rust script with rustc but seems like the vscode plugin doesn't work without a proper cargo project. Plus, it's the only one where I had to bring regexes as a dependency, all other languages have it out-of-the-box.

Chris James
3 days ago
Melroy van den Berg
3 days ago

I tried Zig today, but it even missing a basic HTTP Client that works with my TLS v1.3 website. I think I will try Golang again. #golang #zig

What Color is Your Function?

This post excellently formalises my gut feeling when using async functions (and 'await'ing them). I tried those in Python for the Blender Cloud add-on, and after a while it didn't feel right. Turns out that it wasn't me, it was the language feature.

I'm glad that my current favourite language (Go) is described as having a much more elegant approach to concurrency.

https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/

#programming #python #go #golang

#Go #Golang Although this series was called "No-Effort November", the value I got out of it was beyond "low effort" https://boldlygo.tech/archive/2023-11-30-farewell-november/
by @jhall

Tomasz
3 days ago

Today I learned that in the Grumpy Old Language (aka #goLang), nil does not always equal nil. ๐Ÿคฆโ€โ™‚๏ธ

Michael Henriksen
4 days ago

I was writing some tests for a personal project yesterday, using the Golden File technique for asserting logging output. I was struggling a bit with handling changing timestamps and durations in the output, until I discovered that slog handlers accept a very convenient `ReplaceAttr` option. ๐Ÿ˜

https://gist.github.com/michenriksen/ae3bc1f3a3210c5127fb7c81b8466f4c

#Golang

Screenshot of a Go `NewSlogStabilizer` function definition that returns a function suitable as a slog handler attribute replacer, which will replace non-deterministic timestamps and durations with their zero values.

Code: https://gist.github.com/michenriksen/ae3bc1f3a3210c5127fb7c81b8466f4c
Anders Eknert
4 days ago

Took some time to look into implementing a #SARIF output format option for #Regal yesterday. Regal a linter, and SARIF a standard format for static analysis, so it seemed like a reasonable thing to have. The specification however is 280 pages long! ๐Ÿ˜ซ I skipped that and went straight for the libraries. Found one for #golang and had a PR up an hour later. Just a prettier way to build a struct for marshaling really, but Iโ€™ll take that over 280 pages of SHALL, MAY and MUST.

Jobs for Developers
4 days ago

Datadog is hiring Developer Advocate - CI/CD

๐Ÿ”ง #golang #java #python #dotnet #serverless #node #aws #azure #cicd
๐ŸŒŽ Remote; New York City, New York
โฐ Full-time
๐Ÿข Datadog

Job details https://jobsfordevelopers.com/jobs/developer-advocate-ci-cd-at-datadoghq-com-nov-9-2023-72a599?utm_source=mastodon.world&ref=mastodon.world
#jobalert #jobsearch #hiring

lorddimwit: not a typewriter
4 days ago

My dear Fedi-Friends!

Do you write #Golang? Do you understand #NetworkingProtocols? When you buy a new TV is your first response to fire up #Wireshark ?

If so, DM me! Weโ€™re hiring for a research position, where you will get to do fun stuff like reverse engineer protocols, poke at strange devices, and in general do super fun awesome stuff!

Itโ€™s a 100% remote position in the USA.

Job link:

https://boards.greenhouse.io/runzero/jobs/5017514004

#GetFediHired

Zig Weekly
4 days ago

"The thing is that maximal tree-shaking for languages with a thicker run-time has not been a huge priority. Consider Go: according to the #golang wiki, the most trivial program compiled to #WebAssembly from Go is 2 megabytes, and adding imports can make this go to 10 megabytes or more. Or look at Pyodide, the Python WebAssembly port: the REPL example downloads about 20 megabytes of data. These are fine sizes for technology demos or, in the limit, very rich applications, but they aren't winners for web development.
[...]
I work on the #Hoot #Scheme compiler, which targets #Wasm with GC. We manage to get down to 70 kB or so right now, in the minimal "main" compilation unit, and are aiming for lower; auxiliary compilation units that import run-time facilities (the current exception handler and so on) from the main module can be sub-kilobyte. Getting here has been tricky though, and I think it would be even trickier for #Python."

https://wingolog.org/archives/2023/11/24/tree-shaking-the-horticulturally-misguided-algorithm
#guile #compilers

boxes and glue
4 days ago

Still thinking about a pure Go graphics language for boxes and glue. One option would be porting #MetaPost to Go, but this is quite a bit of work. Any other possibilities / ideas?

https://tug.org/metapost.html

#boxesandglue #metapost #golang #graphics

Just what I've been waiting for: Process Compose, a containerless service orchestration tool, ideal for self-contained binaries (#golang, ...).

https://github.com/F1bonacc1/process-compose

(HashiCorp's Nomad can do both btw โ€” container-based and containerless orchestration โ€”, but it might be oversized for small, focused projects.)

Sometimes you really find โ€œbeautiful" gems in โ€œclassic" code.

I am trying to figure out if the account is a managed account. For that, I make a call to the legacy backend.

Since legacy backend returns legacy data and since I want to convert it to standardized response for #Cicero (#Ginlo_II), I need to understand the response first.

For this, I usually look what the "classic" (i.e. legacy) code does. I have an iOS-Client (Swift) and a Desktop-Client (Electron). In fact, this is not the first time they disagree, but well, this one is quite funny.

I am sure if I'd check in Android-Code, I'd find that that code only supports the โ€œstate" being in the root, so I do the iOS-way: check for both and then return it in a consistent manner for Cicero.

#WorkTopics #GoLang

Screenshot of some golang-code that states:

// According to Classic Desktop-code, the info should be in a struct
// called 'Company' in a property there named 'state', but according to
// Classic iOS-Code, it *could also* be just in a string called 'state' on
// the root level. But then again, I haven't checked wha tthe
// classic Android-code says...

type LegacyMgmtStatus struct {
	State string `json:"state"`
}

type LegacyMgmtStatusStruct struct {
	Company LegacyMgmtStatus `json:"Company,omitempty"`
	State   string           `json:"state,omitempty"`
}

I can recognize a lot of language-induced brain-damage. Who would do this Expect().NotTo() stuff in #golang? My guess would be #javascript developers: https://github.com/solo-io/gloo/pull/8938/files#diff-88325ddfe024533d15c981e8d41277ed38b1e8fbc95322517f461bd74a1cad5fR77

Gareth Lewin
5 days ago

@jenniferplusplus I tried to fight that battle at Twitch but then #golang became a thing and mostly made the discussion moot.

Renรฉ Dudfield
5 days ago

We have a job opening in our team which is part of the Azure Core Linux group at Microsoft.

It's a small remote team with folks distributed around the world(Berlin, USA, India, Portugal). We do #opensource in a #UX / #design friendly kinda way.

Location: Poland, Czechia, and Romania (other locations would be very complicated/unlikely).
https://jobs.careers.microsoft.com/global/en/job/1596289/Senior-Software-Engineer-(IC4)
#kubernetes #linux #TypeScript #golang #react #mui

jbz
5 days ago
Jonathan Hall
6 days ago

Question for all GoLand users: Do you store `.idea` in git? Why or why not?

I've been using VSCode, and find sharing of project settings in `.vscode` useful, but there appear to be strong opinions against this in the case of `.idea`. I'm trying to understand--is there a legitimate concern, or is this based on outdated information (I can see that the `.idea` directory and contents has evolved quite heavily over the years in the broader IntelliJ ecosystem).

#go #golang #goland #intellij #git #ide

Gareth Lewin
6 days ago

#golang has totally ruined me. One of my first tasks at meta is on the android app and I suddenly was reintroduced to native build times.

Preslav Rachev
6 days ago

Something tells me that my latest blog post will end up at the top of HN: https://news.ycombinator.com

Only five more places to conquer :)

https://preslav.me/2023/11/27/python-is-easy-golang-is-simple-simple-is-not-easy/

#python #golang #programming

synlogic
6 days ago

making fresh #Introduction since I've been on Mastodon a year & tons of new folks have joined since

I'm a #programmer

for many decades

fave lang now is #Golang but also strong in & willing to work in #C #Java or #Python and ideally on #Linux or another #UNIX like

strengths/interests:

#performance & #scalability

#parallelism #concurrency & #multithreading

#distributed systems

solving legacy #Heisenbugs

#troubleshooting

R&D. #innovation

tech #leadership, esp for small teams or startups

djrm
6 days ago

Alright so here is my current #golang challenge. I want to create a Graphql client in Go. The thing is, I don't want to manually define a structure for the response for each query that I make. Rather, I want my code to automatically generate a response structure by looking at my query and at the graphql schemas.

Any idea on how to start on this?

dr2chase
1 week ago

All of the pattern generation done with 1000 lines of half-assed #golang using @ajstarks's gensvg.

le dek
1 week ago

I think this year I'll try the #adventofcode (at least the ~15 first days - I'm not good enough at programming to finish the month), this time in #golang instead of #python.

Python is the language I'm really comfortable with and in which I do almost all of my projects.
But I did a good amount of Go ~2 years ago, I really liked it and I want to do more and be better at it.

Sal Rahman
1 week ago

I think I found a decent solution to unmarshalling JSON-LD in Go.

Use Mitchell Hashimoto's mapstructure library.

#Go #GoLang #JSONLD #Programming #Coding

Code snippet:

type SingleID struct {
	ID string `mapstructure:"@id"`
}

type SingleValue[T any] struct {
	Value T `mapstructure:"@value"`
}

type Person struct {
	ID   string                `mapstructure:"@id"`
	Type []string              `mapstructure:"@type"`
	Name []SingleValue[string] `mapstructure:"http://example.com/schema#name"`
	Age  []SingleValue[int]    `mapstructure:"http://example.com/schema#age"`
	Dog  []SingleID            `mapstructure:"http://example.com/schema#dog"`
}

I'm slowly working through "Learn go with tests" https://quii.gitbook.io/learn-go-with-tests/ by @quii - what a great way to (re)learn the language.

You probably should have a bit of programming experience. And it helps to consult other Go resources. The explanations by Chris James are very good, but I needed to look up a few things to better understand what's going on.

#Go #Golang

glyn
1 week ago

@milesmcbain I was also impressed by the compact error handling in Rust after years of Go (and thousands of `if err != nil {...}`). I have since learned this is an error monad in another guise.

#Rust #golang #Haskell

John-Mark Gurney
1 week ago

@louis

No, you're not crazy. You're using a domain specific language to do what it's good at, and you're moving compute closer to the data which always improves performance.

It just means you need people experienced with DB/SQL, which isn't as common, which is why people aren't doing it as much.

#sql #webdev #golang #backend #mysql #postgresql

In the last few days Iโ€™m experimenting with substituting CRUD API code with Stored Procedures which directly produce the endpoints JSON as a single-row scalar value. API is then just a wrapper that authenticates, validates input and streams the DBโ€™s JSON directly to the client.

- No ORMs, no SQL generators etc.
- All SQL is where it should belong: in the database
- API does only single โ€žCALL myfunc(โ€ฆ)โ€œ db calls
- A simple centralised error handler can accurately report errors from the database
- No weird mixed row/json columns scanning into structs and re-marshalling everything to JSON
- Codebase is collapsing to 20% (by LOCs)
- Stored Procedures can use wonderfully declarative SQL code
- Response times in the microseconds, even for multiple queries, all happens inside the DB

More side effects:

- the data model can change and evolve without touching the API at all
- Zero deploys mean zero downtime
- the API application is so tiny, I could easily switch it to any programming language I want (yes, even Common Lisp) without worrying about available databases libraries, type mapping and rewriting tens of thousands of lines of intermixed language/SQL-code.

The general direction of the dev industry is heading in the opposite direction. More ORMs, more layers, more database abstraction. More weird proprietary cloud databases with each their own limited capabilities and query language.

So you tell me: Is it crazy? Is it wrong? Why do I have doubts despite everything working out beautifully?

#sql #webdev #golang #backend #mysql #postgresql

Anton Ohorodnyk
2 weeks ago

Does someone know, is it possible to set connection timeout in #gorm #golang ?

I've been mostly programming in Go #GoLang for the last few weeks. Mostly enjoying it, but finding it awkward, coming from ES6, how arbitrary it seems to sometimes call thing.method() and sometimes function(thing). There doesn't seem to be much rhyme or reason to it. For example, why don't slices have a len() method, or indeed a len member variable?

Brian Swetland
2 weeks ago

Do you know what I most appreciate about go fmt compared to C/C++ code formatters I've run into?

It doesn't impose a specific line length on you, neither forcing a wrap or forcing an unwrap.

I really appreciate this.

#GoLang #ProgrammaticStyleEnforcement

jbz
2 weeks ago

โšก What's Zig got that C, Rust and Go don't have? (with @kristoff)

https://www.youtube.com/watch?v=5_oqWE9otaE

#zig #c #rust #golang

#todayILearned more about `go mod vendor` from @jhall - I didn't know about the subtleties of how vendoring works.
https://youtu.be/e3rhaaVsUXY?si=bmzk3A0tXjuH-OlW
#go #golang

Khalid โšก
2 weeks ago

This is interesting, especially as someone who does #csharp. Maybe I should learn some #golang, #rust, or #python.

https://www.jetbrains.com/lp/devecosystem-2023/#toppaid_languages
Khalid โšก
2 weeks ago
Elan Hasson
2 weeks ago

The joys of #golang error "handling"

fix: handle error when listing machines by ctrox ยท Pull Request #6298 ยท #kubernetes/autoscaler https://github.com/kubernetes/autoscaler/pull/6298/files

I built a code generator to convert sqleton YAML commands into #golang code using https://github.com/dave/jennifer and it's interesting. I think I like it over go templates, but it's pretty hard to read, at least at the raw level I'm using it at right now.

I'm also unsure of where the *real* value I can squeeze out of this lies. It's already nice to have a minimal attack surface (loading YAMLs from embed.FS worked, but this allows me to be a bit more readable at least for input flags).

Go Devroom @ FOSDEM
2 weeks ago

We cannot promise it wonโ€™t rain at FOSDEMโ€ฆ
But is a very good hot chocolate and many Gophers can convince you to submit a talk all the better!!

Psst 10 days left: https://github.com/go-devroom/cfp/blob/main/README.md #golang #fosdem

Gopher standing next to gopher mug with plant based hot chocolate behind a rainy window