The Go Programming Language

129 readers
6 users here now

The Go programming language is an open source project to make programmers more productive.

Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.

founded 1 year ago
MODERATORS
1
 
 

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
 
 

I had an interview with the hiring manager and these were the questions he asked. His accent was quite heavy so he also typed them for me in the VC chat window. I just copied/pasted from there.

What are Go routines, and how do they differ from threads?

How does Go's garbage collector work, and how can it affect application performance?

In Go, what is the 'defer' statements, and can you give an example of when it's particularly useful?

What is the biggest technical challenge you met when use golang for software development?

How do you manage dependencies in a Go project?

Do you have any working exp for using helm chart to deploy software on k8s env?

Explain how you monitor and troubleshoot applications running in Kubernetes?

What tools or practices have you found most effective?

How have you used Kubernetes to improve the scalability and reliability of an software?

3
2
Go API server (gitlab.com)
submitted 1 year ago by [email protected] to c/golang
 
 

cross-posted from: https://programming.dev/post/5161514

A template project for creating OpenAPI document driven API servers in Go.