File tree 2 files changed +33
-2
lines changed
2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ successfully from type variables (see below) to Go generics API.
9
9
This readme will guide you to use auto-migration scripts when ever we deprecate
10
10
functions or make something obsolete.
11
11
12
- ### Auto-Migration of v0.9.40
12
+ ### Auto-Migration of v0.9.40 & v0.9.41
13
13
14
14
The version 0.9.40 is a major update because of the performance and API change.
15
15
We have managed to eliminate ` defer ` slowdown. Our benchmarks are 3x faster than
@@ -52,7 +52,11 @@ Follow these steps:
52
52
1 . Use ` git diff ` or similar to skimming that all changes seem to be OK. Here
53
53
you have an opportunity to start use new features of ` err2 ` like logging.
54
54
1 . You are ready to commit changes.
55
-
55
+ 1 . * Problem solving tip.* Use following command to search helper functions:
56
+ ``` shell
57
+ migr-name.sh -h todo_catch
58
+ migr-name.sh -h repl_catch
59
+ ```
56
60
#### Manual Migration With a Location List
57
61
58
62
Follow these steps check do you have migration needs for v0.9.40:
Original file line number Diff line number Diff line change @@ -475,6 +475,33 @@ repl_handle_func() {
475
475
}
476
476
477
477
search_catch_multi=' (^\s*)(defer err2\.Catch\(func\(err error\) \{)([\s\S]*?)(^\s*\}\)$)'
478
+ search_catch_multi_with_panic_handler=' (^\s*)(defer err2\.Catch\(func\(err error\) \{)([\s\S]*?)(^\s*\}, func\()(\w* any\) \{)'
479
+ # '^\s*\}, func\(\w* any\) \{' 1 2 3 4 5
480
+
481
+ # --- make Catch panic easier
482
+ # '^\s*\}, func\(\w* interface\{\}\) \{'
483
+ search_catch_old_signature=' (^\s*\}, func\(\w* )(interface\{\})(\) \{)'
484
+ # 1 2 3
485
+
486
+ todo_catchold_sig () {
487
+ vlog " searching old Catch panic handler signatures"
488
+ ag " $search_catch_old_signature "
489
+ }
490
+
491
+ repl_catchold_sig () {
492
+ vlog " replacing old Catch panic handler signatures"
493
+ check_commit " $search_catch_old_signature " ' \1any\3'
494
+ }
495
+
496
+ todo_catchp_func () {
497
+ vlog " searching old error Catchers"
498
+ ag " $search_catch_multi_with_panic_handler "
499
+ }
500
+
501
+ repl_catchp_func () {
502
+ vlog " replacing old error Catchers with panic"
503
+ check_commit " $search_catch_multi_with_panic_handler " ' \1defer err2.Catch(err2.Err(func(err error) {\3\1}), func(\5'
504
+ }
478
505
479
506
todo_catch_func () {
480
507
vlog " searching old error Catchers"
You can’t perform that action at this time.
0 commit comments