@@ -95,9 +95,10 @@ func TestGetServer(t *testing.T) {
9595}
9696
9797func TestPacmanConfIncludes (t * testing.T ) {
98- pacmanConfFile := filepath .Join (t .TempDir (), "pacman.conf" )
99- pacmanConfFileInclude1 := filepath .Join (t .TempDir (), "pacman-include1.conf" )
100- pacmanConfFileInclude2 := filepath .Join (t .TempDir (), "pacman-include2.conf" )
98+ tempDir := t .TempDir ()
99+ pacmanConfFile := filepath .Join (tempDir , "pacman.conf" )
100+ pacmanConfFileInclude1 := filepath .Join (tempDir , "pacman-include1.conf" )
101+ pacmanConfFileInclude2 := filepath .Join (tempDir , "pacman-include2.conf" )
101102
102103 if err := os .WriteFile (pacmanConfFile , fmt .Appendf (nil , "[core]\n Include=%s\n " , pacmanConfFileInclude1 ), 0o600 ); err != nil {
103104 t .Fatalf ("Failed to create pacman.conf: %v" , err )
@@ -123,12 +124,13 @@ func TestPacmanConfIncludes(t *testing.T) {
123124}
124125
125126func TestPacmanConfIncludesGlob (t * testing.T ) {
126- pacmanConfFile := filepath .Join (t .TempDir (), "pacman.conf" )
127- d := t .TempDir ()
128- pacmanConfFileInclude1 := filepath .Join (d , "pacman-include1.conf" )
129- pacmanConfFileInclude2 := filepath .Join (d , "pacman-include2.conf" )
127+ tempDir := t .TempDir ()
128+
129+ pacmanConfFile := filepath .Join (tempDir , "pacman.conf" )
130+ pacmanConfFileInclude1 := filepath .Join (tempDir , "pacman-include1.conf" )
131+ pacmanConfFileInclude2 := filepath .Join (tempDir , "pacman-include2.conf" )
130132
131- if err := os .WriteFile (pacmanConfFile , fmt .Appendf (nil , "[core]\n Include=%s/pacman-*.conf\n " , d ), 0o600 ); err != nil {
133+ if err := os .WriteFile (pacmanConfFile , fmt .Appendf (nil , "[core]\n Include=%s/pacman-*.conf\n " , tempDir ), 0o600 ); err != nil {
132134 t .Fatalf ("Failed to create pacman.conf: %v" , err )
133135 }
134136 if err := os .WriteFile (pacmanConfFileInclude1 , []byte ("" ), 0o600 ); err != nil {
0 commit comments