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
Muyao CHEN
a0bad4d6e9
walk: handle functions...
2024-09-20 21:04:25 +02:00
Muyao CHEN
ab7818e9ea
walk: handle channels
2024-09-20 21:00:47 +02:00
Muyao CHEN
574532f484
walk: handle map test separately
2024-09-20 20:51:44 +02:00
Muyao CHEN
10a93aeb27
walk: rerefacto
2024-09-20 20:44:40 +02:00
Muyao CHEN
61a0d0ff03
walk: deal with maps
2024-09-20 20:41:50 +02:00
Muyao CHEN
f64d75ca45
walk: deal with array
2024-09-20 20:37:54 +02:00
Muyao CHEN
799d730d14
walk: refacto slice and struct
2024-09-20 20:36:24 +02:00
Muyao CHEN
1c3ad9b9d8
walk: refacto
2024-09-20 20:32:37 +02:00
Muyao CHEN
049c346e63
walk: deal with slices
2024-09-20 20:27:53 +02:00
Muyao CHEN
80959f822b
waik: work with pointer
2024-09-20 20:19:49 +02:00
Muyao CHEN
30a408c9e4
walk: recursively search for string
2024-09-20 20:15:59 +02:00
Muyao CHEN
8026475424
walk: check if the field is of string type
2024-09-20 20:05:32 +02:00
Muyao CHEN
122770ae5c
walk: loop on the string fields
2024-09-20 20:00:05 +02:00
Muyao CHEN
766d7449e8
walk: refactor test to table test
2024-09-20 19:56:28 +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