File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ func (c S3Config) GetFullBucketName() string {
34
34
35
35
func (c S3Config ) GetFullPath (basePath string ) string {
36
36
// i.e. basepath.json
37
- if c .FileExt == nil {
37
+ if c .FileExt == nil || * c . FileExt == "" {
38
38
return fmt .Sprintf ("%s" , basePath )
39
39
}
40
40
return fmt .Sprintf ("%s.%s" , basePath , * c .FileExt )
Original file line number Diff line number Diff line change @@ -227,6 +227,35 @@ func (s *S3ConfigSuite) TestGetFullPath() {
227
227
assert .Equal (s .T (), VALID_S3_CONFIG_FULL_PATH , fullPath )
228
228
}
229
229
230
+ func (s * S3ConfigSuite ) TestGetFullPathWithEmptyFileExt () {
231
+ baseBucket := VALID_S3_CONFIG_BASE_BUCKET
232
+ region := VALID_S3_CONFIG_REGION
233
+ fileExt := ""
234
+
235
+ c := & S3Config {
236
+ BaseBucket : & baseBucket ,
237
+ Region : & region ,
238
+ FileExt : & fileExt ,
239
+ }
240
+
241
+ fullPath := c .GetFullPath (VALID_S3_CONFIG_TEST_PATH )
242
+ assert .Equal (s .T (), VALID_S3_CONFIG_TEST_PATH , fullPath )
243
+ }
244
+
245
+ func (s * S3ConfigSuite ) TestGetFullPathWithNilFileExt () {
246
+ baseBucket := VALID_S3_CONFIG_BASE_BUCKET
247
+ region := VALID_S3_CONFIG_REGION
248
+
249
+ c := & S3Config {
250
+ BaseBucket : & baseBucket ,
251
+ Region : & region ,
252
+ FileExt : nil ,
253
+ }
254
+
255
+ fullPath := c .GetFullPath (VALID_S3_CONFIG_TEST_PATH )
256
+ assert .Equal (s .T (), VALID_S3_CONFIG_TEST_PATH , fullPath )
257
+ }
258
+
230
259
func (s * S3ConfigSuite ) TestGetRegion () {
231
260
baseBucket := VALID_S3_CONFIG_BASE_BUCKET
232
261
region := VALID_S3_CONFIG_REGION
You can’t perform that action at this time.
0 commit comments