aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-06-13 21:20:17 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-06-13 21:20:17 +0200
commit04a10f2acd73d88f90433755bfbe667c5174acb5 (patch)
tree34f1f911c12ac23383de6bb0ded154c7517d1dcd
parentf1fd665089dd6b0a1fa4fc72a64db3cbf0b6d5f5 (diff)
downloadmdir-04a10f2acd73d88f90433755bfbe667c5174acb5.tar.gz
mdir-04a10f2acd73d88f90433755bfbe667c5174acb5.tar.bz2
mdir-04a10f2acd73d88f90433755bfbe667c5174acb5.zip
ref: Rename snake case variable
My pythonic brain kicked in and I ended up naming a variable using snake case.
-rw-r--r--controller/controller.go2
-rw-r--r--db/model.go8
-rw-r--r--templates/entry.tmpl2
-rw-r--r--templates/index.tmpl2
4 files changed, 7 insertions, 7 deletions
diff --git a/controller/controller.go b/controller/controller.go
index 3552304..ffa89ce 100644
--- a/controller/controller.go
+++ b/controller/controller.go
@@ -42,7 +42,7 @@ func CreateEntry(c *gin.Context) {
var entry db.YdlEntry
c.ShouldBind(&entry)
db.DB.Create(&entry)
- spawnWorker(entry.Link, entry.Output_folder)
+ spawnWorker(entry.Link, entry.OutputFolder)
c.Redirect(http.StatusFound, "/")
}
diff --git a/db/model.go b/db/model.go
index 3094472..6f35cd0 100644
--- a/db/model.go
+++ b/db/model.go
@@ -4,8 +4,8 @@ import "gorm.io/gorm"
type YdlEntry struct {
gorm.Model
- Title string
- Link string
- Format string
- Output_folder string
+ Title string
+ Link string
+ Format string
+ OutputFolder string
}
diff --git a/templates/entry.tmpl b/templates/entry.tmpl
index dc5f2b6..642b501 100644
--- a/templates/entry.tmpl
+++ b/templates/entry.tmpl
@@ -16,7 +16,7 @@
</label>
<label for="output">
Output folder
- <input type="text" id="Output_folder" name="Output_folder" value="{{ .Output_folder }}" placeholder="Select a ralative folder" required>
+ <input type="text" id="OutputFolder" name="OutputFolder" value="{{ .OutputFolder }}" placeholder="Select a ralative folder" required>
</label>
<button type="submit">Submit</button>
</form>
diff --git a/templates/index.tmpl b/templates/index.tmpl
index 1880b5f..0b965f5 100644
--- a/templates/index.tmpl
+++ b/templates/index.tmpl
@@ -14,7 +14,7 @@
<tr>
<td>{{ .ID }}</td>
<td>{{ .Link }}</td>
- <td>{{ .Output_folder }}</td>
+ <td>{{ .OutputFolder }}</td>
<td>
<a href="entries/{{ .ID }}" >Edit</a>
</span>