100 Commits
Author SHA1 Message Date
vinchent 3923758807 blogposts: add some comments 2024-09-24 22:18:01 +02:00
vinchent 3cdca7cc94 blogposts: handle file type 2024-09-24 22:13:33 +02:00
vinchent e8b8166ae9 blogposts: finish up 2024-09-24 21:58:06 +02:00
vinchent 48df8ace6e blogposts: read body 2024-09-24 21:51:09 +02:00
vinchent 8228bcdce3 blogposts: read tags 2024-09-24 21:38:21 +02:00
vinchent a33d490896 blogposts: read metadata 2024-09-24 21:26:42 +02:00
vinchent 00596a7c52 blogposts: create new file for post and a helper func 2024-09-24 21:10:16 +02:00
vinchent 1153a0a5bd blogposts: use io.Reader interface to decouple 2024-09-24 21:06:57 +02:00
vinchent dec5f045a7 blogposts: refactor, create newPost func 2024-09-24 21:03:33 +02:00
vinchent 6292463e90 blogposts: test get blog content 2024-09-24 20:57:28 +02:00
vinchent 048e6cccac blogposts: add the first test 2024-09-23 23:09:10 +02:00
vinchent ef646bf98e clockface: refactor magic numbers 2024-09-23 22:40:35 +02:00
vinchent 6837cd9fc1 clockface: add hours 2024-09-23 22:35:02 +02:00
vinchent c6ef156d88 clockface: refactor 2024-09-23 22:18:46 +02:00
vinchent a4531bde4c clockface: add minute hand tests 2024-09-23 22:16:06 +02:00
vinchent 5a62fef4f3 clockface: add minute hand 2024-09-23 22:09:10 +02:00
vinchent b58e2436cd clockface: refactorize acceptance test 2024-09-23 18:01:35 +02:00
vinchent 7b3fb0f91c clockface: xml 2024-09-23 17:24:40 +02:00
vinchent 423c9e9567 clockface: add main func 2024-09-23 16:57:24 +02:00
vinchent c9c9b9bf7b clockface: part1 2024-09-23 16:49:29 +02:00
vinchent 8629b537b0 roman: check number range 2024-09-22 22:00:50 +02:00
vinchent abc546178d roman: fix the number range 2024-09-22 21:51:40 +02:00
vinchent 650ec27ec9 roman: add property based test with quick.check 2024-09-22 21:47:11 +02:00
vinchent 52825e49b3 ***roman: add convert to arabic, the real one 2024-09-22 21:36:03 +02:00
vinchent 715ea6477a roman: add convert to arabic 2024-09-22 21:28:24 +02:00
vinchent 6da23dc641 roman: add more roman letters and test 2024-09-22 21:24:24 +02:00
vinchent 7d751cab3d ***roman: refactor in the OOP way 2024-09-22 21:12:56 +02:00
vinchent b37f8a8d4c roman: add more tests 2024-09-22 21:09:51 +02:00
vinchent 6f853c25d0 roman: add 9 and 10 2024-09-22 21:07:05 +02:00
vinchent 0a75d86850 roman: add 5 and refactor 2024-09-22 21:02:27 +02:00
vinchent 2515644d4f roman: refactor to use string building pattern 2024-09-22 20:59:11 +02:00
vinchent 3a0808c599 roman: add 4 2024-09-22 20:57:12 +02:00
vinchent accb2c51dc roman: use stringBuild for better performance(?) 2024-09-22 20:54:22 +02:00
vinchent 5f93a0b843 roman: get start with the roman numerals 2024-09-22 20:53:13 +02:00
vinchent 7a32f26bd5 context: implement a spy response writer to check if anything is written 2024-09-21 20:46:07 +02:00
vinchent c5582275e7 context: realistic usage of context.
Use a go routine for the work logic. Here sleep and append to string.
Inside the go routine, select for ctx.Done(). If happens, just stop and
return.

