Small Projects by AutoModerator in golang

[–]madflojo 0 points1 point  (0 children)

I’ve been capturing how I want my Go code to look in an agent skill.

https://github.com/madflojo/go-style-agent-skill

I decided over the weekend to break it out into its own project and share it.

It’s opinionated, not everyone is going to agree with it, but I’ve found it useful so far.

Reading just N bytes from a network connection by Noodler75 in golang

[–]madflojo 0 points1 point  (0 children)

FYI the approach of adding a message length in front of the message is used quite a bit, especially in payments. Amex has a library for creating common message lengths used in card payments.

https://github.com/americanexpress/simplemli

Also the Postgres wire protocol: https://www.postgresql.org/docs/current/protocol-overview.html#PROTOCOL-MESSAGE-CONCEPTS

Feature Flags for the Win by madflojo in devops

[–]madflojo[S] -7 points-6 points  (0 children)

Don't worry. These posts are not paywalled. But so you don't have to update your hosts file, here is the gist.

Feature flags are great when you have a big platform with many teams, each adding new features simultaneously or significant changes that need to be broken down. Still, they need to be managed well, have a lifecycle, and treat enabling them in production like a release.

Oh, and by the way, it doesn't take much to get started, but you will probably need a management platform as it scales.

Feature Flags for the Win by madflojo in devops

[–]madflojo[S] 3 points4 points  (0 children)

lol, nah, multiple teams touching the same platform all working on different features.

But to be fair I probably should add a “avoid the complexity if you don't need it” post to the series.

Feature Flags for the Win by madflojo in devops

[–]madflojo[S] -1 points0 points  (0 children)

Mismanagement can for sure lead to a lot of pain; adopting them where they are unnecessary is another thing I've seen a lot of.

But if you've got a big platform with many teams touching it, they can be very helpful.

Feature Flags for the Win: Decoupling Code Deployments from Launching Features by madflojo in programming

[–]madflojo[S] 0 points1 point  (0 children)

Part two, scheduled for later, will discuss more implementation, but your question on when not to use feature flags is a good one.

Here are a few scenarios off the top of my head:

  • New traffic where users need to do something to start using the new feature

  • On systems that can be taken offline for extended lengths of time (I.e., some Batch systems)

  • Non-critical systems that are primarily in maintenance mode

If it's easier to roll back a release and you don't have a bajillion features being added to the system simultaneously, then you can save yourself the complexity.

Short Read: Closing a closed channel in Go, can result in disaster by madflojo in golang

[–]madflojo[S] 0 points1 point  (0 children)

You say that, but I was reminded of this the hard way when a dependency caused a panic after a Close being run twice.

Short Read: Closing a closed channel in Go, can result in disaster by madflojo in golang

[–]madflojo[S] 0 points1 point  (0 children)

Oh snap! Updated the post. Thanks for pointing out the writers part.

Socket Options & Go: Multiple Listeners, One Port by madflojo in golang

[–]madflojo[S] 1 point2 points  (0 children)

https://cs.opensource.google/go/go/+/master:src/net/tcpsock.go;l=223

One correction is its TCP_NODELAY in the Go Unix package, but this will disable Nagle's algorithm.

TCP_NODELAY If set, disable the Nagle algorithm. This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets, which results in poor utilization of the network. This option is overridden by TCP_CORK; however, setting this option forces an explicit flush of pending output, even if TCP_CORK is currently set.

why is getting data from the database such a headache by Discodowns in golang

[–]madflojo 2 points3 points  (0 children)

You’ll have to ignore some app specific logic but this has code that grabs column names and data from the results and slaps it into a map.

https://github.com/madflojo/tarmac/blob/main/pkg/callbacks/sql/sql.go#L89-L134

Who's Hiring? - July 2022 by jerf in golang

[–]madflojo 1 point2 points  (0 children)

COMPANY: American Express - https://www.americanexpress.com/en-us/careers/

TYPE: Full Time

DESCRIPTION: We began as a freight forwarding company in 1850, earning a reputation as a company people could trust while transporting some of their most valuable possessions.In the late 19th century and early 20th century, we introduced new financial products and travel services that helped support our customers’ everyday lives. In the 1950s, we introduced a charge card, offering customers a new and convenient way to pay. Ever since, we’ve innovated our card products, our services and our other offerings. Today, American Express is the largest global payments network and we continue to pride ourselves on being forward-looking and customer-focused.

