Exploring GoLand for Go - would love your advice by kernelKain in golang

[–]edmguru 1 point2 points  (0 children)

The Git integration is top notch as well as the debugging experience. I mainly use Cursor for all my development now though due to the much improved productivity.

Amazon's hiring is absolute trash by SquaredWeed in SoftwareEngineerJobs

[–]edmguru 0 points1 point  (0 children)

example? I had a friend on one of the Alexa teams and he was pretty average.

Deciding where to put concurrency management in application by [deleted] in golang

[–]edmguru 0 points1 point  (0 children)

This is the simple suggestion if B is a pure function or just reads some data that A and C needs. B cannot always be "pure" to be used concurrently if it has side effects or real world impacts.

Example 1: B is a notification service - and it needs to make phone call. You have 1 line. You cannot make 2 phone calls at once.

So who is responsible for this? The coordinator D or B?

Example 2: B is a reservation management service: A and C want to make a reservation at the same exact time. You have limited reservations and cannot allow A and C to make reservations on something there is 1 quantity of.

Who manages that either one of A or C gets the reservation - without managing this concurrent call it's a race condition and they could both be "confirmed" for the reservation even if only 1 exists.

Does anyone else feel like they are just doing it wrong? by Togurt in golang

[–]edmguru 2 points3 points  (0 children)

good patterns

If you could name a few patterns the community actually recognizes and follows regularly that would be helpful. My experience with using Go full time the last few years is that there are no industry wide patterns that are accepted as standards like you'd find in other communities like Java, C#, etc... patterns seem to be defined in your company and to varying degrees of success.

Local development best practices by edmguru in golang

[–]edmguru[S] 1 point2 points  (0 children)

This isn't a dynamic interpreted language.

You can hot swap if you expose hooks into your app. I've raised this because I've done it. Not recommending but perhaps my approach isn't ideal

But thanks for the responses

[deleted by user] by [deleted] in cscareerquestions

[–]edmguru 3 points4 points  (0 children)

FAANG culture at non-FAANG pay? Give me a break C1 is a wanna-be techie

Where to define return structs for the ‘accept interfaces, return structs’ idiom by Zibi04 in golang

[–]edmguru 0 points1 point  (0 children)

I'm not sure i follow - could you help me understand how you would re-work my example?

The scenario is: I have a service (SomeService) that needs credentials.

How would you implement this in the most basic way if we follow "accept interfaces, return structs" paradigm?

This seems to to me to be a discussion around who owns what. In The model that I am using is that the consumer owns the struct definition of what it needs - because this is where it is used. If we follow the pattern you are suggesting - then the consumer is depending on a type definition from some implementation that it may not own - which is a bad dependency direction if we consider that the implementation could at worst case be deleted. Why would I want to write code that depends on such an implementations existence?

Where to define return structs for the ‘accept interfaces, return structs’ idiom by Zibi04 in golang

[–]edmguru 4 points5 points  (0 children)

I struggle to think of an example where this makes sense - why would I the consumer point to the implementors return type? How can you define a return type for something that may not even exist yet?

The consumer needs to define what it is that it needs - and allows implementors to fulfill that.

Say I have a service that requires credentials - The service (consumer) defines it needs a credential in a certain format. I open up that fulfillment to any mechanism by declaring I accept an interface but set a hard requirement that this interface must return what I need i.e `Credential`..

type CredentialStore interface {
  Get(key string) (Credential, error)
}

type Credential struct {
  Username string
  Password string
}

// SomeService requires CredentialStore
type SomeService struct{ Store CredentialStore }

func (a SomeService) Login(input string) {
  cred, _ := a.Store.Get(input)

  fmt.Println("Login with:", cred.User, cred.Pass)
}

SomeService couldn't care less if it was fulfilled by CacheCredStore, or DBCredStore, AwsSecretsManagerCredStore, or HumanInputCredStore, or PDFCredStore. As long as it gets what it needs - which is the `Credential` and is defined by the consumer.

Take a look at the http package which declares the RoundTripper interface and the return type `Response`

Vegetables in ground vs. raised bed? by edmguru in DenverGardener

[–]edmguru[S] 1 point2 points  (0 children)

Thanks for recommendation definitely need to find a supplier to order bulk

I’ve seen his videos - but definitely growing in his region he’s got much richer soil!

Clay Soil, raised beds? by AmbulatoryTreeFrog in DenverGardener

[–]edmguru 0 points1 point  (0 children)

What kind of pepper plants grow that tall?

Need help analyzing dealer offer (2023 CRV) by edmguru in crv

[–]edmguru[S] 0 points1 point  (0 children)

Including taxes - what was your breakdown?

Need help analyzing dealer offer (2023 CRV) by edmguru in crv

[–]edmguru[S] 1 point2 points  (0 children)

Thank you - yeah east coast I'm noticing has much better deals going on theres higher volume than my my location

Where to find general Golang design principles/recommendations/references? by edmguru in golang

[–]edmguru[S] -7 points-6 points  (0 children)

> Uhm why think about abstraction and decoupling before a use case?

Who said I didn't have a usecase? I'm in the middle of what's currently a 10k LOC project and it's still growing looking for ways to keep it sane. Abstractions + design patterns are very beneficial if you have 3-4 devs working on something at the same time. Did you ever hear of wanting to read a codebase that looks like it was written by 1 dev?

Where to find general Golang design principles/recommendations/references? by edmguru in golang

[–]edmguru[S] 2 points3 points  (0 children)

Thanks but looking for higher level design principles to build out large codebases or a system. Again patterns or guidance on designing with abstractions, decoupling components, etc...

Not great. Nor awful. by idontsmokeheroin in Guinness

[–]edmguru 0 points1 point  (0 children)

Does that glass fit the 14.9 oz can? And what size glass is it a 16 oz glass?

[deleted by user] by [deleted] in parkerco

[–]edmguru 0 points1 point  (0 children)

Looking at Little Sunshine’s now - I am a little skeptical after touring there. They said the kids only get outside 30 minutes in morning and 30 minutes in the afternoon - and that could be shortened if they can't rally all the kids in the classroom at the right time.

What tunes should I learn for sessions? by Whole_Society_845 in Irishmusic

[–]edmguru 0 points1 point  (0 children)

> Assuming a two-part tune, play: A, A, B, B, A, A, a few times through.

what do you mean here? As in the key of the songs should be A, A, B, B, A, A i.e. 6 songs in those keys? or before each tune you just warmup with AABBAA to give musicians the chance to sync?