You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decision about enabling or not enabling this rule.
Findings
For this rule (with default configuration), the following findings were found in the current codebase:
config/config_test.go:1093:15 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestPersisterInputStoreLoad
logger/structured_logger_test.go:30:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredFile
logger/structured_logger_test.go:62:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredFileDebug
logger/structured_logger_test.go:94:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredFileError
logger/structured_logger_test.go:128:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredAddDefaultLogLevel
logger/structured_logger_test.go:162:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredDerivedLogger
logger/structured_logger_test.go:199:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredDerivedLoggerWithAttributes
logger/structured_logger_test.go:239:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredWriteToTruncatedFile
logger/structured_logger_test.go:313:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestStructuredLogMessageKey
logger/text_logger_test.go:28:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextFile
logger/text_logger_test.go:49:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextFileDebug
logger/text_logger_test.go:70:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextFileError
logger/text_logger_test.go:92:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextAddDefaultLogLevel
logger/text_logger_test.go:113:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextWriteToTruncatedFile
logger/text_logger_test.go:165:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextWriteDerivedLogger
logger/text_logger_test.go:189:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTextWriteDerivedLoggerWithAttributes
plugins/inputs/bcache/bcache_test.go:27:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestBcacheGeneratesMetrics
plugins/inputs/conntrack/conntrack_test.go:39:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestDefaultsUsed
plugins/inputs/conntrack/conntrack_test.go:64:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestConfigsUsed
plugins/inputs/dpdk/dpdk_test.go:855:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in createSocketForTest
plugins/inputs/http_listener_v2/http_listener_v2_test.go:739:15 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestUnixSocket
plugins/inputs/intel_baseband/intel_baseband_test.go:132:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in newTempSocket
plugins/inputs/intel_baseband/intel_baseband_test.go:163:15 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in newTempLogFile
plugins/inputs/intel_dlb/intel_dlb_test.go:882:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in Test_rasReader
plugins/inputs/kernel_vmstat/kernel_vmstat_test.go:301:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in makeFakeVMStatFile
plugins/inputs/logparser/logparser_test.go:121:19 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestGrokParseLogFilesAppearLater
plugins/inputs/lustre2/lustre2_test.go:175:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesHealth
plugins/inputs/lustre2/lustre2_test.go:205:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesMetrics
plugins/inputs/lustre2/lustre2_test.go:276:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesClientMetrics
plugins/inputs/lustre2/lustre2_test.go:341:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesJobstatsMetrics
plugins/inputs/lustre2/lustre2_test.go:502:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesBrwstatsMetrics
plugins/inputs/lustre2/lustre2_test.go:577:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestLustre2GeneratesEvictionMetrics
plugins/inputs/socket_listener/socket_listener_test.go:133:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestSocketListener
plugins/inputs/socket_listener/socket_listener_test.go:280:15 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestLargeReadBufferUnixgram
plugins/inputs/tail/tail_test.go:197:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestGrokParseLogFilesWithMultilineTimeout
plugins/inputs/tail/tail_test.go:608:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTailEOF
plugins/inputs/tail/tail_test.go:648:16 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestCSVBehavior
plugins/inputs/x509_cert/x509_cert_test.go:42:18 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestGatherRemoteIntegration
plugins/inputs/x509_cert/x509_cert_test.go:167:14 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestGatherLocal
plugins/inputs/x509_cert/x509_cert_test.go:200:12 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestTags
plugins/inputs/x509_cert/x509_cert_test.go:249:12 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestGatherExcludeRootCerts
plugins/inputs/x509_cert/x509_cert_test.go:286:14 usetesting os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestGatherChain
plugins/inputs/x509_cert/x509_cert_test.go:490:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestClassification
plugins/inputs/zfs/zfs_linux_test.go:223:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestZfsPoolMetrics
plugins/inputs/zfs/zfs_linux_test.go:282:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestZfsGeneratesMetrics
plugins/outputs/remotefile/remotefile_test.go:33:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestStaticFileCreation
plugins/outputs/remotefile/remotefile_test.go:80:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestStaticFileAppend
plugins/outputs/remotefile/remotefile_test.go:177:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestDynamicFiles
plugins/outputs/remotefile/remotefile_test.go:245:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestCustomTemplateFunctions
plugins/outputs/remotefile/remotefile_test.go:300:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestCSVSerialization
plugins/outputs/remotefile/remotefile_test.go:360:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestForgettingFiles
plugins/outputs/remotefile/remotefile_test.go:470:17 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestTrackingMetrics
plugins/secretstores/jose/jose_test.go:60:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestSetListGet
plugins/secretstores/jose/jose_test.go:112:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestResolver
plugins/secretstores/jose/jose_test.go:140:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestResolverInvalid
plugins/secretstores/jose/jose_test.go:166:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestGetNonExistent
plugins/secretstores/jose/jose_test.go:189:18 usetesting os.MkdirTemp() could be replaced by t.TempDir() in TestGetInvalidPassword
The text was updated successfully, but these errors were encountered:
Description
This issue starts a discussion about enabling:
Example configuration
Examples
os.MkdirTemp
It can be replaced by:
os.TempDir
It can be replaced by:
os.CreateTemp
It can be replaced by:
os.Setenv
It can be replaced by:
os.Chdir
(Go >= 1.24)It can be replaced by:
context.Background
(Go >= 1.24)It can be replaced by:
context.TODO
(Go >= 1.24)It can be replaced by:
Expected output
Decision about enabling or not enabling this rule.
Findings
For this rule (with default configuration), the following findings were found in the current codebase:
The text was updated successfully, but these errors were encountered: