This file contains hidden or 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
| func plusOne(digits []int) []int { | |
| // access array in reverse order. | |
| for i := len(digits)-1; i >= 0; i-- { | |
| if digits[i] != 9 { | |
| digits[i] = digits[i]+1 | |
| return digits | |
| } else if i > 0 && digits[i] == 9 { | |
| digits[i] = 0 | |
| } else { | |
| digits[i] = 1 |
This file contains hidden or 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 eventstore | |
| import ( | |
| "errors" | |
| "fmt" | |
| "log/slog" | |
| "sync" | |
| "time" | |
| ) |
This file contains hidden or 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
| { | |
| # Enable Debug mode | |
| debug | |
| # Disable admin API | |
| admin off | |
| } | |
| localhost { | |
| # https://caddyserver.com/docs/caddyfile/directives/push |