1
1
submitted 1 month ago* (last edited 1 month ago) by trymeout@lemmy.world to c/golang@lemmy.ml

I made some Go scripts that require user input fmt.Scanln(&fileName) during the execution. When I use the Go debugger built into VSCode which is the launch type, it works but there is no way to enter any prompts when your exeuctable asks for a input. With other programming languages like NodeJS and PHP, there is way to run the scripts in "debugging mode" where it will run the code but before it executes the code, it will wait to attach to a debugger on your system and then execute the code. This has always allowed me to use the terminal for inputs in the executable.

For example to do this in NodeJS, you will use node --inspect-brk=0.0.0.0 main.js instead of node main.js and then run the debugger in VSCode to attach it to the executing script. Is there a way to do this with Go? Do I need to set something up to achieve this?

I am on Linux Mint and cannot find any commands to run go run . but to wait for a debugger to attach to the executable before executing.

2
-3
submitted 1 month ago by trevor@lemmy.ml to c/golang@lemmy.ml
3
9
submitted 4 months ago by sbinet@lemmy.ml to c/golang@lemmy.ml

hi there,

just a quick message to announce my latest small pet project of the week :

A simple (and incomplete) Go client for PeerTube1 (an alternative to Big Tech's video platforms).

Right now, the client can:

  • authenticate with a PeerTube server,
  • list accounts,
  • list videos for a given account,
  • upload videos for a given account,
  • remove videos for a given accounts.

There's also a simple peertube-cli command-line program to perform the things above:

$> go install git.sr.ht/~sbinet/peertube/cmd/peertube-cli
$> peertube-cli help
peertube-cli - runs peertube-cli commands and sub-commands

Commands:

    auth-add     authenticate with a PeerTube server
    auth-ls      list the known PeerTube servers
    auth-rm      remove a PeerTube login
    video-ls     list video(s) from a PeerTube server
    video-upload upload a video to a PeerTube server

Use "peertube-cli help <command>" for more information about a command.

It's not much, but it allowed me to ease the day-to-day work of uploading audio files for a podcast I am maintaining and authoring.

hth, -s

4
8
submitted 5 months ago by testeronious@lemmy.world to c/golang@lemmy.ml
5
2
submitted 5 months ago by testeronious@lemmy.world to c/golang@lemmy.ml
6
9
submitted 5 months ago by mo_ztt@lemmy.world to c/golang@lemmy.ml

So, I need to monitor a fairly large nested directory tree for changes on Linux. It seems like there are a few different watcher modules that I could use -- fsnotify and notify being the main ones, both of which use the inotify interface and attempt to set watches on each individual subdirectory and maintain all their watchers as things change. I have way too many directories for that to be a workable approach. It looks like the underlying issue is just that this is a difficult problem on Linux; both inotify and fanotify have some issues which make them difficult for library authors to use to present a clean and useful API.

Long story short - I coded up an fanotify-based solution which seems like a good start of what I need, and I'm planning on sharing it back in the hopes that it's useful. I guess my question is, did I miss something? Is there already an easy and straightforward way to monitor a big directory for changes?

7
7
submitted 5 months ago by JustJack23@slrpnk.net to c/golang@lemmy.ml
8
18
submitted 5 months ago by whou@lemmy.ml to c/golang@lemmy.ml

An excellent standard library and packaging system, first-class concurrency support and a focus on readability are among the traits that keep Golang devs happy.

Though this was from some time ago, I'd like to share it here and have a light discussion. Rob did an awesome talk, and I agree with him at almost every point.

I do hardly disagree with him on the gopher license attribution. I do heavily attribute gopher's image to Renee French, but I'm not the creator, so whatever.

9
7
submitted 6 months ago by whou@lemmy.ml to c/golang@lemmy.ml
10
0
submitted 6 months ago by trevor@lemmy.ml to c/golang@lemmy.ml

Arctic Warfare is now available to play. Battle tanks in the arctic, demolish trees and annihilate snowmen. View the source code here.

11
2
submitted 7 months ago by trevor@lemmy.ml to c/golang@lemmy.ml

etk is a library for the Ebitengine game engine that simplifies creating graphical user interfaces. The README lists the features and widgets. Boxcars uses etk to greatly simplify UI development, as its single codebase targets web, desktop and Android.

12
5
submitted 7 months ago by sbinet@lemmy.ml to c/golang@lemmy.ml

Here is the full playlist from the GopherConAU 2023 conference:

13
1
submitted 7 months ago by trevor@lemmy.ml to c/golang@lemmy.ml
14
2
submitted 8 months ago by bizdelnick@lemmy.ml to c/golang@lemmy.ml
15
3
submitted 8 months ago by bizdelnick@lemmy.ml to c/golang@lemmy.ml
16
0
submitted 8 months ago by trevor@lemmy.ml to c/golang@lemmy.ml

tabula is a backgammon engine I recently created.

The engine builds on principles described by the author of the Motif engine here: https://bkgm.com/motif/engine.html

You can play against the engine right now at https://bgammon.org

17
19
submitted 8 months ago by gritlock@lemmy.ml to c/golang@lemmy.ml

After a while of absence, I'm getting back into Go programming and I was wondering: What's new in terms of quality control tooling? What are you running on your CI/CD ? Any suggestions?

18
7
submitted 8 months ago by khoi@slrpnk.net to c/golang@lemmy.ml
19
1
submitted 10 months ago by trevor@lemmy.ml to c/golang@lemmy.ml

bgammon.org is a free online multiplayer backgammon service without any ads.

Source code: https://code.rocket9labs.com/tslocum/bgammon

Screenshot

20
6
(lemmy.ml)
submitted 10 months ago* (last edited 7 months ago) by velox_vulnus@lemmy.ml to c/golang@lemmy.ml

I'm looking for a good resource to learn back-end development in Go, preferably from a micro-framework. Not just CRUD, but also stuff like caching, security and scalability. Are there any good resources out there?

21
10
submitted 11 months ago by whou@lemmy.ml to c/golang@lemmy.ml
22
4
submitted 11 months ago by whou@lemmy.ml to c/golang@lemmy.ml

Go 1.21 adds a new port targeting the WASI preview 1 syscall API through the new GOOS value wasip1. This port builds on the existing WebAssembly port introduced in Go 1.11.

23
19
Writing an OS in Go: The Bootloader (totallygamerjet.hashnode.dev)
submitted 11 months ago by whou@lemmy.ml to c/golang@lemmy.ml

How you could write an operating system with pure Go code (including no CGO!)

24
10
submitted 11 months ago by trevor@lemmy.ml to c/golang@lemmy.ml

Also available via SSH:

ssh playnetris.com

Source code:

https://code.rocket9labs.com/tslocum/netris

25
11
submitted 1 year ago by whou@lemmy.ml to c/golang@lemmy.ml
view more: next ›

Go programming language discussion

1276 readers
1 users here now

founded 5 years ago
MODERATORS