Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 409b515

Browse files
author
Luca Bianconi
committedJan 11, 2023
style: naming
1 parent 2d5c5f0 commit 409b515

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎buildcache/build_cache.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"github.com/arduino/go-paths-helper"
2222
)
2323

24-
// GetOrCreate registers the .last-used time in the directory
25-
func GetOrCreate(dir *paths.Path) error {
24+
// Used registers the .last-used time in the directory
25+
func Used(dir *paths.Path) error {
2626
unusedTTL := time.Hour
2727
_, err := newDirectoryCache(dir.Parent().String(), unusedTTL).
2828
GetOrCreate(dir.Base(), time.Now())

‎buildcache/build_cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Test_UpdateLastUsedFileExisting(t *testing.T) {
4949
}
5050

5151
func requireCorrectUpdate(t *testing.T, dir *paths.Path, prevModTime time.Time) {
52-
err := GetOrCreate(dir)
52+
err := Used(dir)
5353
require.Nil(t, err)
5454
expectedFile := dir.Join(lastUsedFileName)
5555
fileInfo, err := os.Stat(expectedFile.String())

‎commands/compile/compile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
216216
r.UsedLibraries = importedLibs
217217
}()
218218

219-
defer buildcache.GetOrCreate(builderCtx.BuildPath)
219+
defer buildcache.Used(builderCtx.BuildPath)
220220

221221
// if it's a regular build, go on...
222222
if err := builder.RunBuilder(builderCtx); err != nil {

‎legacy/builder/phases/core_builder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func compileCore(ctx *types.Context, buildPath *paths.Path, buildCachePath *path
123123

124124
// archive core.a
125125
if targetArchivedCore != nil && !ctx.OnlyUpdateCompilationDatabase {
126-
defer buildcache.GetOrCreate(targetArchivedCore)
126+
defer buildcache.Used(targetArchivedCore)
127127
targetArchivedCoreDir.MkdirAll()
128128
err := archiveFile.CopyTo(targetArchivedCore)
129129
if ctx.Verbose {

0 commit comments

Comments
 (0)
Please sign in to comment.