System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| <button id="btn" onClick="once(doStuff, res2)(1,2,3)">1</button> | |
| <button id="btn" onClick="doStuffOnce(1,2,3)">1-ok</button> | |
| <button id="btn" onClick="once(res1, res2)(100)">2</button> | |
| <button id="btn" onClick="resOnce(100)">2-ok</button> |
| <button id="btn" onClick="once(doStuff)(1,2,3)">1</button> | |
| <button id="btn" onClick="doStuffOnce(1,2,3)">1-ok</button> | |
| <button id="btn" onClick="once(shout)(100)">2</button> | |
| <button id="btn" onClick="shoutOnce(100)">2-ok</button> |
| const main = () => { | |
| const doStuff = (a, b, c) => { | |
| console.log(`done with ${a}, ${b}, ${c}`); | |
| // make smth else | |
| }; | |
| const once = (fn) => { | |
| let done = false; | |
| return (...args) => { | |
| if (!done) { |
| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups |