Go programming language discussion

1382 readers
1 users here now

founded 5 years ago
MODERATORS
1
2
3
4
1
submitted 4 months ago* (last edited 4 months 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.

5
6
 
 

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

7
8
9
 
 

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?

10
11
 
 

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.

12
13
 
 

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

14
 
 

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.

15
 
 

Here is the full playlist from the GopherConAU 2023 conference:

16
17
18
19
 
 

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

20
 
 

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?

21
22
 
 

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

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

Screenshot

23
6
(lemmy.ml)
submitted 1 year ago* (last edited 10 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?

24
25
 
 

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.

view more: next ›