Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 1 | # Feedback re Go 2 Error Handling Draft Design |
Andrew Bonventre | c0526c3 | 2018-08-28 09:55:58 -0600 | [diff] [blame] | 2 | |
Russ Cox | 96a7cda | 2019-06-19 13:17:42 -0400 | [diff] [blame] | 3 | This page is meant to collect and organize feedback and discussion |
| 4 | started with the Go 2 [error handling draft design](https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md). |
Andrew Bonventre | c0526c3 | 2018-08-28 09:55:58 -0600 | [diff] [blame] | 5 | |
| 6 | Please post feedback on your blog, Medium, GitHub Gists, mailing lists, Google Docs, etc. And then please link it here. |
| 7 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 8 | Please help categorize the rest of the uncategorized proposals at the bottom. |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 9 | |
Russ Cox | 96a7cda | 2019-06-19 13:17:42 -0400 | [diff] [blame] | 10 | **Update, June 19, 2019** – Based on this feedback we have posted a [proposal for a try builtin](https://golang.org/design/32437-try-builtin), which produced significant feedback on #32427 ([threaded view here](https://swtch.com/try.html)). |
| 11 | |
| 12 | We've disabled comments on that issue until July 1 to give people time to experiment in their own code. We would very much like to see experience reports about using the general try approach in your own code, including trial conversions with [tryhard](https://github.com/griesemer/tryhard). Thanks! |
| 13 | |
| 14 | # Experience with the [“try proposal”](https://golang.org/design/32437-try-builtin) |
| 15 | |
| 16 | Add to this list: |
| 17 | |
| 18 | - TEMPLATE: Your Name, “[Title](URL)”, Month YYYY |
| 19 | |
| 20 | * * * |
| 21 | |
Liam | 94dc4cc | 2018-09-23 17:52:29 -0700 | [diff] [blame] | 22 | # Requirements |
| 23 | |
| 24 | Discussions of the requirements for a new error handling method. |
| 25 | |
Liam | 64210d1 | 2018-12-13 00:23:48 -0800 | [diff] [blame] | 26 | - Warren Stephens, "[Go 2 `handle` should provide line number, source filename, version](https://github.com/warrenstephens/Go2ErrorHandlingFeedback)", December 2018 |
| 27 | |
Liam | 94dc4cc | 2018-09-23 17:52:29 -0700 | [diff] [blame] | 28 | - Liam Breck, “[Requirements to Consider for Go 2 Error Handling](https://gist.github.com/networkimprov/961c9caa2631ad3b95413f7d44a2c98a)”, September 2018 |
| 29 | |
Liam | e1fea7f | 2018-12-14 05:54:22 -0800 | [diff] [blame] | 30 | - jimmyfrasche, "[Don't special case error or nil](https://gist.github.com/jimmyfrasche/f2cd6aff16db5e46c577da44ec0cfa72)", September 2018 |
| 31 | |
| 32 | - Matt Dee "[Error Handling Should Support Custom Error Types](https://gist.github.com/mattdee123/a04f95ef5639489668cafd9c3b675a8c)", August 2018 |
| 33 | |
Liam | 94dc4cc | 2018-09-23 17:52:29 -0700 | [diff] [blame] | 34 | - Ian Lance Taylor, “[Incomplete list of criteria](https://github.com/golang/go/issues/21161#issuecomment-389380686)” from GitHub proposal discussion, May 2018 |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 35 | |
Liam | d3208ce | 2018-10-23 14:27:25 -0700 | [diff] [blame] | 36 | - Rob Pike (posted by @matjam) “[Simplicity is Complicated](https://www.youtube.com/watch?v=rFejpH_tAHM)”, December 2015 |
Liam | 4a207c8 | 2018-10-09 17:14:46 -0700 | [diff] [blame] | 37 | |
Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 38 | |
Greg Weber | ca446d7 | 2018-09-04 11:46:26 -0700 | [diff] [blame] | 39 | # In support |
| 40 | |
| 41 | This includes supporting the existing chaining/stacking of handlers without changes. |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 42 | |
Steve Manuel | 0b87ceb | 2018-10-24 20:05:55 -0600 | [diff] [blame] | 43 | - Tokyo Gophers, "[In support comments from Go 2 feedback event](https://docs.google.com/document/d/1yTDMP0E9hlJyLnKyr-6XL84RogiiwDnk0fMg9HDOKkc/edit#heading=h.f7ryl4573bu9)", October 2018 |
| 44 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 45 | - Adam Bouhenguel "[In support of more declarative error handling](https://gist.github.com/ajbouh/716f8daba40199fe4d4d702704f3dfcc)", August 2018 |
| 46 | |
| 47 | - Daniel Theophanes, "[Go 2 Design: Error Handling Net Win](https://docs.google.com/document/d/e/2PACX-1vSq487dLylRHjgtKV42EbTKHW1aHZaaso3MZ4HOG1OS-s8suOnR9WZz6ahzH4Kufs2vwKKDMhoj1_I6/pub)", August 2018 |
| 48 | |
Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 49 | ## Example code |
Greg Weber | fa0c36b | 2018-09-04 11:51:06 -0700 | [diff] [blame] | 50 | |
| 51 | Code changed to use the existing proposal. |
| 52 | |
| 53 | - Mateusz Czapliński, "[Converting a fragment of real code with error handling to Go 2 'design draft'](https://gist.github.com/akavel/62d90bdc43088574c638eb3b16301a92)", August 2018 |
| 54 | |
Liam | da33a7f | 2018-09-22 08:14:45 -0700 | [diff] [blame] | 55 | - Blake Mizerany, “[How best to account for partial writes when using check/handle?](https://gist.github.com/bmizerany/fcd0348bda96edce05a4fc7426e47751)”, August 2018 |
| 56 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 57 | # Against |
| 58 | |
Liam | 3dc1029 | 2018-09-08 14:04:29 -0700 | [diff] [blame] | 59 | Critiques without counter-proposals |
Greg Weber | ca446d7 | 2018-09-04 11:46:26 -0700 | [diff] [blame] | 60 | |
Liam | b028c88 | 2019-03-04 00:07:08 -0800 | [diff] [blame] | 61 | - Pasha Osipyants, “[Error handling mechanism using current go possibilities](https://godoc.org/github.com/pashaosipyants/errors)”, February 2019 |
| 62 | |
Liam | caa246b | 2018-11-01 11:29:43 -0700 | [diff] [blame] | 63 | - Anonymous, “[Go 2 Error Handling Non-Proposal](https://groups.google.com/d/topic/golang-nuts/1McP4_-oOpo/discussion)”, October 2018 |
| 64 | |
Liam | a333cc2 | 2018-10-20 10:28:43 -0700 | [diff] [blame] | 65 | - Stripe developers, “[Feedback on Go 2 draft designs](https://groups.google.com/d/msg/golang-nuts/3A_MpcNKg7k/DWiHBLArCAAJ)”, October 2018 |
| 66 | |
Yoshi Yamaguchi | f907df2 | 2018-10-18 11:40:45 +0900 | [diff] [blame] | 67 | - Tokyo Gophers, "[Against comments from Go 2 feedback event](https://docs.google.com/document/d/1yTDMP0E9hlJyLnKyr-6XL84RogiiwDnk0fMg9HDOKkc/edit#heading=h.fy8rnze9tll5)", Oct 2018 |
| 68 | |
Liam | 3dc1029 | 2018-09-08 14:04:29 -0700 | [diff] [blame] | 69 | - Liam Breck, “[Golang, How dare you handle my checks!](https://medium.com/@mnmnotmail/golang-how-dare-you-handle-my-checks-d5485f991289)”, September 2018 |
Greg Weber | ca446d7 | 2018-09-04 11:46:26 -0700 | [diff] [blame] | 70 | |
Nate Finch | 789f0ea | 2018-09-10 16:05:38 -0400 | [diff] [blame] | 71 | - Nate Finch, "[Handle and Check, Let's Not](https://npf.io/2018/09/check-and-handle/)", September 2018 |
| 72 | |
Liam | 9ef50db | 2018-12-13 00:04:37 -0800 | [diff] [blame] | 73 | - Jozef Slezak, "[Use semicolons instead of new keywords: check+handle](https://gist.github.com/jozef-slezak/93a7d9d3d18d3fce3f8c3990c031f8d0)", September 2018 |
| 74 | |
Andrew W. Phillips | b84ccd4 | 2018-09-13 20:21:24 +1000 | [diff] [blame] | 75 | - Shannon Wynter "[Error Handling as it can already be done](https://gist.github.com/freman/0b372e46c72f6a27652538b9930ee851)", August 2018 |
| 76 | |
Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 77 | |
Liam | da60643 | 2019-01-28 11:29:30 -0800 | [diff] [blame] | 78 | # Recurring themes |
| 79 | |
| 80 | Concepts that appear repeatedly among the suggestions below. |
| 81 | |
| 82 | - Invoke handler via assignment, e.g. `v, ? := f()` |
| 83 | references: |
| 84 | [1](https://gist.github.com/oktalz/f04f36a3c2f61af22c7a6e06095d18eb), |
| 85 | [2](https://gist.github.com/pborman/c69e79690d86dfc5c371f096be22930c), |
Liam | 86381e6 | 2019-04-19 09:53:40 -0700 | [diff] [blame] | 86 | [3](http://blog.oldcloudguy.com/2019/04/18/error-handling-in-go-2-draft/), |
| 87 | [4](https://github.com/rockmenjack/go-2-proposals/blob/master/error_handling.md), |
| 88 | [5](https://gist.github.com/the-gigi/3c1acfc521d7991309eec140f40ccc2b), |
| 89 | [6](https://gist.github.com/8lall0/cb43e1fa4aae42bc709b138bda02284e), |
| 90 | [7](https://gist.github.com/dpremus/3b141157e7e47418ca6ccb1fc0210fc7), |
| 91 | [8](https://gist.github.com/bserdar/4c728f85ca30de25a433e84ad5a065a1), |
| 92 | [9](https://gist.github.com/mcluseau/1c20c3973fa3acb544d0505637be8d67), |
| 93 | [10](https://didenko.github.io/grab/grab_worth_it_0.1.1.html), |
| 94 | [11](https://github.com/gooid/gonotes/blob/master/inline_style_error_handle.md), |
| 95 | [12](https://gist.github.com/Kiura/4826db047e22b7720d378ac9ac642027), |
| 96 | [13](https://github.com/golang/go/issues/27519) |
Liam | da60643 | 2019-01-28 11:29:30 -0800 | [diff] [blame] | 97 | |
Liam | 8e0bfa1 | 2019-06-10 16:25:38 -0700 | [diff] [blame] | 98 | - Invoke one of several handlers by name, e.g. `v := check f() ? name` |
Liam | da60643 | 2019-01-28 11:29:30 -0800 | [diff] [blame] | 99 | references: |
| 100 | [1](https://didenko.github.io/grab/grab_worth_it_0.1.1.html), |
| 101 | [2](https://gist.github.com/forstmeier/b6c6a6d2f6f2f72a81a076322959c959), |
| 102 | [3](https://gist.github.com/mcluseau/1c20c3973fa3acb544d0505637be8d67), |
| 103 | [4](https://gist.github.com/the-gigi/3c1acfc521d7991309eec140f40ccc2b), |
| 104 | [5](https://gist.github.com/PeterRK/4f59579c1162cdbc28086f6b5f7b4fa2), |
| 105 | [6](https://gist.github.com/marlonche/4e5d4e5aec0555958ec1f181991325f6), |
| 106 | [7](https://github.com/alnkapa/Go2ErrorHandlingFeedback/blob/master/README.md), |
| 107 | [8](https://medium.com/@phlatphrog/handling-more-than-just-errors-in-go-f97c5aa2eac4), |
| 108 | [9](https://gist.github.com/gregwebs/02479eeef8082cd199d9e6461cd1dab3), |
| 109 | [10](https://github.com/gooid/gonotes/blob/master/inline_style_error_handle.md), |
| 110 | [11](https://gist.github.com/spakin/86ea86ca48aefc78b672636914f4fc23), |
| 111 | [12](https://gist.github.com/morikuni/bbe4b2b0384507b42e6a79d4eca5fc61), |
| 112 | [13](http://devmethodologies.blogspot.com/2018/10/go-error-handling-using-closures.html), |
| 113 | [14](https://gist.github.com/bserdar/4c728f85ca30de25a433e84ad5a065a1), |
| 114 | [15](https://medium.com/@marode/the-return-of-the-return-278b8ae261ab), |
| 115 | [16](https://gist.github.com/dpremus/3b141157e7e47418ca6ccb1fc0210fc7), |
| 116 | [17](https://github.com/golang/go/issues/27519) |
| 117 | |
| 118 | |
Liam | f5c3dc2 | 2018-12-13 13:38:21 -0800 | [diff] [blame] | 119 | # Modest revisions |
Liam | 1446120 | 2018-12-12 12:51:19 -0800 | [diff] [blame] | 120 | |
Liam | 86381e6 | 2019-04-19 09:53:40 -0700 | [diff] [blame] | 121 | - Dave Arnold, "[Move special check keyword to left-hand side of assignment](http://blog.oldcloudguy.com/2019/04/18/error-handling-in-go-2-draft/)", April 2019 |
| 122 | |
rockmenjack | 9a84135 | 2018-12-28 15:57:28 +0800 | [diff] [blame] | 123 | - Rockmen, "[Add handle and ? as syntax sugar maybe](https://github.com/rockmenjack/go-2-proposals/blob/master/error_handling.md)", December 2018 |
| 124 | |
Liam | b5c807d | 2018-12-12 13:05:47 -0800 | [diff] [blame] | 125 | - Steve Manuel, "[Go 2 `handle` statement to optionally use a type switch](https://github.com/golang/go/issues/28344)", October 2018 |
| 126 | |
| 127 | - Zlatko Bratkovic, "[In support with tiny change](https://gist.github.com/oktalz/f04f36a3c2f61af22c7a6e06095d18eb)", October 2018 |
| 128 | |
| 129 | - DeedleFake, "[Possible Solution to `check` Awkwardness with Chained Method Calls](https://gist.github.com/DeedleFake/5e8e9e39203dff4839793981f79123aa)", September 2018 |
| 130 | |
Liam | 59d5606 | 2018-12-13 12:47:36 -0800 | [diff] [blame] | 131 | - Yesuu Zhang, "[Pass the check and handle parameters, custom handle](https://github.com/yesuu/go-proposal/blob/master/go2errorhanding.md)", September 2018 |
| 132 | |
Liam | 6040a1b | 2018-12-17 01:42:50 -0800 | [diff] [blame] | 133 | - Viktor Kojouharov, "[Reducing the special casing around the new error design draft](https://gist.github.com/urandom/6519990ef9eb7547e888a5f2da7f1a93)", September 2018 |
| 134 | |
Liam | 48cde83 | 2018-12-17 01:56:49 -0800 | [diff] [blame] | 135 | - Aleksei Pavliukov, “[Use a function as a handle parameter](https://github.com/a5i/go-proposal/blob/master/use%20a%20function%20as%20a%20handle%20parameter.md)”, September 2018 |
| 136 | |
Liam | 573e3c1 | 2018-12-28 13:15:15 -0800 | [diff] [blame] | 137 | - Savino Pio Liguori, "[Feedback for Go2 error handling design](https://gist.github.com/8lall0/cb43e1fa4aae42bc709b138bda02284e)", August 2018 |
| 138 | |
Liam | b34ba0b | 2018-12-28 13:57:09 -0800 | [diff] [blame] | 139 | - Jeffrey Koehler, "[In support of Handle Chaining; On Check](https://gist.github.com/deef0000dragon1/eb224ce4918d4ec3bdbaedf83a32aeb1)", August 2018 |
| 140 | |
Liam | cd0cb8c | 2018-12-24 18:38:49 -0800 | [diff] [blame] | 141 | - Garrus, "[Another style of syntactic sugar on error handling](https://gist.github.com/garrus/5b1f73a7640726c92273700eabed9056)", August 2018 |
| 142 | |
Liam | 274a4ca | 2018-12-12 15:44:59 -0800 | [diff] [blame] | 143 | - Paul Borman, "[Arguments against the Go 2 error handling proposal](https://gist.github.com/pborman/c69e79690d86dfc5c371f096be22930c)", August 2018 |
| 144 | |
Liam | ad74be7 | 2019-05-31 10:32:09 -0700 | [diff] [blame] | 145 | - krhubert, "[Error default handler for tests](https://golang.org/issue/32361)", May 2019 |
Ian Lance Taylor | 9803d03 | 2019-05-31 09:57:50 -0700 | [diff] [blame] | 146 | |
Liam | f5c3dc2 | 2018-12-13 13:38:21 -0800 | [diff] [blame] | 147 | ## Remove handler chaining |
Liam | 267ace3 | 2018-12-13 00:33:04 -0800 | [diff] [blame] | 148 | |
Markus | bd3a5d4 | 2019-04-15 10:24:02 +0200 | [diff] [blame] | 149 | - Markus Heukelom, "[proposal: Improve error handing using `guard` and `must` keywords](https://github.com/golang/go/issues/31442)", April 2019 |
| 150 | |
Liam | 267ace3 | 2018-12-13 00:33:04 -0800 | [diff] [blame] | 151 | - Alessandro Arzilli, “[Against check as an operator and handler chains](https://gist.github.com/aarzilli/1a85db632edecc8159505e2c785882ed)”, August 2018 |
| 152 | |
| 153 | - Simon Howard, “[Go 2 errors response: One Handler Per Function](https://gist.github.com/fragglet/df6c5471771d87b2ad597d2efc57cb3e)”, August 2018 |
| 154 | |
| 155 | - Eli Bendersky, "[Thoughts on the Go 2 Error Handling proposal](https://gist.github.com/eliben/d0c872054864bfc1110ec761c3c53c47)", September 2018 |
| 156 | |
| 157 | - Yoshiki Shibukawa, "[Every handles should have return statement](https://gist.github.com/shibukawa/42a9dee400c2f8577b4a763bcb1a5e5f)", September 2018 |
| 158 | |
| 159 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 160 | # Counter-proposals |
| 161 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 162 | ## Error handling with normal functions |
morikuni | 2b3ff32 | 2018-09-29 13:18:59 +0900 | [diff] [blame] | 163 | |
Andrew W. Phillips | 2316750 | 2018-10-02 16:10:42 +1000 | [diff] [blame] | 164 | - Andrew Phillips, “[Use closures rather than handlers](http://devmethodologies.blogspot.com/2018/10/go-error-handling-using-closures.html)”, October 2018 |
| 165 | |
Liam | 6040a1b | 2018-12-17 01:42:50 -0800 | [diff] [blame] | 166 | - Taihei Morikuni, "[Use functions as an error handler, Add syntactic sugar to remove duplicated if statement](https://gist.github.com/morikuni/bbe4b2b0384507b42e6a79d4eca5fc61)", September 2018 |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 167 | |
Scott Pakin | 90e7816 | 2018-09-13 10:02:23 -0600 | [diff] [blame] | 168 | - Scott Pakin, "[Go 2 error handling based on non-local returns](https://gist.github.com/spakin/86ea86ca48aefc78b672636914f4fc23)", September 2018 |
| 169 | |
Greg Weber | d5bf64d | 2018-09-10 04:57:01 -0700 | [diff] [blame] | 170 | - Greg Weber "[Error handling with functions and an error return?](https://github.com/golang/go/issues/27567)", September 2018. Originally linked [gist](https://gist.github.com/gregwebs/02479eeef8082cd199d9e6461cd1dab3). |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 171 | |
| 172 | - Gigi Sayfan, “[Go 2 error handling feedback + alternative solution](https://gist.github.com/the-gigi/3c1acfc521d7991309eec140f40ccc2b)", September 2018 |
| 173 | |
阮坤良 | 354a4d2 | 2018-09-05 17:43:42 +0800 | [diff] [blame] | 174 | - Ruan Kunliang, "[Simple Error Handling for Go 2](https://gist.github.com/PeterRK/4f59579c1162cdbc28086f6b5f7b4fa2)", August 2018 |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 175 | |
Martin Rode | 87ecab5 | 2018-11-30 18:08:55 +0100 | [diff] [blame] | 176 | - Martin Rode, "[The return of the return, Error Handling for Go 2](https://medium.com/@marode/the-return-of-the-return-278b8ae261ab)", November 2018 |
Martin Rode | 72192a4 | 2018-11-30 18:08:12 +0100 | [diff] [blame] | 177 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 178 | ## Labeled error handlers |
| 179 | |
Liam | 4cc437a | 2018-12-03 21:46:43 -0800 | [diff] [blame] | 180 | - Danijel Premus, "[Use existing go labels](https://gist.github.com/dpremus/3b141157e7e47418ca6ccb1fc0210fc7)", December 2018 |
| 181 | |
Burak Serdar | 17c165f | 2018-10-22 12:53:06 -0600 | [diff] [blame] | 182 | - Burak Serdar, "[Handler for err declares both err and errHandler, less intrusive labeled error handling](https://gist.github.com/bserdar/4c728f85ca30de25a433e84ad5a065a1)", October 2018 |
| 183 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 184 | - John Forstmeier, "[Labeled error handling](https://gist.github.com/forstmeier/b6c6a6d2f6f2f72a81a076322959c959)", September 2018 |
| 185 | |
| 186 | - Mikaël Cluseau, "[Multiple handlers, unambiguous on which return value is used](https://gist.github.com/mcluseau/1c20c3973fa3acb544d0505637be8d67)", September 2018 |
| 187 | |
Liam | d1efaf8 | 2018-12-21 22:27:06 -0800 | [diff] [blame] | 188 | - Kiura Magomadov, “[Addition to Go2 draft error handling](https://gist.github.com/Kiura/4826db047e22b7720d378ac9ac642027)", September 2018 |
| 189 | |
Liam | 9296948 | 2018-09-08 14:12:14 -0700 | [diff] [blame] | 190 | - Liam Breck, “[The `#id/catch` Error Model](https://github.com/golang/go/issues/27519)”, September 2018 |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 191 | |
Liam | 4fb43ce | 2018-12-24 22:16:44 -0800 | [diff] [blame] | 192 | - Marlon Che, "[How about separating check and handle?](https://gist.github.com/marlonche/4e5d4e5aec0555958ec1f181991325f6)", August 2018 |
| 193 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 194 | ## Inlining |
| 195 | |
Liam | 1af3668 | 2018-12-13 00:50:41 -0800 | [diff] [blame] | 196 | - Patrick Kelly, "[handling more than just errors in go](https://medium.com/@phlatphrog/handling-more-than-just-errors-in-go-f97c5aa2eac4)", August 2018 |
| 197 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 198 | - Vlad Didenko, “[Error Handling with `grab | name()`](https://didenko.github.io/grab/grab_worth_it_0.1.1.html)”, November 2017 |
| 199 | |
Greg Weber | 5e3dea2 | 2018-09-04 11:38:31 -0700 | [diff] [blame] | 200 | - Gooid, “[Inline style error handle(simple unambiguous)](https://github.com/gooid/gonotes/blob/master/inline_style_error_handle.md)”, August 2018 |
| 201 | |
Greg Weber | 5e3dea2 | 2018-09-04 11:38:31 -0700 | [diff] [blame] | 202 | ## Use defer |
| 203 | |
| 204 | - Victoria Raymond, “[Force 'check' to return error instead of allowing customized logic](https://gist.github.com/VictoriaRaymond/d70663a6ec6cdc59816b8806dccf7826)”, August 2018 |
| 205 | |
| 206 | - Night-walker and daokoder, "[Extend and repurpose defer instead of introducing new syntax](https://github.com/daokoder/dao/issues/191#issuecomment-44784919 )", June 2014 |
| 207 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 208 | ## try/catch/finally syntax |
| 209 | |
Mathieu Devos | da32d7a | 2019-06-27 12:37:40 +0300 | [diff] [blame] | 210 | - Mathieu Devos, "[Go2 Error Handling Proposal: Scoped Check/Handle](https://gist.github.com/mathieudevos/2bdae70596aca711e50d1f2ff6d7b7cb)", August 2018 |
| 211 | |
Liam | c272bba | 2018-12-10 22:25:39 -0800 | [diff] [blame] | 212 | - Rust RFC, “[Trait-Based Exception Handling (wherein `catch` is akin to `try`)](https://github.com/rust-lang/rfcs/blob/master/text/0243-trait-based-exception-handling.md)”, February 2016 |
| 213 | |
Liam | da33a7f | 2018-09-22 08:14:45 -0700 | [diff] [blame] | 214 | - ZhiFeng Hu, "[[Go2ErrorHandling] Go should support Exception handler](https://www.netroby.com/view/3910)", August 2018 |
| 215 | |
Greg Weber | 003ae11 | 2018-09-04 11:44:23 -0700 | [diff] [blame] | 216 | - Jan Semmelink, “[if-else-undo-done](https://gist.github.com/jansemmelink/235228a0fb56d0eeba8085ab5f8178f3)”, August 2018 |
Greg Weber | 5e3dea2 | 2018-09-04 11:38:31 -0700 | [diff] [blame] | 217 | |
Vladimir | 9935ba0 | 2018-09-30 21:35:42 +0300 | [diff] [blame] | 218 | - Vladimir Utoplov, "[Handling throws/throw idiom](https://gist.github.com/trashgenerator/d58e05522d2f83709e1a601564b68fee)", September 2018 |
| 219 | |
Gokan EKINCI | 3c86584 | 2018-12-06 17:15:08 +0100 | [diff] [blame] | 220 | - Gokan EKINCI, "[try-with-resources](https://gist.github.com/eau-de-la-seine/9e2e74d6369aef4a76aa50976e34de6d)", December 2018 |
Gokan EKINCI | 4380d4c | 2018-12-06 16:04:43 +0100 | [diff] [blame] | 221 | |
Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 222 | ## Other possibilities |
Andrew Bonventre | c0526c3 | 2018-08-28 09:55:58 -0600 | [diff] [blame] | 223 | |
Alex Hornbake | b73661d | 2019-06-10 08:57:15 -0400 | [diff] [blame] | 224 | - Alex Hornbake, "[refuse. conditional return keyword](https://gist.github.com/alexhornbake/6a4c1c6a0f2a063da6dda1bf6ec0f5f3)", June 2019 |
| 225 | |
Liam | dd03425 | 2019-03-04 00:12:58 -0800 | [diff] [blame] | 226 | - yaxinlx, "[Use ? as suffix to remove the last error value from multi-value tuples](https://gist.github.com/yaxinlx/1e013fec0e3c2469f97074dbf5d2e2c0)", March 2019 |
| 227 | |
Liam | 5f80775 | 2018-12-13 12:18:17 -0800 | [diff] [blame] | 228 | - Plamen Stoev, "[Go 2 block-level checks](https://gist.github.com/coquebg/afe44e410f883a313dc849da3e1ff34c)", November 2018 |
gima | aa5ad48 | 2018-10-10 15:00:55 +0300 | [diff] [blame] | 229 | |
Liam | f66a159 | 2018-12-13 12:26:50 -0800 | [diff] [blame] | 230 | - Peter Goetz, "[Formalize and Enforce Error Handling](https://medium.com/@peter.gtz/thinking-about-new-ways-of-error-handling-in-go-2-e56d116952f1)", September 2017 |
| 231 | |
Fedir RYKHTIK | e8f7bb7 | 2018-09-12 19:25:34 +0200 | [diff] [blame] | 232 | - Fedir RYKHTIK, "[Go 2 error handling with exclamation mark](https://gist.github.com/fedir/50158bc351b43378b829948290102470)", September 2018 |
| 233 | |
Einthusan Vigneswaran | e594fd9 | 2018-08-31 19:10:01 -0400 | [diff] [blame] | 234 | - Einthusan Vigneswaran, “[Error Aware Keywords - return, defer, if, != and forcing the error object to be the last argument](https://gist.github.com/einthusan/24e18f6359a31b3537815284cde0f6de)”, September 2018 |
Einthusan Vigneswaran | d142356 | 2018-08-31 18:54:45 -0400 | [diff] [blame] | 235 | |
Liam | 72eb83f | 2018-12-12 23:52:24 -0800 | [diff] [blame] | 236 | - Andrew Phillips, “[Improving Go Error Handling](http://devmethodologies.blogspot.com/2017/10/improving-go-error-handling.html)”, October 2017 |
| 237 | |
Liam | de0e304 | 2018-12-13 13:26:44 -0800 | [diff] [blame] | 238 | |
Liam | 5f80775 | 2018-12-13 12:18:17 -0800 | [diff] [blame] | 239 | # Uncategorized |
K. Alex Mills | d305d0a | 2018-09-02 10:30:01 -0500 | [diff] [blame] | 240 | |
Greg Weber | c240ea2 | 2018-09-04 11:17:32 -0700 | [diff] [blame] | 241 | Please help categorize the rest of the proposals here. |
K. Alex Mills | d305d0a | 2018-09-02 10:30:01 -0500 | [diff] [blame] | 242 | |
Andrew Gwozdziewycz | 5430a3d | 2019-06-09 23:00:25 -0700 | [diff] [blame] | 243 | - Andrew Gwozdziewycz, "[Check for Go Errors](http://sigusr2.net/check-for-go-errors.html)", June 2019 |
| 244 | |
DeedleFake | 73906fd | 2018-08-29 02:04:27 -0400 | [diff] [blame] | 245 | - DeedleFake, "[Feedback for Go 2 Design Drafts](https://deedlefake.com/2018/08/feedback-for-go-2-design-drafts/)", August 2018 |
Mateusz Czapliński | 91134a9 | 2018-08-29 12:36:50 +0000 | [diff] [blame] | 246 | |
Liam | 5f80775 | 2018-12-13 12:18:17 -0800 | [diff] [blame] | 247 | - Loki Verloren, “[Go 2 error handling feedback and my thoughts on how to improve programmer's efficiency and experience](https://gist.github.com/l0k1verloren/8aec03b8c48fdb5d3dab3a77153ce162)”, September 2018 |
| 248 | |
| 249 | - Gima, "[Procedural code, separate error handling](https://gitlab.com/snippets/1726097)", June 2018 |
| 250 | |
Konstantin | b834e39 | 2019-05-20 10:38:48 +0300 | [diff] [blame] | 251 | - Konstantin, "[error handling for error-tree](https://github.com/Konstantin8105/Go2ErrorTree)", [Discyssion](https://github.com/golang/go/issues/32099) May 2019 |
| 252 | |
Liam | f5c3dc2 | 2018-12-13 13:38:21 -0800 | [diff] [blame] | 253 | ## Adding your feedback |
K. Alex Mills | 2ade452 | 2018-09-02 15:28:01 -0500 | [diff] [blame] | 254 | |
| 255 | Please format all entries as below. |
| 256 | |
Liam | f4d4e2c | 2018-08-31 01:32:52 -0700 | [diff] [blame] | 257 | - _Your Name_, “[_Title_](#URL)”, _month year_ |
| 258 | |
DeedleFake | 786866a | 2018-09-21 18:41:56 -0400 | [diff] [blame] | 259 | To make it easier to see new feedback, please add your new proposal to the top of the section it is placed in. |