This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func main() { | |
fmt.Println(FindRelativePath("/some/source/path", "/some/destination/path")) // ../../destination/path | |
fmt.Println(FindRelativePath("/some/source/path", "/some/source")) // .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am tomwright on github. | |
* I am tomwright93 (https://keybase.io/tomwright93) on keybase. | |
* I have a public key ASAQMdS32fzeB_VbL9Omv1dl2BmOGPnleuqIQVMDoIcFigo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example usage | |
function ApiCall() { | |
this.middleware = new TomWright.Middleware(); | |
this.initMiddleware(); | |
}; | |
ApiCall.prototype.initMiddleware = function () { | |
this.middleware.use(this.ensureApiKeyExists); | |
this.middleware.use(this.checkForNotification); |