Fix docstrings

This commit is contained in:
tiltowait
2025-10-20 22:23:44 -07:00
parent a181519ce5
commit 5e6955dcb2
4 changed files with 4 additions and 5 deletions

View File

@ -51,8 +51,7 @@ func IsValidObjectId(oid string) bool {
return err == nil
}
// AbsPath combines base and path into the absolute path. If the absolute path
// is not within the base path, it returns an error.
// AbsPath combines base and path into an absolute path, returning an error if the result is outside base.
func AbsPath(base, path string) (string, error) {
absBase, err := filepath.Abs(base)
if err != nil {

View File

@ -61,8 +61,7 @@ without an internet connection.`,
},
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
// Execute runs the root command. Called by main.main().
func Execute() {
err := rootCmd.Execute()
if err != nil {

View File

@ -25,7 +25,7 @@ func imageFromBytes(data []byte) (image.Image, error) {
return image, err
}
// SaveWebP converts the given image data to WebP and saves at dest. Recommend 90 quality.
// SaveWebP converts image data to WebP format and saves it to dest with the specified quality (recommended: 90).
func SaveWebP(data []byte, dest string, quality int) error {
if checks.PathExists(dest) {
return fmt.Errorf("Error: %s already exists", dest)

View File

@ -215,6 +215,7 @@ func prepImageName(r UploadRequest) (string, error) {
return strings.Join([]string{guild, user, charId, imageName}, "/"), nil
}
// Run starts the HTTP server with the given configuration.
func Run(baseURL, imagesDir string, port, quality int) {
cfg := &Config{
ImagesDir: imagesDir,