Skip to content

Commit a4539c3

Browse files
committed
chore: refactor
1 parent b99879a commit a4539c3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/cache.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ const getLintCacheDir = (): string => {
2323
return path.resolve(`${process.env.HOME}/.cache/golangci-lint`)
2424
}
2525

26-
const getCacheDirs = (): string[] => {
27-
return [getLintCacheDir()]
28-
}
29-
3026
const getIntervalKey = (invalidationIntervalDays: number): string => {
3127
const now = new Date()
3228
const secondsSinceEpoch = now.getTime() / 1000
@@ -81,7 +77,7 @@ export async function restoreCache(): Promise<void> {
8177
}
8278
core.saveState(State.CachePrimaryKey, primaryKey)
8379
try {
84-
const cacheKey = await cache.restoreCache(getCacheDirs(), primaryKey, restoreKeys)
80+
const cacheKey = await cache.restoreCache([getLintCacheDir()], primaryKey, restoreKeys)
8581
if (!cacheKey) {
8682
core.info(`Cache not found for input keys: ${[primaryKey, ...restoreKeys].join(", ")}`)
8783
return
@@ -111,7 +107,7 @@ export async function saveCache(): Promise<void> {
111107

112108
const startedAt = Date.now()
113109

114-
const cacheDirs = getCacheDirs()
110+
const cacheDirs = [getLintCacheDir()]
115111
const primaryKey = core.getState(State.CachePrimaryKey)
116112
if (!primaryKey) {
117113
utils.logWarning(`Error retrieving key from state.`)

0 commit comments

Comments
 (0)