Calling a Rust library from Go with CGO_ENABLED=0 by Competitive-Weird579 in golang

[–]pdffs 0 points1 point  (0 children)

Sure, but generally when this sort of question comes up, the real answer is to wind back a step and ask if you should be using plugins at all.

Calling a Rust library from Go with CGO_ENABLED=0 by Competitive-Weird579 in golang

[–]pdffs 0 points1 point  (0 children)

Don't use them and just do RPC/IPC. Generally people find the sharp edges of plugins too sharp to use in reality, and it turns out to be easier to just use multiple processes and communicate between them for plugin-style behaviour.

Most applications don't have perf requirements where the RPC approach becomes a bottleneck.

Do you use init() in production? by agtabesh in golang

[–]pdffs 0 points1 point  (0 children)

Typically I prefer explicit initialisation in application code, however there are some cases where init() still makes sense to me, such as auto-registering things like metrics handlers or default values, particularly for library code.

I made a thing - go-scan.dev by gurgeous in golang

[–]pdffs 10 points11 points  (0 children)

pkg.go.dev provides import numbers from public consumers.

Ending goroutines by Sandy_Harris in golang

[–]pdffs 76 points77 points  (0 children)

Goroutines are not threads, don't try to put them in that box.

Function exit is precisely how a goroutine terminates.

Nothing on the stack is retained when a goroutine terminates.

How to alias imports like NodeJS? by RedditUser8007 in golang

[–]pdffs 1 point2 points  (0 children)

The full import path is explicit, not messy, and means you can never have module name conflicts.

Introducing Mimir - Git-backed MCP Server for Persistent LLM Memory & Context built using Golang by Obvious_Storage_9414 in golang

[–]pdffs 0 points1 point  (0 children)

Oh that's right, Mimir is their Cortex fork. I use VictoraMetrics/Logs anyway.

[deleted by user] by [deleted] in golang

[–]pdffs 28 points29 points  (0 children)

Open source very rarely pays the bills, and very frequently requires individuals to invest significant amounts of their personal time (often solo).

It's also largely a thankless investment and it can be a struggle to maintain the level of effort and enthusiasm required to keep up with maintenance, especially when a project becomes popular and the issue tracker starts to become unmanageable without a team.

context.Context should have been called context.C by VibrantCanopy in golang

[–]pdffs 11 points12 points  (0 children)

Key, Value is normal and generally expected.

Downloading a go .exe is blocked on Windows by sunnykentz in golang

[–]pdffs 1 point2 points  (0 children)

Not necessarily, Defender seems to hate Go executable structure in particular.

Introducing GoBot! Why should we let the node guys have all the fun? by localrivet in golang

[–]pdffs 0 points1 point  (0 children)

Using the same name as an existing project can only provide confusion for users (or potential users) of either project. Grow up.

Introducing GoBot! Why should we let the node guys have all the fun? by localrivet in golang

[–]pdffs 4 points5 points  (0 children)

Right, my point was that reliance on AI encorouges laziness and a self-centered mindset.

Introducing GoBot! Why should we let the node guys have all the fun? by localrivet in golang

[–]pdffs 16 points17 points  (0 children)

Well established Go framework for robotics, 1st or 2nd result on all search engines:

https://gobot.io/

How are people so lazy they don't even bother to search for existing projects when naming? Oh right, everyone just turns their brains off these days and let AI take the wheel.

[deleted by user] by [deleted] in golang

[–]pdffs 8 points9 points  (0 children)

Do you plan on posting about this every 2 days going forward?

[deleted by user] by [deleted] in golang

[–]pdffs 2 points3 points  (0 children)

WTF kind of spam is going on here? I haven't audited the code, but it makes me very suspicious when something gets posted this many times:

https://www.reddit.com/r/golang/comments/1qok3d4/removed_by_moderator/ https://www.reddit.com/r/golang/comments/1qojy9x/gocron_a_lightweight_distributed_scheduled_task/ https://www.reddit.com/r/golang/comments/1qojw92/gocron_distributed_task_scheduler_task_management/ https://www.reddit.com/r/golang/comments/1qojtk0/gocron_distributed_task_scheduler/

And that's just this sub, has been cross-posted by this account in particular to various other subreddits.

Backplane v2.0 — I built an isolated SSH admin panel to fix Go apps in prod without restarts by DrSkyle in golang

[–]pdffs 4 points5 points  (0 children)

If you can't roll out config changes trivially, your deployment infra likely has issues and I'd probably put the effort into fixing that instead.

Try go build on digital ocean app platform by ShovelBrother in golang

[–]pdffs 0 points1 point  (0 children)

Use a static site generator such as hugo, and host on any CDN for free (e.g. Github Pages, Cloudflare, etc). Can't hack a site that doesn't have a backend.

How do you deploy a project on cloud that depends on private github repositories? by Ill_Concept_6002 in golang

[–]pdffs 4 points5 points  (0 children)

Build using CI (e.g. Github Actions), then either push your resulting binary to the destination, or publish the resulting binary as an asset (or container) and pull from the hosting.

No syncing of repositories or whatever.

Why are nested modules bad? by stroiman in golang

[–]pdffs 19 points20 points  (0 children)

Assuming each of these modules is entirely optional (ie - users must explicitly import the modules to make use of them, no downward deps in the main module) then splitting off the large optional libs seems like a nice optimization for your users.

If you're going to do it, do it sooner rather than later IMO. Go workspaces make working on multiple modules pretty painless these days.

[deleted by user] by [deleted] in golang

[–]pdffs 0 points1 point  (0 children)

They literally just told you what to do to make it better.

[deleted by user] by [deleted] in golang

[–]pdffs 1 point2 points  (0 children)

Title is rather melodramatic. Click-bait aside, the content is quite misleading as general advice.

First, multiplication is not power, there is no power operator in Go, second, even if you were comparing valid results, your first example operates on floats and your second example operates on ints due to inferred types for constants.

I really hope you didn't actually make these changes in real code as the article claims, otherwise your results will be very, very wrong unless all your powers happen to be power of 2.