In the outside function, select for ctx.Done() too. If it happens, that
means the work logic has not finished before canceled.
2024-09-21 20:35:43 +02:00
vinchent c0db9ab22b context: refactorize assert functions 2024-09-21 20:26:22 +02:00
vinchent 0b181ccf0f context: setup timeout context 2024-09-21 20:20:15 +02:00
vinchent d49f952035 context: add basic context test 2024-09-21 20:07:09 +02:00
vinchent 436bcad0e1 counter: Use a constructor 2024-09-21 19:48:58 +02:00
vinchent 6ded953ec6 counter: fix mutex copy issue 2024-09-21 19:47:27 +02:00
vinchent 572c8033f6 counter: handle racing situation with mutex 2024-09-21 19:43:09 +02:00
vinchent ea6f225992 counter: refactor, add assertCounter func 2024-09-21 18:21:56 +02:00
vinchent 41ae820a21 counter: add baisics 2024-09-21 17:51:58 +02:00
vinchent b332088638 walk: reflect value of struct 2024-09-18 18:15:01 +02:00
vinchent 3556c5b805 racer: test with timeout 2024-09-18 13:41:55 +02:00
vinchent ee89092ea4 racer: refactor. no hard code, don't repeat 2024-09-18 13:11:42 +02:00
vinchent 3cc29f8383 racer: add timeout test 2024-09-18 13:08:31 +02:00
vinchent 2dc7275f15 racer: use select to syncrho 2024-09-18 12:58:07 +02:00
vinchent 5042f1048e racer: refactor code to not repeat 2024-09-18 12:54:47 +02:00
vinchent 3538818769 racer: test with httptest server 2024-09-18 12:45:58 +02:00
vinchent 491d2c1b22 racer: add a first racer test 2024-09-18 10:15:53 +02:00
vinchent d83f1c6f4c concurrency: use channel to handle racing situation 2024-09-18 09:48:00 +02:00
vinchent cd4f6fc6c7 concurrency: add timeout, pass the url as argument into goroutine, but still have concurrent write issue 2024-09-18 09:33:38 +02:00
vinchent cb8e6d23f3 concurrency: use goroutine(too fast) 2024-09-18 09:26:39 +02:00
vinchent 93d9a14858 concurrency: add func, test, and bm test (mock and stub) 2024-09-18 09:16:56 +02:00
vinchent 05226985c7 ***countdown: add configurableSleeper abstraction 2024-09-17 21:43:48 +02:00
vinchent 72e6ac9b77 [***]countdown: mock with sequence 2024-09-17 21:30:53 +02:00
vinchent 56be76b275 countdown: add first mock for sleep 2024-09-17 21:21:07 +02:00
vinchent d7840e9cb7 countdown: add basic countdown 2024-09-17 21:11:08 +02:00
vinchent 5f02a8fbde greet: DI 2024-09-17 16:12:39 +02:00
vinchent f573268be9 dict: add delete method 2024-09-17 11:35:22 +02:00
vinchent c04a2e1d65 dict: add update method 2024-09-17 11:31:00 +02:00
vinchent 4be80f4477 dict: deal with re-add 2024-09-17 10:19:25 +02:00
vinchent 58efd33b20 dict: add Add function and tests 2024-09-17 10:10:07 +02:00
vinchent 7e713f54de dict: refacto test for error handling 2024-09-17 09:58:41 +02:00
vinchent fc67cf14ff dict: deal with unknown keys 2024-09-17 09:55:36 +02:00
vinchent baff9ee722 dict: create a type 2024-09-11 15:22:42 +02:00
vinchent dd61fb557b dict: refact test 2024-09-11 14:07:00 +02:00
vinchent 73ab7dc92d dict: add simple search method 2024-09-11 13:48:59 +02:00
vinchent 4a497b9f93 wallet: add example 2024-09-11 11:49:10 +02:00
vinchent 82ea599aaa wallet: also assert no error 2024-09-11 11:43:34 +02:00
vinchent 20606d3ee5 wallet: improve assertError again by creating a custom error type 2024-09-11 11:35:52 +02:00
vinchent 9a2478f947 wallet: improve assertError function 2024-09-11 11:32:40 +02:00
vinchent 4be1d0d598 wallet: extract assertError helper function 2024-09-11 11:28:45 +02:00
vinchent f6b17eaff3 wallet: check withdraw border cases 2024-09-11 11:26:39 +02:00
vinchent 8ed0235074 wallet: add withdraw method 2024-09-11 11:22:12 +02:00
vinchent 36ef78fb92 wallet: implement stringer interface 2024-09-11 11:17:23 +02:00
vinchent 71bc024fe2 wallet: use self defined type Bitcoin 2024-09-11 11:15:24 +02:00
vinchent 8644bf547b wallet: add wallet struct and balance funcs 2024-09-11 11:08:53 +02:00
vinchent f5ecd40f01 shapes: make table test more readable 2024-09-11 09:23:19 +02:00
vinchent 47a831ab33 shapes: add Triangle area test 2024-09-11 09:17:21 +02:00
vinchent 595ed65745 shapes: transform to a table test 2024-09-11 09:14:28 +02:00
vinchent d708e70352 shapes: add Shape interface 2024-09-11 09:10:19 +02:00
vinchent ff89c50710 shapes: add Circle struct and Area func 2024-09-11 09:06:46 +02:00
vinchent d5d910db5a shapes: use Rectangle as receiver 2024-09-11 09:03:57 +02:00
vinchent 5de98f3ac8 shapes: create a rectangle struct 2024-09-11 08:58:04 +02:00
vinchent 9381e4c92a shapes: add rectangle perimeter and area funcs 2024-09-11 08:55:19 +02:00
vinchent 2353543f7d sum: add local test check function 2024-09-10 21:56:18 +02:00
vinchent 42aaff6c2e sum: add SumAllTails 2024-09-10 21:51:21 +02:00
vinchent 4bfd9eda4f sum: use slices.Equal 2024-09-10 21:43:55 +02:00
vinchent fac93ea9ec sum: use DeepEqual to compare 2024-09-10 21:43:19 +02:00
vinchent 29215486db sum: use variadic functions 2024-09-10 21:38:18 +02:00
vinchent e905c600f3 sum: sumAll 2024-09-10 21:34:27 +02:00
vinchent fc419ec3be sum: slice 2024-09-10 21:27:13 +02:00
vinchent b427b8fbfb sum: range 2024-09-10 21:16:01 +02:00
vinchent 5775ea5e50 sum: v1 2024-09-10 21:15:12 +02:00
vinchent fb1e5e2835 iteration: Use strings pkg and compare the bench results 2024-09-10 13:39:14 +02:00
vinchent 75304d4c23 iteration: add repeatTime as an argument 2024-09-10 13:32:46 +02:00
vinchent 2684521bdd iteration: add example for Repeat function 2024-09-10 13:30:09 +02:00