Twitter | Pretraživanje | |
Filip Wojciechowski
Project based. Impressionable. Coding (JavaScript/TypeScript, Go). Books.
96
Tweetovi
188
Pratim
29
Osobe koje vas prate
Tweetovi
Filip Wojciechowski 19 h
Odgovor korisniku/ci @murmosh @davecheney
Agree, telling a coherent story with the tests is more important that coming up with a definition of a "unit". In the case of the package in question to tell a story with the tests I also needed to refactor the implementation -- the result is much more readable code.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 3. velj
Odgovor korisniku/ci @nathj07 @henriquev i 2 ostali
Thank you! This approach makes sense to me -- I'm learning Go on my own with few people to debate on topics like this one so feedback like this is most useful.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 3. velj
Odgovor korisniku/ci @henriquev @cool_golang @davecheney
Thank you! It's already an internal (sub-)package. It makes a series of API calls to 4 endpoints, collects a bunch of interrelated raw data, processes that data and then returns the result expressed in terms of domain types.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 3. velj
Question. says the unit of testing in is a package. What about packages with one public method that does a lot of work behind the scenes. Do you test the public api of the package (effectively doing an integration test) or unit test the private helper methods?
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 3. velj
Odgovor korisniku/ci @J7mbo @cool_golang
Agreed. Also, if a given programming language has very powerful meta-programming abilities (like Haskell) this advice is difficult to implement since what qualifies as valid syntax can be fluid. Still, a good general rule, in my opinion.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 3. velj
My experience with taught me this: if your language has a popular code formatting tool - use it, and use it *with the default settings*. The benefits of a single code formatting standard trump any subjective aesthetic preference in that regard.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 29. sij
A super simple testrunner for . Just run it in the root of a Go project and it will automatically run tests for a package when one of the ".go" files in that package has been modified. Yeah, I know, no tests (yet)... 🤷
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 25. sij
Odgovor korisniku/ci @murmosh
Gatsby or Next.js. Happy to say more about each option if you're interested/have specific questions.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 20. sij
Part 2 of my series about building servers in . This post is all about dataloaders.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski proslijedio/la je tweet
✕✕✕✕✕ 5. ruj
Top Tip: the first line of every unit test should be t.Parallel(). If that doesn't work in your package, fixing it will uncover and resolve a lot of design errors.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 16. sij
This is a great post about isolating tests in :
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 16. sij
If you're comfortable with JS/React ecosystem Gatsby is arguably more powerful, especially if you need SPA-like features. For what it's worth, I love writing Go, bit my blog is in Gatsby/TypeScript.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 14. sij
Odgovor korisniku/ci @natebosscher @cool_golang
My solution is GraphQL using gqlgen on the server, database stuff using sqlc and then react+Apollo on the frontend. You can generate types automatically on the frontend from the server GraphQL schema.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 14. sij
Odgovor korisniku/ci @murmosh
Cool idea, thanks!
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 14. sij
I started using optional *Config structs in constructor functions. When config is nil the default values are used; a defined config enables customization of the instance (to pass a mocked dependency for testing, etc.). Are there other good approaches to achieve this?
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 11. sij
Odgovor korisniku/ci @kylemathews
Walter Isaacson, The Innovators. A somewhat broader scope than your question. Written with a general reader in mind, but I've enjoyed it.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 8. sij
Odgovor korisniku/ci @SudoKidTV @cool_golang
I would use Erlang/Elixir over Go for web development of not for the lack of strong typing. Go is in a class is is own, though, when it comes to cli tools, in my opinion.
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski proslijedio/la je tweet
Golang Warsaw Meetup 7. sij
Join the first 2020 Golang Warsaw meetup on 15.01. We have two talks on Go developement in the CloudNative environment, unique Golang-10th-anniversary pins for attendees, and JetBrains licenses for good questions. Looking forward to seeing you all!
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 6. sij
Odgovor korisniku/ci @NtwariJoshua @cool_golang
My recent discovery that has replaced sqlx in my projects -- maybe an idea for your next weekend? :)
Reply Retweet Označi sa "sviđa mi se"
Filip Wojciechowski 5. sij
I just published Let’s Build a Server: Part 1 in on Medium:
Reply Retweet Označi sa "sviđa mi se"