This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* temp * shuffle tests * update deps * temp * Schema handlers * bad renames * temp * update deps * schema test * structure for schema http test * schema tests
- Loading branch information
Gabe
authored
Apr 20, 2022
1 parent
80c3156
commit 2d036d3
Showing
23 changed files
with
858 additions
and
191 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package util | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
// GetMethodForDID gets a DID method from a did, the second part of the did (e.g. did:test:abcd, the method is 'test') | ||
func GetMethodForDID(did string) (string, error) { | ||
split := strings.Split(did, ":") | ||
if len(split) < 3 { | ||
return "", fmt.Errorf("malformed did: %s", did) | ||
} | ||
return split[1], nil | ||
} |
Oops, something went wrong.