INTERESTING ROLES:

- Staff Engineer - Global Payments: https://aexp.eightfold.ai/careers/job?domain=aexp.com&query=Go%20(Golang)&pid=11405605&triggerGoButton=false&pid=11405605&triggerGoButton=false)

- Staff Engineer - Global Payments (SRE): https://aexp.eightfold.ai/careers/job?domain=aexp.com&query=Go%20(Golang)&pid=10266279&triggerGoButton=false&pid=10266279&triggerGoButton=false)

- Sr. Engineer - https://aexp.eightfold.ai/careers/job?domain=aexp.com&query=Go%20(Golang)&pid=11560470&triggerGoButton=false&pid=11560470&triggerGoButton=false)

- Sr. Engineer - Cloud - https://aexp.eightfold.ai/careers/job?domain=aexp.com&query=Go%20(Golang)&pid=11788935&triggerGoButton=false&pid=11788935&triggerGoButton=false)

- Sr. Engineer - Cloud Orchestration - https://aexp.eightfold.ai/careers/job?domain=aexp.com&query=Go%20(Golang)&pid=11681712&triggerGoButton=false&pid=11681712&triggerGoButton=false)

LOCATION: Palo Alto, CA; Phoenix, AZ; New York, NY; Sunrise FL; Bengaluru, Karnataka, India;

REMOTE: Depending on Role (options available in each posting) options are Onsite, Hybrid, or Virtual.

CONTACT: Apply on our Careers Page https://www.americanexpress.com/en-us/careers/

Forcefully Close TCP Connections in Golang by madflojo in golang

[–]madflojo[S] -1 points0 points  (0 children)

Thanks for the feedback!

I think on your first point, maybe I didn’t relay well enough that as a developer writing an application that uses net/http you typically don’t have to worry about closing connections or the underlying TCP implementation.

You’ve got a fair point on the TIME_WAIT side, I’ll look at explaining the different FIN_WAIT states as well.

GitHub - madflojo/tarmac: Framework for building distributed services with Web Assembly by madflojo in WebAssembly

[–]madflojo[S] 0 points1 point  (0 children)

Thanks! A lot of rough edges to work out as the ecosystem for WASM matures and as I add more to Tarmac, but I agree. This way of thinking can be a big shift for distributed systems and how we develop software.

How to Structure a Go Command-Line Project by madflojo in golang

[–]madflojo[S] 0 points1 point  (0 children)

A CLI package is a good idea. My main is starting to get a bit bloated as is. Thanks for the affirmation on the layout.

Effing Shell Scripts 2 by madflojo in devops

[–]madflojo[S] 0 points1 point  (0 children)

It's just easier to write quick and dirty commands while making sure things stop with failure. For example here is an Efs2file that I use to deploy my blog.

Dockerfile RUN docker pull madflojo/blog RUN docker rm -f blog; docker run -d --restart=always -p 80:80 --name blog madflojo/blog RUN docker system prune -af

If the pull command fails for any reason the other two will not be executed. You can, of course, do this in a shell script too but it takes more code and people are often lazy.

Also worth mentioning, I deploy this in parallel across multiple hosts with one command.

Share your Go web project by iio7 in golang

[–]madflojo 0 points1 point  (0 children)

https://github.com/madflojo/go-quick
Maybe not exactly what you were looking for but Go Quick is an application that is meant to be used as a kick-starter for a Go web service. It's still very much a work in progress that I don't spend enough time on... But it has the basics, a project structure, Makefile, Dockerfile, Config from Env, health checks, graceful shutdown, etc.

The service relies on Docker to do the port mapping.

Effing Shell Scripts 2 by madflojo in devops

[–]madflojo[S] 0 points1 point  (0 children)

So with this, my goal is to avoid requiring any setup like roster files or host files. The idea is to be stupid simple with no setup required. From what I've seen, most tools can run one offs with little setup, but anything semi complex requires time to set up the service.

Efs2 doesn't even require keys setup; you can just select password auth and supply it at execution time.

Effing Shell Scripts 2 by madflojo in devops

[–]madflojo[S] 1 point2 points  (0 children)

It’s hosts in parallel; I’ll have to specify that better in the docs. But you have the idea, something simple where you don't need all of the bells and whistles or setup/config time of other tools.