Fix up a bunch of lint errors and other stuff

This commit is contained in:
Alessio 2023-10-14 19:45:51 -03:00
parent 62f14856d6
commit b6ada6371c
4 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,9 @@ pipeline:
secrets:
- offline_twatter_passwd
when: # At least one
- path: pkg/scraper/**
- path:
- pkg/scraper/**
- cmd/**
- branch: release-*
commands:
- cd cmd

View File

@ -36,7 +36,9 @@ insert into tombstone_types(rowid, short_name, tombstone_text) values
(4, 'unavailable', 'This Tweet is unavailable'),
(5, 'violated', 'This Tweet violated the Twitter Rules'),
(6, 'no longer exists', 'This Tweet is from an account that no longer exists'),
(7, 'age-restricted', 'Age-restricted adult content. This content might not be appropriate for people under 18 years old. To view this media, youll need to log in to Twitter');
(7, 'age-restricted', 'Age-restricted adult content. This content might not be appropriate for people under 18 years old. To view this media, youll need to log in to Twitter'),
(8, 'newer-version-available', 'Theres a new version of this Tweet');
create table tweets (rowid integer primary key,
id integer unique not null check(typeof(id) = 'integer'),

View File

@ -149,6 +149,8 @@ var MIGRATIONS = []string{
drop table likes_old;
commit;
vacuum;`,
`insert into tombstone_types(rowid, short_name, tombstone_text)
values (8, 'newer-version-available', 'Theres a new version of this Tweet')`,
}
var ENGINE_DATABASE_VERSION = len(MIGRATIONS)

View File

@ -150,13 +150,13 @@ func (s *Int64Slice) UnmarshalJSON(data []byte) error {
var result []string
if err := json.Unmarshal(data, &result); err != nil {
return err
panic(err)
}
for _, str := range result {
num, err := strconv.ParseInt(str, 10, 64)
if err != nil {
return err
panic(err)
}
*s = append(*s, num)
}