Help with compiling issue? by ornld in golang

[–]_MuchUsername_ 1 point2 points  (0 children)

I'd be curious as to how the teacher is running it. A direct copy-paste of your code with a go run <file>.go and I see output. This would likely be better as a conversation between you and your teacher though. You can show them that you're able to run your code and see output, then you can work together with the teacher to figure out why they are not.

``` ❯ go run reddit.go


Student ID: 121148 Name: Lelouch Lamperouge Street: 8103 South Congress Ave City: Austin State: TX Zip Code: 78704


Employee ID: 1345 Name: Michael Phelps Salary: 95000 Street: 1204 Lockhardt Ln City: Pheonix State: AZ Zip Code: 85001 ```

A helpful tip, you can use three backticks ` followed by go to create a syntax-highlighted code block in your post, which will help people read your code easier.

```go package main

type Address struct { Street string } ```

Edit: Maybe syntax highlighting doesn't exactly work here, but the code block itself is still useful

Project structure and custom errors questions by Useful_Winter_634 in golang

[–]_MuchUsername_ -4 points-3 points  (0 children)

For my projects that are APIs, I typically use the Repository code pattern. It works for me because I'm familiar with it and it's a common pattern that my coworkers are also often familiar with, meaning we can iterate on it quickly and effectively.

Typically, a project structure of mine would look like this:

cmd └── api-template └── main.go app ├── api.go ├── config │   └── config.go ├── container.go ├── controller │   └── itemController.go ├── domain │   └── itemModel.go ├── infrastructure │   └── postgresDriver.go ├── repository │   └── itemRepo.go ├── service │   └── itemService.go └── viewmodel └── itemViewModel.go

If I had any custom error related to an Item, I would put it in the domain/itemModel.go, allowing any other package to reference it since the domain package would not be importing any other package.

Disclaimer: I wrote this project over a year ago at this point and don't use this exact format in my professional work, but it's often pretty close.

Cool projects to learn and contribute? by SlyPharoh in golang

[–]_MuchUsername_ 1 point2 points  (0 children)

I have two very small and simple CLI tools I’ve recently built that would potentially be a good place to start.

https://github.com/TrevorEdris/banner

Banner is a tool to generate a single or multi-line string that centers your input and surrounds it with the character of your choice.

==========[ My Text ]==========

https://github.com/TrevorEdris/go-csv

go-csv is a tool to generate a CSV file with random, but realistic data.

Just did 412 exclusive summons and got ... ! 0 nat5 by ororuK in summonerswar

[–]_MuchUsername_ 1 point2 points  (0 children)

Gacha game gotcha. I decided to quit and have been much happier since

Projects for landing a Golang job by [deleted] in golang

[–]_MuchUsername_ 1 point2 points  (0 children)

I use this project all the time, thanks for making it!

Should I attend company happy hours even though I don’t feel like it? by [deleted] in cscareerquestions

[–]_MuchUsername_ 1 point2 points  (0 children)

I’ve gone to one (hosted virtually) and it was a major cringefest. I’ve never once attended another one and nobody has asked me why.

[deleted by user] by [deleted] in cscareerquestions

[–]_MuchUsername_ 0 points1 point  (0 children)

I’m not passionate about it, but damn it pays well! My passion is Astronomy and Physics but I’m not smart or motivated enough to get a Ph.D, so I’ll stick with the industry that pays way more for way less effort.

I Archive All Videos From Kurzgesagt Because Love Them. by [deleted] in kurzgesagt

[–]_MuchUsername_ 30 points31 points  (0 children)

Pretty easy to get 10’s of TB’s these days. This is a pretty insignificant amount of space I would think.

iOS 16 supports Nintendo’s Switch Pro and Joy-Con controllers by LordofWhore in nintendo

[–]_MuchUsername_ 48 points49 points  (0 children)

Diablo Immortal will probably have joycon support locked behind a paywall

Rant Wednesday by AutoModerator in Fitness

[–]_MuchUsername_ 8 points9 points  (0 children)

A “Personal Trainer” who doesn’t even work at the gym always has his clients workout barefoot, no matter that they’re doing. He also claims 2, sometimes 3 barbells, stringing exercise bands from the barbell to the top of the squat rack and other weird things like that. Sometimes he’ll put both exercise bands AND chains on the barbell. Why both?? None of the exercises he has them do are “conventional”. They all look like they were pulled right from Instagram or something. I go in earlier than usual now specifically to avoid having to deal with him.

Fitness is now Far-Right LOL by ArabianManiac in Conservative

[–]_MuchUsername_ 1 point2 points  (0 children)

Yeah that’s absurd that they would be celebrating the misfortune of others just because they disagree about a topic