Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
Add GoLand prefs; address various linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Jan 11, 2020
1 parent f3409b1 commit ed48e3b
Show file tree
Hide file tree
Showing 107 changed files with 1,504 additions and 1,324 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

18 changes: 18 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,26 @@ linters-settings:
- experimental
disabled-checks:
- sloppyReassign
- whyNoLint
gofmt:
simplify: true
golint:
min-confidence: 0.8
govet:
check-shadowing: true
settings:
printf:
funcs:
- Errorf
- Warnf
- Infof
- Debugf
- Fatalf
- StartRootSpanf
- StartSubSpanf
- EndWithMsgf
- Newf
- NewWithCausef
maligned:
suggest-new: true
misspell:
Expand Down Expand Up @@ -108,3 +122,7 @@ issues:
linters:
- staticcheck
text: "SA4000: identical expressions on the left and right side of the '==' operator"
- path: _gen\.go
linters:
- golint
text: "don't use underscores in Go names"
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/cef.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/Richard_Wilkes.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/dictionaries/rich.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/go.imports.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions cef/App_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

// AppProxy defines methods required for using App.
type AppProxy interface {
OnBeforeCommandLineProcessing(self *App, process_type string, command_line *CommandLine)
OnBeforeCommandLineProcessing(self *App, processType string, commandLine *CommandLine)
OnRegisterCustomSchemes(self *App, registrar *SchemeRegistrar)
GetResourceBundleHandler(self *App) *ResourceBundleHandler
GetBrowserProcessHandler(self *App) *BrowserProcessHandler
Expand Down Expand Up @@ -70,17 +70,17 @@ func (d *App) Base() *BaseRefCounted {
// before this function is called. Be cautious when using this function to
// modify command-line arguments for non-browser processes as this may result
// in undefined behavior including crashes.
func (d *App) OnBeforeCommandLineProcessing(process_type string, command_line *CommandLine) {
lookupAppProxy(d.Base()).OnBeforeCommandLineProcessing(d, process_type, command_line)
func (d *App) OnBeforeCommandLineProcessing(processType string, commandLine *CommandLine) {
lookupAppProxy(d.Base()).OnBeforeCommandLineProcessing(d, processType, commandLine)
}

//nolint:gocritic
//export gocef_app_on_before_command_line_processing
func gocef_app_on_before_command_line_processing(self *C.cef_app_t, process_type *C.cef_string_t, command_line *C.cef_command_line_t) {
func gocef_app_on_before_command_line_processing(self *C.cef_app_t, processType *C.cef_string_t, commandLine *C.cef_command_line_t) {
me__ := (*App)(self)
proxy__ := lookupAppProxy(me__.Base())
process_type_ := cefstrToString(process_type)
proxy__.OnBeforeCommandLineProcessing(me__, process_type_, (*CommandLine)(command_line))
processType_ := cefstrToString(processType)
proxy__.OnBeforeCommandLineProcessing(me__, processType_, (*CommandLine)(commandLine))
}

// OnRegisterCustomSchemes (on_register_custom_schemes)
Expand Down
30 changes: 15 additions & 15 deletions cef/AudioHandler_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (

// AudioHandlerProxy defines methods required for using AudioHandler.
type AudioHandlerProxy interface {
OnAudioStreamStarted(self *AudioHandler, browser *Browser, audio_stream_id, channels int32, channel_layout ChannelLayout, sample_rate, frames_per_buffer int32)
OnAudioStreamPacket(self *AudioHandler, browser *Browser, audio_stream_id int32, data **float32, frames int32, pts int64)
OnAudioStreamStopped(self *AudioHandler, browser *Browser, audio_stream_id int32)
OnAudioStreamStarted(self *AudioHandler, browser *Browser, audioStreamID, channels int32, channelLayout ChannelLayout, sampleRate, framesPerBuffer int32)
OnAudioStreamPacket(self *AudioHandler, browser *Browser, audioStreamID int32, data **float32, frames int32, pts int64)
OnAudioStreamStopped(self *AudioHandler, browser *Browser, audioStreamID int32)
}

// AudioHandler (cef_audio_handler_t from include/capi/cef_audio_handler_capi.h)
Expand Down Expand Up @@ -67,16 +67,16 @@ func (d *AudioHandler) Base() *BaseRefCounted {
// the layout of the channels and |sample_rate| is the stream sample rate.
// |frames_per_buffer| is the maximum number of frames that will occur in the
// PCM packet passed to OnAudioStreamPacket.
func (d *AudioHandler) OnAudioStreamStarted(browser *Browser, audio_stream_id, channels int32, channel_layout ChannelLayout, sample_rate, frames_per_buffer int32) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamStarted(d, browser, audio_stream_id, channels, channel_layout, sample_rate, frames_per_buffer)
func (d *AudioHandler) OnAudioStreamStarted(browser *Browser, audioStreamID, channels int32, channelLayout ChannelLayout, sampleRate, framesPerBuffer int32) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamStarted(d, browser, audioStreamID, channels, channelLayout, sampleRate, framesPerBuffer)
}

//nolint:gocritic
//export gocef_audio_handler_on_audio_stream_started
func gocef_audio_handler_on_audio_stream_started(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audio_stream_id C.int, channels C.int, channel_layout C.cef_channel_layout_t, sample_rate C.int, frames_per_buffer C.int) {
func gocef_audio_handler_on_audio_stream_started(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audioStreamID C.int, channels C.int, channelLayout C.cef_channel_layout_t, sampleRate C.int, framesPerBuffer C.int) {
me__ := (*AudioHandler)(self)
proxy__ := lookupAudioHandlerProxy(me__.Base())
proxy__.OnAudioStreamStarted(me__, (*Browser)(browser), int32(audio_stream_id), int32(channels), ChannelLayout(channel_layout), int32(sample_rate), int32(frames_per_buffer))
proxy__.OnAudioStreamStarted(me__, (*Browser)(browser), int32(audioStreamID), int32(channels), ChannelLayout(channelLayout), int32(sampleRate), int32(framesPerBuffer))
}

// OnAudioStreamPacket (on_audio_stream_packet)
Expand All @@ -88,30 +88,30 @@ func gocef_audio_handler_on_audio_stream_started(self *C.cef_audio_handler_t, br
// packet should be presented to the user. Based on |frames| and the
// |channel_layout| value passed to OnAudioStreamStarted you can calculate the
// size of the |data| array in bytes.
func (d *AudioHandler) OnAudioStreamPacket(browser *Browser, audio_stream_id int32, data **float32, frames int32, pts int64) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamPacket(d, browser, audio_stream_id, data, frames, pts)
func (d *AudioHandler) OnAudioStreamPacket(browser *Browser, audioStreamID int32, data **float32, frames int32, pts int64) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamPacket(d, browser, audioStreamID, data, frames, pts)
}

//nolint:gocritic
//export gocef_audio_handler_on_audio_stream_packet
func gocef_audio_handler_on_audio_stream_packet(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audio_stream_id C.int, data **C.float, frames C.int, pts C.int64) {
func gocef_audio_handler_on_audio_stream_packet(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audioStreamID C.int, data **C.float, frames C.int, pts C.int64) {
me__ := (*AudioHandler)(self)
proxy__ := lookupAudioHandlerProxy(me__.Base())
proxy__.OnAudioStreamPacket(me__, (*Browser)(browser), int32(audio_stream_id), (**float32)(unsafe.Pointer(data)), int32(frames), int64(pts))
proxy__.OnAudioStreamPacket(me__, (*Browser)(browser), int32(audioStreamID), (**float32)(unsafe.Pointer(data)), int32(frames), int64(pts))
}

// OnAudioStreamStopped (on_audio_stream_stopped)
// Called when the stream identified by |audio_stream_id| has stopped.
// OnAudioSteamStopped will always be called after OnAudioStreamStarted; both
// functions may be called multiple times for the same stream.
func (d *AudioHandler) OnAudioStreamStopped(browser *Browser, audio_stream_id int32) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamStopped(d, browser, audio_stream_id)
func (d *AudioHandler) OnAudioStreamStopped(browser *Browser, audioStreamID int32) {
lookupAudioHandlerProxy(d.Base()).OnAudioStreamStopped(d, browser, audioStreamID)
}

//nolint:gocritic
//export gocef_audio_handler_on_audio_stream_stopped
func gocef_audio_handler_on_audio_stream_stopped(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audio_stream_id C.int) {
func gocef_audio_handler_on_audio_stream_stopped(self *C.cef_audio_handler_t, browser *C.cef_browser_t, audioStreamID C.int) {
me__ := (*AudioHandler)(self)
proxy__ := lookupAudioHandlerProxy(me__.Base())
proxy__.OnAudioStreamStopped(me__, (*Browser)(browser), int32(audio_stream_id))
proxy__.OnAudioStreamStopped(me__, (*Browser)(browser), int32(audioStreamID))
}
12 changes: 6 additions & 6 deletions cef/BeforeDownloadCallback_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

// BeforeDownloadCallbackProxy defines methods required for using BeforeDownloadCallback.
type BeforeDownloadCallbackProxy interface {
Cont(self *BeforeDownloadCallback, download_path string, show_dialog int32)
Cont(self *BeforeDownloadCallback, downloadPath string, showDialog int32)
}

// BeforeDownloadCallback (cef_before_download_callback_t from include/capi/cef_download_handler_capi.h)
Expand Down Expand Up @@ -60,15 +60,15 @@ func (d *BeforeDownloadCallback) Base() *BaseRefCounted {
// for the download including the file name or leave blank to use the
// suggested name and the default temp directory. Set |show_dialog| to true
// (1) if you do wish to show the default "Save As" dialog.
func (d *BeforeDownloadCallback) Cont(download_path string, show_dialog int32) {
lookupBeforeDownloadCallbackProxy(d.Base()).Cont(d, download_path, show_dialog)
func (d *BeforeDownloadCallback) Cont(downloadPath string, showDialog int32) {
lookupBeforeDownloadCallbackProxy(d.Base()).Cont(d, downloadPath, showDialog)
}

//nolint:gocritic
//export gocef_before_download_callback_cont
func gocef_before_download_callback_cont(self *C.cef_before_download_callback_t, download_path *C.cef_string_t, show_dialog C.int) {
func gocef_before_download_callback_cont(self *C.cef_before_download_callback_t, downloadPath *C.cef_string_t, showDialog C.int) {
me__ := (*BeforeDownloadCallback)(self)
proxy__ := lookupBeforeDownloadCallbackProxy(me__.Base())
download_path_ := cefstrToString(download_path)
proxy__.Cont(me__, download_path_, int32(show_dialog))
downloadPath_ := cefstrToString(downloadPath)
proxy__.Cont(me__, downloadPath_, int32(showDialog))
}
6 changes: 3 additions & 3 deletions cef/BinaryValue_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// int gocef_binary_value_is_equal(cef_binary_value_t * self, cef_binary_value_t * that, int (CEF_CALLBACK *callback__)(cef_binary_value_t *, cef_binary_value_t *)) { return callback__(self, that); }
// cef_binary_value_t * gocef_binary_value_copy(cef_binary_value_t * self, cef_binary_value_t * (CEF_CALLBACK *callback__)(cef_binary_value_t *)) { return callback__(self); }
// size_t gocef_binary_value_get_size(cef_binary_value_t * self, size_t (CEF_CALLBACK *callback__)(cef_binary_value_t *)) { return callback__(self); }
// size_t gocef_binary_value_get_data(cef_binary_value_t * self, void * buffer, size_t buffer_size, size_t data_offset, size_t (CEF_CALLBACK *callback__)(cef_binary_value_t *, void *, size_t, size_t)) { return callback__(self, buffer, buffer_size, data_offset); }
// size_t gocef_binary_value_get_data(cef_binary_value_t * self, void * buffer, size_t bufferSize, size_t dataOffset, size_t (CEF_CALLBACK *callback__)(cef_binary_value_t *, void *, size_t, size_t)) { return callback__(self, buffer, bufferSize, dataOffset); }
"C"
)

Expand Down Expand Up @@ -74,6 +74,6 @@ func (d *BinaryValue) GetSize() uint64 {
// GetData (get_data)
// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
// the specified byte |data_offset|. Returns the number of bytes read.
func (d *BinaryValue) GetData(buffer unsafe.Pointer, buffer_size, data_offset uint64) uint64 {
return uint64(C.gocef_binary_value_get_data(d.toNative(), buffer, C.size_t(buffer_size), C.size_t(data_offset), d.get_data))
func (d *BinaryValue) GetData(buffer unsafe.Pointer, bufferSize, dataOffset uint64) uint64 {
return uint64(C.gocef_binary_value_get_data(d.toNative(), buffer, C.size_t(bufferSize), C.size_t(dataOffset), d.get_data))
}
Loading

0 comments on commit ed48e3b

Please sign in to comment.