err0r500 / go-realworld-clean Goto Github PK
View Code? Open in Web Editor NEWa clean architecture implementation of the realworldapp : https://github.com/gothinkster/realworld
License: MIT License
a clean architecture implementation of the realworldapp : https://github.com/gothinkster/realworld
License: MIT License
I've selected RouterHandler.SetRoutes(r *gin.Engine) for refactoring, which is a unit of 33 lines of code. Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Short Units of Code guideline rating! ๐
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. ๐
โน๏ธ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the ๐ฒ next to them. The risk profile below the candidates signals (โ ) when it's enough! ๐
Good luck and happy coding! โจ ๐ฏ
#16 10.55 /go/pkg/mod/github.com/golang/[email protected]/gps/constraint.go:103:21: cannot use sv (type *semver.Version) as type semver.Version in field value
#16 10.55 /go/pkg/mod/github.com/golang/[email protected]/gps/constraint.go:122:16: invalid type assertion: c.(semver.Version) (non-interface type *semver.Constraints on left)
#16 10.55 /go/pkg/mod/github.com/golang/[email protected]/gps/constraint.go:149:4: undefined: semver.Constraint
------
executor failed running [/bin/sh -c go get -u github.com/golang/dep/cmd/dep]: exit code: 2```
Hi, thanks for example. Can you explain pls why you put http details (router for example) to interface adapters layer(implem directory)?. From reading articles on clean architecture it seems like it should be on a frameworks & drivers layer, isn't it?
Hi,
It haven't updated this project for a long time, I think about updating this repo.
I may change the app http API at the same time (not sure anyone really cares about remaining fully compatible with the realworld app)
Any idea is welcome in the comments below ;)
go-realworld-clean/domain/user.go
Line 93 in d752ac3
func (user User) Follows(userName string) bool {
if user.FollowIDs == nil {
return false
}
sort.Strings(user.FollowIDs)
// The return value is the index to insert x if x is not present (it could be len(a)).
// what happens if `i == 0` and `user.FollowIDs[i] != userName`
i := sort.SearchStrings(user.FollowIDs, userName)
// user.FollowIDs[i] == userName will be wrong in the case above
return i < len(user.FollowIDs) && user.FollowIDs[i] == userName
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.