Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: list deletion #9

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "airbnb-base",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"globals": {
"$": "readonly",
"autocomplete": "readonly"
},
"rules": {
"indent": ["error", 4],
"no-restricted-properties": "off",
"prefer-destructuring": ["error", { "array": false, "object": true }],
"max-len": ["error", { "code": 150 }],
"arrow-parens": ["error", "as-needed"],
"linebreak-style": ["error", "windows"],
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
}
}
11 changes: 10 additions & 1 deletion .github/workflows/go.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Build

on:
push:
Expand All @@ -13,11 +13,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install modules
run: npm install

- name: Run ESLint
run: npx eslint static/frontend.js

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Generate
run: go generate -v ./...

- name: Build
run: go build -v ./...

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ kisslists
*.out

# Dependency directories (remove the comment below to include it)
# vendor/
# vendor/
node_modules
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/main.go"
"program": "${workspaceFolder}/main.go",
"args": ["-port", ":8080", "-database", "kisslists.sqlite"],
"env": {
"CGO_ENABLED": "1",
}
}

]
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ install:

generate:
@go generate ./...
./node_modules/.bin/eslint static/frontend.js
@echo "[OK] Files added to embed box"

build: clean generate
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ func main() {
flag.Parse()

// Test if the database is writable
if touch(*dbfile) != nil {
panic(fmt.Errorf("%v is not usable", *dbfile))
err := touch(*dbfile)
if err != nil {
panic(fmt.Errorf("%v is not writable: %s", *dbfile, err))
}

// Open database file
Expand Down