mirror of
				https://github.com/TomWright/dasel.git
				synced 2022-05-22 02:32:45 +03:00 
			
		
		
		
	Merge pull request #211 from TomWright/expose-storage-package
Expose the storage package
This commit is contained in:
		
							
								
								
									
										13
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -9,6 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||||||
|  |  | ||||||
| - Nothing yet. | - Nothing yet. | ||||||
|  |  | ||||||
|  | ## [v1.24.1] - 2022-03-28 | ||||||
|  |  | ||||||
|  | ### Changed | ||||||
|  |  | ||||||
|  | - `storage` package has been moved outside the `internal` package. | ||||||
|  |  | ||||||
|  | ### Fixed | ||||||
|  |  | ||||||
|  | - New funcs added in `v1.24.0` can now be used as expected since you can now access the `storage.ReadWriteOption`. | ||||||
|  |  | ||||||
| ## [v1.24.0] - 2022-03-18 | ## [v1.24.0] - 2022-03-18 | ||||||
|  |  | ||||||
| ### Added | ### Added | ||||||
| @@ -428,7 +438,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||||||
|  |  | ||||||
| - Everything! | - Everything! | ||||||
|  |  | ||||||
| [unreleased]: https://github.com/TomWright/dasel/compare/v1.24.0...HEAD | [unreleased]: https://github.com/TomWright/dasel/compare/v1.24.1...HEAD | ||||||
|  | [v1.24.1]: https://github.com/TomWright/dasel/compare/v1.24.0...v1.24.1 | ||||||
| [v1.24.0]: https://github.com/TomWright/dasel/compare/v1.23.0...v1.24.0 | [v1.24.0]: https://github.com/TomWright/dasel/compare/v1.23.0...v1.24.0 | ||||||
| [v1.23.0]: https://github.com/TomWright/dasel/compare/v1.22.1...v1.23.0 | [v1.23.0]: https://github.com/TomWright/dasel/compare/v1.22.1...v1.23.0 | ||||||
| [v1.22.1]: https://github.com/TomWright/dasel/compare/v1.22.0...v1.22.1 | [v1.22.1]: https://github.com/TomWright/dasel/compare/v1.22.0...v1.22.1 | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| 	"github.com/tomwright/dasel" | 	"github.com/tomwright/dasel" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| 	"github.com/tomwright/dasel" | 	"github.com/tomwright/dasel" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"os" | 	"os" | ||||||
| 	"strconv" | 	"strconv" | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ package command | |||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ package command | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ package command | |||||||
| import ( | import ( | ||||||
| 	"bytes" | 	"bytes" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strings" | 	"strings" | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| 	"github.com/tomwright/dasel/internal/oflag" | 	"github.com/tomwright/dasel/internal/oflag" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"strings" | 	"strings" | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/spf13/cobra" | 	"github.com/spf13/cobra" | ||||||
| 	"github.com/tomwright/dasel" | 	"github.com/tomwright/dasel" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| ) | ) | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								node.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								node.go
									
									
									
									
									
								
							| @@ -2,12 +2,11 @@ package dasel | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
|  | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"os" | 	"os" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"regexp" | 	"regexp" | ||||||
|  |  | ||||||
| 	"github.com/tomwright/dasel/internal/storage" |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
| // Selector represents the selector for a node. | // Selector represents the selector for a node. | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ package dasel | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5,12 +5,12 @@ import ( | |||||||
| 	"encoding/json" | 	"encoding/json" | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"fmt" | 	"fmt" | ||||||
|  | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
|  |  | ||||||
| 	"github.com/tomwright/dasel" | 	"github.com/tomwright/dasel" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
| // ExampleNode_ReadmeExample tests the code from the readme explanation. | // ExampleNode_ReadmeExample tests the code from the readme explanation. | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| package storage_test | package storage_test | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"testing" | 	"testing" | ||||||
| ) | ) | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| package storage_test | package storage_test | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"testing" | 	"testing" | ||||||
| ) | ) | ||||||
| @@ -3,7 +3,7 @@ package storage_test | |||||||
| import ( | import ( | ||||||
| 	"bytes" | 	"bytes" | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
| @@ -194,7 +194,7 @@ var jsonData = map[string]interface{}{ | |||||||
| 
 | 
 | ||||||
| func TestLoadFromFile(t *testing.T) { | func TestLoadFromFile(t *testing.T) { | ||||||
| 	t.Run("ValidJSON", func(t *testing.T) { | 	t.Run("ValidJSON", func(t *testing.T) { | ||||||
| 		data, err := storage.LoadFromFile("../../tests/assets/example.json", &storage.JSONParser{}) | 		data, err := storage.LoadFromFile("../tests/assets/example.json", &storage.JSONParser{}) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			t.Errorf("unexpected error: %s", err) | 			t.Errorf("unexpected error: %s", err) | ||||||
| 			return | 			return | ||||||
| @@ -2,7 +2,7 @@ package storage_test | |||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"testing" | 	"testing" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| package storage_test | package storage_test | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
| @@ -3,11 +3,11 @@ package storage_test | |||||||
| import ( | import ( | ||||||
| 	"bytes" | 	"bytes" | ||||||
| 	"fmt" | 	"fmt" | ||||||
|  | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"io" | 	"io" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"testing" | 	"testing" | ||||||
| 
 | 
 | ||||||
| 	"github.com/tomwright/dasel/internal/storage" |  | ||||||
| 	"golang.org/x/text/encoding/charmap" | 	"golang.org/x/text/encoding/charmap" | ||||||
| 	"golang.org/x/text/encoding/unicode" | 	"golang.org/x/text/encoding/unicode" | ||||||
| ) | ) | ||||||
| @@ -1,7 +1,7 @@ | |||||||
| package storage_test | package storage_test | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"github.com/tomwright/dasel/internal/storage" | 	"github.com/tomwright/dasel/storage" | ||||||
| 	"reflect" | 	"reflect" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"testing" | 	"testing" | ||||||
		Reference in New Issue
	
	Block a user
	 Tom Wright
					Tom Wright